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:
parent
076196688e
commit
eb6ab9d2d8
1 changed files with 5 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue