Skip to content
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

feat: mutate existing resources #3669

Merged
merged 69 commits into from
Apr 25, 2022

Conversation

realshuting
Copy link
Member

@realshuting realshuting commented Apr 25, 2022

Related issue

Closes #1607.
Closes #1722.
Closes #2139.

Fixes #3620.

Milestone of this PR

/1.7.0

What type of PR is this

/feature

Proposed Changes

kyverno/KDP#4

Proof Manifests

See regression tests table https://docs.google.com/document/d/1-iNsUs-P8fVxIe4odJh718vofaGjEfRRorOXNT8RxZc/edit?usp=sharing.

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:

Further Comments

realshuting and others added 30 commits April 14, 2022 18:53
* add attributes for post mutation

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* add UR informer to webhook server

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* - replace gr with ur in the webhook server; - create ur for mutateExsiting policies

Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>

# Conflicts:
#	cmd/cli/kubectl-kyverno/apply/apply_command.go
#	cmd/cli/kubectl-kyverno/utils/common/common.go
#	pkg/background/generate/generate.go
#	pkg/engine/validation_test.go
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>

# Conflicts:
#	config/crds/kyverno.io_updaterequests.yaml
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: prateekpandey14 <prateek.pandey@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>

# Conflicts:
#	pkg/engine/mutation.go
#	pkg/engine/validate/validate.go
#	pkg/webhooks/generate/generate.go
* add attributes for post mutation

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* add UR informer to webhook server

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* - replace gr with ur in the webhook server; - create ur for mutateExsiting policies

Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: prateekpandey14 <prateek.pandey@nirmata.com>
* refactor cli code from pkg to cmd

Signed-off-by: Mritunjay Sharma <mritunjaysharma394@gmail.com>

* fixes in imports

Signed-off-by: Mritunjay Sharma <mritunjaysharma394@gmail.com>

* fixes tests

Signed-off-by: Mritunjay Sharma <mritunjaysharma394@gmail.com>

* fixed conflicts

Signed-off-by: Mritunjay Sharma <mritunjaysharma394@gmail.com>

* moved non-commands to utils

Signed-off-by: Mritunjay Sharma <mritunjaysharma394@gmail.com>

Co-authored-by: Vyankatesh Kudtarkar <vyankateshkd@gmail.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
* add-kms-libraries

Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>

* Shifted providers to cosign package

Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: Sambhav Kothari <skothari44@bloomberg.net>
Signed-off-by: Shubham Gupta <shubham.gupta2956@gmail.com>

Co-authored-by: Jim Bugwadia <jim@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
realshuting and others added 14 commits April 22, 2022 20:52
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
@realshuting realshuting changed the title Dev background processing feat: mutate existing resources Apr 25, 2022
@codecov-commenter
Copy link

codecov-commenter commented Apr 25, 2022

Codecov Report

Merging #3669 (7ba69d6) into main (cbf93ff) will decrease coverage by 0.19%.
The diff coverage is 25.68%.

@@            Coverage Diff             @@
##             main    #3669      +/-   ##
==========================================
- Coverage   26.95%   26.75%   -0.20%     
==========================================
  Files         137      139       +2     
  Lines       19528    19784     +256     
==========================================
+ Hits         5263     5294      +31     
- Misses      13620    13834     +214     
- Partials      645      656      +11     
Impacted Files Coverage Δ
api/kyverno/v1/common_types.go 0.00% <ø> (ø)
api/kyverno/v1/resource_description_types.go 72.72% <ø> (ø)
api/kyverno/v1/rule_types.go 52.97% <0.00%> (-0.64%) ⬇️
api/kyverno/v1/spec_types.go 26.47% <ø> (ø)
api/kyverno/v1/zz_generated.deepcopy.go 0.00% <0.00%> (ø)
cmd/cli/kubectl-kyverno/utils/common/common.go 12.26% <0.00%> (ø)
pkg/background/generate/generate.go 0.00% <0.00%> (ø)
pkg/engine/background.go 0.00% <0.00%> (ø)
pkg/engine/generation.go 0.00% <0.00%> (ø)
pkg/engine/policyContext.go 100.00% <ø> (ø)
... and 31 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cbf93ff...7ba69d6. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet