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: unreliable webhook behaviour on gatekeeper pod startup and shutdown #3780

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

l0wl3vel
Copy link

@l0wl3vel l0wl3vel commented Jan 15, 2025

What this PR does / why we need it:

This PR fixes webhook requests getting routed to starting and stopping gatekeeper pods, that are not ready to serve requests. The implications of this behaviour are explained in #3776

Which issue(s) this PR fixes:
Fixes #3776

Special notes for your reviewer:

The grace period for handling termination will not work when using Tilt to test. It will terminate instantly, like it did before.

We tracked this down to the rerun-process-handler Tilt uses to wrap the application to test.

The start.sh script traps SIGTERM and INTERRUPTS, the two signals we handle, and replaces them with SIGKILL, which we do not intercept.

Running make run yields the intended behaviour.

Co-authored by Nils Federle (@nilsfed) and Paweł Kukliński (@pawelkuk)

@l0wl3vel l0wl3vel force-pushed the fix/webhook-availability branch 4 times, most recently from 46de743 to 937a91e Compare January 20, 2025 08:58
@l0wl3vel l0wl3vel marked this pull request as ready for review January 20, 2025 09:06
@l0wl3vel l0wl3vel requested a review from a team as a code owner January 20, 2025 09:06
@l0wl3vel l0wl3vel force-pushed the fix/webhook-availability branch from 937a91e to fcd6e13 Compare January 20, 2025 09:07
@l0wl3vel l0wl3vel changed the title fix: add upstream TLS check to readiness probe fix: fix unreliable webhook behaviour on gatekeeper pod statup and shutdown Jan 20, 2025
@l0wl3vel l0wl3vel changed the title fix: fix unreliable webhook behaviour on gatekeeper pod statup and shutdown fix: unreliable webhook behaviour on gatekeeper pod statup and shutdown Jan 20, 2025
Copy link
Contributor

@JaydipGabani JaydipGabani left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

main.go Outdated Show resolved Hide resolved
@l0wl3vel l0wl3vel force-pushed the fix/webhook-availability branch from fe4bc04 to 262f5c4 Compare January 22, 2025 13:44
@l0wl3vel
Copy link
Author

@JaydipGabani Integrated your suggestion. Could you please rerun the workflows?

@l0wl3vel l0wl3vel changed the title fix: unreliable webhook behaviour on gatekeeper pod statup and shutdown fix: unreliable webhook behaviour on gatekeeper pod startup and shutdown Jan 22, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 47.74%. Comparing base (3350319) to head (8b50591).
Report is 239 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (3350319) and HEAD (8b50591). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (3350319) HEAD (8b50591)
unittests 2 1
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3780      +/-   ##
==========================================
- Coverage   54.49%   47.74%   -6.75%     
==========================================
  Files         134      235     +101     
  Lines       12329    19852    +7523     
==========================================
+ Hits         6719     9479    +2760     
- Misses       5116     9484    +4368     
- Partials      494      889     +395     
Flag Coverage Δ
unittests 47.74% <ø> (-6.75%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@JaydipGabani JaydipGabani requested a review from a team January 22, 2025 23:28
@l0wl3vel l0wl3vel force-pushed the fix/webhook-availability branch from 3f4870c to 8b50591 Compare January 24, 2025 15:27
@l0wl3vel
Copy link
Author

@JaydipGabani Could you please rerun the pipelines and merge this? I missed the window where I could have merged without rebase.

@JaydipGabani
Copy link
Contributor

@l0wl3vel we want approval from one more maintainer to merge.

cc: @ritazh @maxsmythe @sozercan PTAL.

Benjamin Ritter and others added 3 commits January 25, 2025 08:28
Signed-off-by: Benjamin Ritter <[email protected]>
Co-authored-by: Jaydip Gabani <[email protected]>
Signed-off-by: Benjamin Ritter <[email protected]>
@l0wl3vel l0wl3vel force-pushed the fix/webhook-availability branch from 8b50591 to 5e8f3c4 Compare January 25, 2025 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Webhook requests fail on gatekeeper pod startup/shutdown
3 participants