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 96ef4b4b68..e177c733d9 100644 --- a/cmd/cli/kubectl-kyverno/commands/create/exception/command_test.go +++ b/cmd/cli/kubectl-kyverno/commands/create/exception/command_test.go @@ -44,7 +44,7 @@ apiVersion: kyverno.io/v2beta1 kind: PolicyException metadata: name: test - namespace: + namespace: default spec: background: true match: @@ -76,7 +76,7 @@ apiVersion: kyverno.io/v2beta1 kind: PolicyException metadata: name: test - namespace: + namespace: default spec: background: true match: diff --git a/cmd/cli/kubectl-kyverno/commands/create/templates/exception.yaml b/cmd/cli/kubectl-kyverno/commands/create/templates/exception.yaml index a410ba0abf..bdb65cc3a0 100644 --- a/cmd/cli/kubectl-kyverno/commands/create/templates/exception.yaml +++ b/cmd/cli/kubectl-kyverno/commands/create/templates/exception.yaml @@ -2,7 +2,7 @@ apiVersion: kyverno.io/v2beta1 kind: PolicyException metadata: name: {{ .Name }} - namespace: {{ .Namespace }} + namespace: {{ or .Namespace "default" }} spec: background: {{ .Background }} match: