Skip to content

Conversation

MariamFahmy98
Copy link
Contributor

@MariamFahmy98 MariamFahmy98 commented Nov 15, 2023

Explanation

This PR uses the v2beta1 version for kyverno create exception .

Related issue

None

Milestone of this PR

/milestone 1.11.1

What type of PR is this

/kind bug

Proposed Changes

Proof Manifests

Run the kyverno create command as follows:

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

The output should be an exception policy of v2beta1:

apiVersion: kyverno.io/v2beta1
kind: PolicyException
metadata:
  name: my-exception
  namespace: my-ns
spec:
  background: true
  match:
    any:
      -
        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 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5fb3621) 33.56% compared to head (88bf956) 33.56%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8908   +/-   ##
=======================================
  Coverage   33.56%   33.56%           
=======================================
  Files         315      315           
  Lines       24905    24905           
=======================================
  Hits         8359     8359           
  Misses      15754    15754           
  Partials      792      792           

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

@MariamFahmy98 MariamFahmy98 enabled auto-merge (squash) November 15, 2023 11:49
@MariamFahmy98 MariamFahmy98 merged commit c7e2cb1 into kyverno:main Nov 15, 2023
@MariamFahmy98 MariamFahmy98 deleted the create-exception-cli branch November 15, 2023 12:04
@chipzoller
Copy link
Contributor

Related to #8945

@MariamFahmy98
Copy link
Contributor Author

/cherry-pick release-1.11

@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
…#8908)

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
…#8908)

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
…#8908)

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.

3 participants