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 4 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
Benjamin Ritter and others added 3 commits January 22, 2025 14:44
Signed-off-by: Benjamin Ritter <benjamin.ritter@stackit.cloud>
Signed-off-by: Benjamin Ritter <benjamin.ritter@stackit.cloud>
Co-authored-by: Jaydip Gabani <gabanijaydip@gmail.com>
Signed-off-by: Benjamin Ritter <7373184+l0wl3vel@users.noreply.github.com>
@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 Report

All modified and coverable lines are covered by tests ✅

Project coverage is 47.72%. Comparing base (3350319) to head (262f5c4).
Report is 237 commits behind head on master.

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

HEAD has 1 upload less than BASE
Flag BASE (3350319) HEAD (262f5c4)
unittests 2 1
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3780      +/-   ##
==========================================
- Coverage   54.49%   47.72%   -6.77%     
==========================================
  Files         134      236     +102     
  Lines       12329    19929    +7600     
==========================================
+ Hits         6719     9512    +2793     
- Misses       5116     9525    +4409     
- Partials      494      892     +398     
Flag Coverage Δ
unittests 47.72% <ø> (-6.77%) ⬇️

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
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