fix(controller): use TLS for upgrade hooks - #886
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @RedZapdos123! It looks like this is your first PR to openkruise/agents 🎉 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #886 +/- ##
==========================================
- Coverage 82.48% 82.39% -0.09%
==========================================
Files 248 254 +6
Lines 20416 21465 +1049
==========================================
+ Hits 16840 17686 +846
- Misses 2927 3080 +153
- Partials 649 699 +50
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Thread runtime TLS through lifecycle hook execution so TLS-stamped sandboxes do not fall back to plaintext runtime routing during upgrade. Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
7845b92 to
be2f81f
Compare
The variable was left over from an abandoned test seam and is never referenced; the unused linter rejects it. Lifecycle hooks call agentsruntime.RunCommandWithRuntime directly. Signed-off-by: 守辰 <shouchen.zz@alibaba-inc.com>
…diness ExecuteLifecycleHook has no production callers left after the TLS bundle threading, so drop the exported wrapper and drive all call sites (including tests) through NewLifecycleHookFunc(nil). Add a symmetric readiness gate for the TLS transport: when transport options resolve, the hook now fails fast with a Pod-IP readiness error instead of surfacing the misleading plaintext 'runtime url not found' message from the runtime client. Signed-off-by: 守辰 <shouchen.zz@alibaba-inc.com>
Description:
Thread runtime TLS through upgrade lifecycle hook execution.
Before this change, lifecycle hooks called
RunCommandWithRuntimewithout the transport resolved byruntime.TransportOptionsFor, and they still gated execution on plaintextGetRuntimeURL. As a result, a sandbox advertising the runtime TLS capability could not execute upgrade hooks over the TLS path and failed before the TLS transport had a chance to resolve.This PR keeps the legacy plaintext behavior for non-TLS sandboxes, but binds the controller's existing
RuntimeTLSBundleinto lifecycle hook execution and adds regression tests for the missing-bundle and configured-bundle paths.Validation Tests run:
go test ./pkg/controller/sandbox/core -run 'TestExecuteLifecycleHook|TestNewLifecycleHookFunc_UsesRuntimeTLSBundle' -count=1go test ./pkg/controller/sandbox/core -count=1go test ./pkg/controller/sandbox/... -count=1Notes: