diff --git a/cmd/cli/kubectl-kyverno/commands/create/exception/command_test.go b/cmd/cli/kubectl-kyverno/commands/create/exception/command_test.go index 948bb2d716..96ef4b4b68 100644 --- a/cmd/cli/kubectl-kyverno/commands/create/exception/command_test.go +++ b/cmd/cli/kubectl-kyverno/commands/create/exception/command_test.go @@ -49,12 +49,11 @@ spec: background: true match: any: - - - kinds: - - Pod - - Deployment - names: - - test-* + - kinds: + - Pod + - Deployment + names: + - test-* exceptions: - policyName: policy ruleNames: @@ -82,16 +81,15 @@ spec: background: true match: all: - - - kinds: - - Pod - - Deployment - names: - - test-* - namespaces: - - test - operations: - - UPDATE + - kinds: + - Pod + - Deployment + names: + - test-* + namespaces: + - test + operations: + - UPDATE exceptions: - policyName: policy ruleNames: diff --git a/cmd/cli/kubectl-kyverno/commands/create/templates/exception.yaml b/cmd/cli/kubectl-kyverno/commands/create/templates/exception.yaml index 324ab053b0..a410ba0abf 100644 --- a/cmd/cli/kubectl-kyverno/commands/create/templates/exception.yaml +++ b/cmd/cli/kubectl-kyverno/commands/create/templates/exception.yaml @@ -10,29 +10,28 @@ spec: {{- with .Match.Any }} any: {{- range . }} - - {{- with .Kinds }} - kinds: + - kinds: {{- range . }} - - {{ . }} + - {{ . }} {{- end }} {{- end }} {{- with .Names }} - names: + names: {{- range . }} - - {{ . }} + - {{ . }} {{- end }} {{- end }} {{- with .Namespaces }} - namespaces: + namespaces: {{- range . }} - - {{ . }} + - {{ . }} {{- end }} {{- end }} {{- with .Operations }} - operations: + operations: {{- range . }} - - {{ . }} + - {{ . }} {{- end }} {{- end }} {{- end }} @@ -41,29 +40,28 @@ spec: {{- with .Match.All }} all: {{- range . }} - - {{- with .Kinds }} - kinds: + - kinds: {{- range . }} - - {{ . }} + - {{ . }} {{- end }} {{- end }} {{- with .Names }} - names: + names: {{- range . }} - - {{ . }} + - {{ . }} {{- end }} {{- end }} {{- with .Namespaces }} - namespaces: + namespaces: {{- range . }} - - {{ . }} + - {{ . }} {{- end }} {{- end }} {{- with .Operations }} - operations: + operations: {{- range . }} - - {{ . }} + - {{ . }} {{- end }} {{- end }} {{- end }}