Skip to content

[Bug] [CLI] kyverno create exception has formatting error #8945

@chipzoller

Description

@chipzoller

Kyverno CLI Version

1.11.0

Description

The output from kyverno create exception results in a formatting error where a dash is on a single line. Notice how a dash appears between lines all and kinds.

$ kyverno create exception my-exception --namespace my-ns --policy-rules "policy,rule-1,rule-2" --all "kind=Pod,kind=Deployment,name=test-*"
apiVersion: kyverno.io/v2alpha1
kind: PolicyException
metadata:
  name: my-exception
  namespace: my-ns
spec:
  background: true
  match:
    all:
      -
        kinds:
          - Pod
          - Deployment
        names:
          - test-*
  exceptions:
    - policyName: policy
      ruleNames:
        - rule-1
        - rule-2

Steps to reproduce

  1. kyverno create exception my-exception --namespace my-ns --policy-rules "policy,rule-1,rule-2" --all "kind=Pod,kind=Deployment,name=test-*"

Expected behavior

apiVersion: kyverno.io/v2alpha1
kind: PolicyException
metadata:
  name: my-exception
  namespace: my-ns
spec:
  background: true
  match:
    all:
    - kinds:
        - Pod
        - Deployment
      names:
        - test-*
  exceptions:
    - policyName: policy
      ruleNames:
        - rule-1
        - rule-2

Screenshots

No response

Kyverno logs

No response

Slack discussion

No response

Troubleshooting

  • I have read and followed the troubleshooting guide.
  • I have searched other issues in this repository and mine is not recorded.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtype:clicli releated issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions