forked from kyverno/kyverno
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue-5100:added logic to check nsPolicies #18
Open
SANSKARJAIN2
wants to merge
5
commits into
develop
Choose a base branch
from
issue_5100
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SANSKARJAIN2
requested review from
samkulkarni20,
shahpratikr,
sandeshlmore,
ansalamdaniel and
ApsTomar
November 2, 2022 15:13
shahpratikr
reviewed
Nov 3, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add unit tests
sandeshlmore
reviewed
Nov 7, 2022
sandeshlmore
approved these changes
Nov 10, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
shahpratikr
approved these changes
Nov 11, 2022
ApsTomar
approved these changes
Nov 11, 2022
samkulkarni20
approved these changes
Nov 11, 2022
Signed-off-by: SANSKARJAIN2 <sanskar.shanu@gmail.com>
Signed-off-by: SANSKARJAIN2 <sanskar.jain@infracloud.io>
SANSKARJAIN2
force-pushed
the
issue_5100
branch
from
November 16, 2022 13:03
338db76
to
c9a02bd
Compare
Signed-off-by: SANSKARJAIN2 <sanskar.jain@infracloud.io>
Signed-off-by: SANSKARJAIN2 <sanskar.jain@infracloud.io>
Signed-off-by: SANSKARJAIN2 <sanskar.jain@infracloud.io>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: SANSKARJAIN2 sanskar.jain@infracloud.io
Explanation
Upon editing the generated resource, only cluster policies are fetched to synchronize the resource with the source. This PR contains logic to support sync when the resource is generated via a namespaced policy.
Related issue
closes: 5100
Milestone of this PR
What type of PR is this
Proposed Changes
In order to sync the generated resource with the source resource when the generated resource is edited, only the cluster policies were fetched.
To detect which policy to fetch( cluster or namespaced) a new label is introduced
policy.kyverno.io/policy-kind
which can have can have eitherNamespace
orCluster
indicating the kind of policy that created this resource.The default behavior is to fetch cluster policies.
Proof Manifests
poltest
output:
output:
output:
output:
myclonedsecret
is created in poltest namespace have same value as regcred in poltest namespaceoutput:
output:
myclonedsecret
and wait for 2-3 seconds.output:
myclonedsecret
is reverted to the original value ( same asregcred
)Before fix:
After fix
Checklist
Further Comments