Skip to content

Conversation

MariamFahmy98
Copy link
Contributor

@MariamFahmy98 MariamFahmy98 commented Nov 22, 2023

Explanation

In kyverno create exception, there is an additional dash appears between lines any/all and kinds. This PR removes it.

Related issue

Closes #8945

Milestone of this PR

/milestone 1.11.1

What type of PR is this

/kind bug

Proposed Changes

Proof Manifests

Run the following command:

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

Here is the created exception:

apiVersion: kyverno.io/v2beta1
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

Checklist

  • I have read the contributing guidelines.
  • I have read the PR documentation guide and followed the process including adding proof manifests to this PR.
  • This is a bug fix and I have added unit tests that prove my fix is effective.
  • This is a feature and I have added CLI tests that are applicable.
  • My PR needs to be cherry picked to a specific release branch which is .
  • My PR contains new or altered behavior to Kyverno and
    • CLI support should be added and my PR doesn't contain that functionality.
    • I have added or changed the documentation myself in an existing PR and the link is:
    • I have raised an issue in kyverno/website to track the documentation update and the link is:

Further Comments

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Copy link

codecov bot commented Nov 22, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (72524c7) 33.60% compared to head (2dccdc3) 33.60%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8983   +/-   ##
=======================================
  Coverage   33.60%   33.60%           
=======================================
  Files         315      315           
  Lines       24953    24953           
=======================================
  Hits         8386     8386           
  Misses      15769    15769           
  Partials      798      798           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MariamFahmy98 MariamFahmy98 merged commit 96e2236 into kyverno:main Nov 22, 2023
@MariamFahmy98 MariamFahmy98 deleted the cli-create-exception branch November 22, 2023 13:40
@MariamFahmy98
Copy link
Contributor Author

/cherry-pick release-1.11

@realshuting
Copy link
Member

@MariamFahmy98 - the cherry-pick failed, can you do that manually?

@realshuting realshuting added the cherry-pick-completed The PR was cherry-picked (or merged) to required release branches label Nov 27, 2023
vishal-chdhry pushed a commit to vishal-chdhry/kyverno that referenced this pull request Jan 5, 2024
…8983)

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
vishal-chdhry pushed a commit to vishal-chdhry/kyverno that referenced this pull request Jan 5, 2024
…8983)

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
vishal-chdhry pushed a commit to vishal-chdhry/kyverno that referenced this pull request Jan 6, 2024
…8983)

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-completed The PR was cherry-picked (or merged) to required release branches cherry-pick-required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] [CLI] kyverno create exception has formatting error
2 participants