mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 16:06:56 +00:00
* removing hardcoded namespace from the code * Added to helm chart * removing hard-coded namespace and deployment name from config, generate, checker * added namespace to configMap, service, serviceAccount * updated installation documentation passing `KYVERNO_NAMESPACE` while running in debug mode. * Update installation.md removing `kyverno` only namespace note
22 lines
604 B
Go
22 lines
604 B
Go
package cleanup
|
|
|
|
import (
|
|
kyvernoclient "github.com/nirmata/kyverno/pkg/client/clientset/versioned"
|
|
"github.com/nirmata/kyverno/pkg/config"
|
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
)
|
|
|
|
// ControlInterface manages resource deletes
|
|
type ControlInterface interface {
|
|
Delete(gr string) error
|
|
}
|
|
|
|
//Control provides implementation to manage resource
|
|
type Control struct {
|
|
client kyvernoclient.Interface
|
|
}
|
|
|
|
//Delete deletes the specified resource
|
|
func (c Control) Delete(gr string) error {
|
|
return c.client.KyvernoV1().GenerateRequests(config.KubePolicyNamespace).Delete(gr, &metav1.DeleteOptions{})
|
|
}
|