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

fix: policy status reconciliation #10032

Merged

Conversation

realshuting
Copy link
Member

@realshuting realshuting commented Apr 10, 2024

Explanation

This PR fixes policy status updates during webhook reconciliation by getting the latest policy object before sending update requests.

Related issue

Closes #10021.

Milestone of this PR

/1.12.0

Documentation (required for features)

My PR contains new or altered behavior to Kyverno.

What type of PR is this

/kind bug

Proposed Changes

Proof Manifests

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.

Further Comments

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

codecov bot commented Apr 10, 2024

Codecov Report

Attention: Patch coverage is 0% with 16 lines in your changes are missing coverage. Please review.

Project coverage is 9.96%. Comparing base (7c83ca1) to head (59db55e).

❗ Current head 59db55e differs from pull request most recent head 8dc83bb. Consider uploading reports for the commit 8dc83bb to get more accurate results

Files Patch % Lines
pkg/controllers/webhook/controller.go 0.00% 16 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##            main   #10032      +/-   ##
=========================================
- Coverage   9.96%    9.96%   -0.01%     
=========================================
  Files       1029     1029              
  Lines      91674    91686      +12     
=========================================
- Hits        9134     9132       -2     
- Misses     81542    81555      +13     
- Partials     998      999       +1     

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

@vishal-chdhry vishal-chdhry added this to the Kyverno Release 1.12.0 milestone Apr 10, 2024
Signed-off-by: ShutingZhao <shuting@nirmata.com>
MariamFahmy98
MariamFahmy98 previously approved these changes Apr 11, 2024
Copy link
Collaborator

@MariamFahmy98 MariamFahmy98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: ShutingZhao <shuting@nirmata.com>
@realshuting
Copy link
Member Author

@MariamFahmy98 - I fixed the chainsaw tests, please take a look.

@realshuting realshuting merged commit 3e7a7ac into kyverno:main Apr 12, 2024
244 of 248 checks passed
@realshuting
Copy link
Member Author

/cherry-pick release-1.12

gcp-cherry-pick-bot bot pushed a commit that referenced this pull request Apr 12, 2024
* fix: get latest policy object before updating status

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

* chore: remove debug code

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 Apr 12, 2024
realshuting added a commit that referenced this pull request Apr 15, 2024
* fix: get latest policy object before updating status



* chore: remove debug code



---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
Co-authored-by: shuting <shuting@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 milestone 1.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Webhook reconciliation always failed after the restart
4 participants