mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-13 19:28:55 +00:00
Removing OwnerReference (#2251)
* removing OwnerReference Signed-off-by: NoSkillGirl <singhpooja240393@gmail.com> * removing comments Signed-off-by: NoSkillGirl <singhpooja240393@gmail.com>
This commit is contained in:
parent
adb0170001
commit
f9616cbab1
4 changed files with 0 additions and 33 deletions
|
@ -7,7 +7,6 @@ import (
|
|||
"github.com/kyverno/kyverno/pkg/tls"
|
||||
admregapi "k8s.io/api/admissionregistration/v1beta1"
|
||||
apps "k8s.io/api/apps/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
rest "k8s.io/client-go/rest"
|
||||
|
@ -53,23 +52,6 @@ func extractCA(config *rest.Config) (result []byte) {
|
|||
return config.TLSClientConfig.CAData
|
||||
}
|
||||
|
||||
func (wrc *Register) constructOwner() v1.OwnerReference {
|
||||
logger := wrc.log
|
||||
|
||||
kubePolicyDeployment, _, err := wrc.GetKubePolicyDeployment()
|
||||
if err != nil {
|
||||
logger.Error(err, "failed to construct OwnerReference")
|
||||
return v1.OwnerReference{}
|
||||
}
|
||||
|
||||
return v1.OwnerReference{
|
||||
APIVersion: config.DeploymentAPIVersion,
|
||||
Kind: config.DeploymentKind,
|
||||
Name: kubePolicyDeployment.ObjectMeta.Name,
|
||||
UID: kubePolicyDeployment.ObjectMeta.UID,
|
||||
}
|
||||
}
|
||||
|
||||
// GetKubePolicyDeployment gets Kyverno deployment using the resource cache
|
||||
// it does not initialize any client call
|
||||
func (wrc *Register) GetKubePolicyDeployment() (*apps.Deployment, *unstructured.Unstructured, error) {
|
||||
|
|
|
@ -13,9 +13,6 @@ func (wrc *Register) contructPolicyValidatingWebhookConfig(caData []byte) *admre
|
|||
return &admregapi.ValidatingWebhookConfiguration{
|
||||
ObjectMeta: v1.ObjectMeta{
|
||||
Name: config.PolicyValidatingWebhookConfigurationName,
|
||||
OwnerReferences: []v1.OwnerReference{
|
||||
wrc.constructOwner(),
|
||||
},
|
||||
},
|
||||
Webhooks: []admregapi.ValidatingWebhook{
|
||||
generateValidatingWebhook(
|
||||
|
@ -62,9 +59,6 @@ func (wrc *Register) contructPolicyMutatingWebhookConfig(caData []byte) *admrega
|
|||
return &admregapi.MutatingWebhookConfiguration{
|
||||
ObjectMeta: v1.ObjectMeta{
|
||||
Name: config.PolicyMutatingWebhookConfigurationName,
|
||||
OwnerReferences: []v1.OwnerReference{
|
||||
wrc.constructOwner(),
|
||||
},
|
||||
},
|
||||
Webhooks: []admregapi.MutatingWebhook{
|
||||
generateMutatingWebhook(
|
||||
|
|
|
@ -464,9 +464,6 @@ func (wrc *Register) constructVerifyMutatingWebhookConfig(caData []byte) *admreg
|
|||
return &admregapi.MutatingWebhookConfiguration{
|
||||
ObjectMeta: v1.ObjectMeta{
|
||||
Name: config.VerifyMutatingWebhookConfigurationName,
|
||||
OwnerReferences: []v1.OwnerReference{
|
||||
wrc.constructOwner(),
|
||||
},
|
||||
},
|
||||
Webhooks: []admregapi.MutatingWebhook{
|
||||
generateMutatingWebhook(
|
||||
|
|
|
@ -50,9 +50,6 @@ func (wrc *Register) constructDefaultMutatingWebhookConfig(caData []byte) *admre
|
|||
return &admregapi.MutatingWebhookConfiguration{
|
||||
ObjectMeta: v1.ObjectMeta{
|
||||
Name: config.MutatingWebhookConfigurationName,
|
||||
OwnerReferences: []v1.OwnerReference{
|
||||
wrc.constructOwner(),
|
||||
},
|
||||
},
|
||||
Webhooks: []admregapi.MutatingWebhook{webhookCfg},
|
||||
}
|
||||
|
@ -121,9 +118,6 @@ func (wrc *Register) constructDefaultValidatingWebhookConfig(caData []byte) *adm
|
|||
return &admregapi.ValidatingWebhookConfiguration{
|
||||
ObjectMeta: v1.ObjectMeta{
|
||||
Name: config.ValidatingWebhookConfigurationName,
|
||||
OwnerReferences: []v1.OwnerReference{
|
||||
wrc.constructOwner(),
|
||||
},
|
||||
},
|
||||
Webhooks: []admregapi.ValidatingWebhook{
|
||||
generateValidatingWebhook(
|
||||
|
|
Loading…
Add table
Reference in a new issue