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: create events for cleanup policies #5982

Merged
merged 1 commit into from
Jan 12, 2023

Conversation

realshuting
Copy link
Member

@realshuting realshuting commented Jan 12, 2023

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

Explanation

With this change, an event is created for the successfully applied cleanup policy,

Related issue

Closes #5976.

Milestone of this PR

/1.9.0

What type of PR is this

/enhancement

Proposed Changes

Proof Manifests

See events are created for both cluatercleanuppolicy and cleanuppolicy:

✗ k describe cleanpol cleanup-pod
...
Events:
  Type    Reason         Age   From                Message
  ----    ------         ----  ----                -------
  Normal  PolicyApplied  45s   cleanup-controller  successfully cleaned up the target resource Pod/default/example


✗ k describe ccleanpol cleanup-pod  
...
Events:
  Type    Reason         Age   From                Message
  ----    ------         ----  ----                -------
  Normal  PolicyApplied  53s   cleanup-controller  successfully cleaned up the target resource Pod/default/example

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: ShutingZhao <shuting@nirmata.com>
@realshuting
Copy link
Member Author

/cherry-pick release-1.9

@realshuting realshuting enabled auto-merge (squash) January 12, 2023 07:50
@codecov
Copy link

codecov bot commented Jan 12, 2023

Codecov Report

Merging #5982 (6d8224b) into main (1997a29) will decrease coverage by 0.03%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #5982      +/-   ##
==========================================
- Coverage   35.89%   35.86%   -0.04%     
==========================================
  Files         192      193       +1     
  Lines       21060    21078      +18     
==========================================
  Hits         7560     7560              
- Misses      12666    12684      +18     
  Partials      834      834              
Impacted Files Coverage Δ
cmd/cleanup-controller/handlers/cleanup/event.go 0.00% <0.00%> (ø)
...md/cleanup-controller/handlers/cleanup/handlers.go 0.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@realshuting realshuting merged commit c6a9df5 into kyverno:main Jan 12, 2023
gcp-cherry-pick-bot bot pushed a commit that referenced this pull request Jan 12, 2023
Signed-off-by: ShutingZhao <shuting@nirmata.com>

Signed-off-by: ShutingZhao <shuting@nirmata.com>
@realshuting realshuting added the cherry-pick-completed The PR was cherry-picked (or merged) to required release branches label Jan 12, 2023
realshuting added a commit that referenced this pull request Jan 12, 2023
Signed-off-by: ShutingZhao <shuting@nirmata.com>

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

Signed-off-by: ShutingZhao <shuting@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
MdSahil-oss pushed a commit to MdSahil-oss/kyverno that referenced this pull request Jan 13, 2023
Signed-off-by: ShutingZhao <shuting@nirmata.com>

Signed-off-by: ShutingZhao <shuting@nirmata.com>
Signed-off-by: MdSahil-oss <Mohdssahil1@gmail.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 milestone 1.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement] Generate events upon cleanup policy deletion events
2 participants