1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00

fix rule mis-application

This commit is contained in:
Shuting Zhao 2019-12-26 19:05:12 -08:00
parent 076196688e
commit eb6ab9d2d8

View file

@ -94,6 +94,11 @@ func Mutate(policyContext PolicyContext) (resp response.EngineResponse) {
// insert annotation to podtemplate if resource is pod controller
if strings.Contains(PodControllers, resource.GetKind()) {
ann := resource.GetAnnotations()
if _, ok := ann[PodControllersAnnotation]; !ok {
continue
}
var ruleResponse response.RuleResponse
ruleResponse, patchedResource = processOverlay(ctx, podTemplateRule, patchedResource)
if !ruleResponse.Success {