Skip to content

Commit e6c1528

Browse files
committed
Remove WebHookMatchKey label from target spec template if it exists
1 parent ff662cc commit e6c1528

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/mutation/mutation_deploy.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ func injectionDeploy(request *admissionv1.AdmissionRequest) (*admissionv1.Admiss
111111
target.Spec.Template.Labels[config.ApplicationLabel] = target.Labels[config.ApplicationLabel]
112112
target.Spec.Template.Labels[config.ServiceNameLabel] = target.Labels[config.ServiceNameLabel]
113113
target.Spec.Template.Labels[config.ServiceGroupLabel] = target.Labels[config.ServiceGroupLabel]
114+
if _, ok := target.Spec.Template.Labels[config.WebHookMatchKey]; ok {
115+
// remove
116+
delete(target.Spec.Template.Labels, config.WebHookMatchKey)
117+
}
114118
added = true
115119
} else {
116120
// Check if the x-live-enabled label exists in deploy's spec.template.metadata.labels; if not, add it.

0 commit comments

Comments
 (0)