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: get Admin API services dynamically in admission webhook #3601

Merged
merged 1 commit into from
Feb 24, 2023

Conversation

czeslavo
Copy link
Contributor

@czeslavo czeslavo commented Feb 24, 2023

What this PR does / why we need it:

Use the AdminAPIClientsManager to always get the latest list of clients in the admission webhook
to avoid calling outdated services that were set statically during the setup.

Also includes a quick-fix for nil dereference in konnect.NodeAPIClient.

E2E run: https://github.com/Kong/kubernetes-ingress-controller/actions/runs/4264473116/jobs/7422655686

Which issue this PR fixes:

Fixes #3600.

PR Readiness Checklist:

Complete these before marking the PR as ready to review:

  • the CHANGELOG.md release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR

@czeslavo czeslavo self-assigned this Feb 24, 2023
@czeslavo czeslavo added the bug Something isn't working label Feb 24, 2023
@czeslavo czeslavo force-pushed the dynamic-services-in-admission branch from 72f07cb to 27f3b74 Compare February 24, 2023 15:17
@codecov
Copy link

codecov bot commented Feb 24, 2023

Codecov Report

Base: 72.5% // Head: 72.7% // Increases project coverage by +0.1% 🎉

Coverage data is based on head (2591f78) compared to base (35c6f41).
Patch coverage: 87.3% of modified lines in pull request are covered.

❗ Current head 2591f78 differs from pull request most recent head 9dd73bd. Consider uploading reports for the commit 9dd73bd to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #3601     +/-   ##
=======================================
+ Coverage   72.5%   72.7%   +0.1%     
=======================================
  Files        130     131      +1     
  Lines      15645   15675     +30     
=======================================
+ Hits       11349   11398     +49     
+ Misses      3539    3526     -13     
+ Partials     757     751      -6     
Impacted Files Coverage Δ
internal/manager/run.go 37.9% <20.0%> (ø)
internal/admission/validator.go 75.3% <88.5%> (+2.9%) ⬆️
internal/admission/adminapi_provider.go 100.0% <100.0%> (ø)
internal/konnect/client.go 38.4% <100.0%> (ø)
internal/manager/setup.go 42.0% <100.0%> (+<0.1%) ⬆️
internal/dataplane/parser/parser.go 88.5% <0.0%> (-0.7%) ⬇️
internal/dataplane/kongstate/service.go 67.3% <0.0%> (+1.2%) ⬆️
...nternal/controllers/gateway/tcproute_controller.go 72.0% <0.0%> (+2.0%) ⬆️
...ternal/controllers/gateway/grpcroute_controller.go 69.7% <0.0%> (+2.0%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@czeslavo czeslavo force-pushed the dynamic-services-in-admission branch from 27f3b74 to 2591f78 Compare February 24, 2023 16:27
@czeslavo czeslavo added this to the KIC v2.9.0 milestone Feb 24, 2023
@czeslavo czeslavo force-pushed the dynamic-services-in-admission branch from 2591f78 to 2d2e09e Compare February 24, 2023 17:14
@czeslavo czeslavo marked this pull request as ready for review February 24, 2023 17:14
@czeslavo czeslavo requested a review from a team as a code owner February 24, 2023 17:14
@czeslavo czeslavo force-pushed the dynamic-services-in-admission branch from 2d2e09e to 9dd73bd Compare February 24, 2023 17:16
Copy link
Contributor

@rainest rainest left a comment

Choose a reason for hiding this comment

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

Good comments on the remaining weirdness. LGTM barring any unexpected failures in integration.

@rainest rainest enabled auto-merge (squash) February 24, 2023 17:45
@rainest rainest merged commit 7e5b8f9 into main Feb 24, 2023
@rainest rainest deleted the dynamic-services-in-admission branch February 24, 2023 17:47
@pmalek pmalek added the fix label Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix size/L
Projects
None yet
3 participants