Commit 04899a2
🌱 chore(deps): upgrade k8s to 1.35 and Go dependencies (edge) (#2486)
* chore(deps): upgrade k8s to 1.35 and Go dependencies (edge)
Assisted-by: Cursor/Claude
* fix breaking type-safe webhook API introduced by controller-runtime v0.23.0
controller-runtime v0.23.0 introduced type-safe webhook builders using generics.
Webhook methods now receive typed objects directly instead of runtime.Object,
eliminating the need for type assertions and providing compile-time type safety.
Changes:
- Update ClusterCatalog webhook Default method to use *ocv1.ClusterCatalog
- Update SetupWebhookWithManager to pass type to NewWebhookManagedBy
- Simplify tests to leverage type safety (no type assertion tests needed)
Assisted-by: Cursor/Claude
* fix breaking ENVTEST teardown introduced by controller-runtime v0.23.0
controller-runtime v0.23.0 changed test environment teardown timing behavior.
Direct calls to testEnv.Stop() can fail intermittently due to graceful shutdown timing,
requiring retry logic to ensure proper cleanup.
Changes:
- Add StopWithRetry helper function to test/utils.go with retry logic
- Wrap testEnv.Stop() calls with retry helper (1-minute timeout, 1-second interval)
- Add error logging for each retry attempt to aid debugging
- Update api/v1/suite_test.go to use test.StopWithRetry
- Update internal/operator-controller/controllers/suite_test.go to use test.StopWithRetry
This shared utility follows DRY principle and ensures consistent teardown behavior
across all test suites, preventing flaky test failures during teardown.
Assisted-by: Cursor/Claude
Co-authored-by: Cursor <cursoragent@cursor.com>
# Conflicts:
# api/v1/suite_test.go
# internal/operator-controller/controllers/suite_test.go
* fix breaking StatusWriter interface introduced by controller-runtime v0.23.0
controller-runtime v0.23.0 added Apply method to the StatusWriter interface
for server-side apply support on status subresources.
Changes:
- Add Apply method to statusWriterMock to satisfy StatusWriter interface
- Method signature: Apply(context.Context, runtime.ApplyConfiguration, ...SubResourceApplyOption)
Assisted-by: Cursor/Claude
* fix: document server-side apply requirement with nolint for client.Apply
The client.Apply patch type constant is deprecated in controller-runtime v0.23.0+
in favor of typed Apply methods that require generated apply configurations.
However, server-side apply with field ownership management is essential for this
controller to properly manage ClusterExtensionRevision lifecycle. The deprecated
client.Apply provides:
- Field ownership via client.FieldOwner()
- Force ownership via client.ForceOwnership
- Automatic create-or-update semantics
Alternative approaches (MergeFrom, StrategicMerge) lack field management support,
causing upgrade test failures where ownership conflicts prevent proper updates during
controller upgrades.
Changes:
- Keep client.Apply usage with comprehensive nolint explanation
- Document why server-side apply semantics are required
- Note migration path: generate apply configurations project-wide
This ensures controllers work correctly during upgrades while documenting the
technical debt for future migration.
Assisted-by: Cursor/Claude
* fix: replace deprecated NewSimpleClientset with NewClientset
The fake.NewSimpleClientset is deprecated in client-go in favor of
fake.NewClientset which provides better support for field management
and server-side apply testing.
The migration is straightforward for tests that don't require apply
configurations - simply replace NewSimpleClientset() with NewClientset().
The new implementation works seamlessly with existing reactor-based mocking.
Changes:
- Replace fake.NewSimpleClientset() with fake.NewClientset()
- Remove nolint suppression comment
- All tests pass without modifications
Assisted-by: Cursor/Claude
* fix: improve StatusWriter.Apply mock robustness in boxcutter tests
Address code review feedback by making the Apply method implementation
more defensive:
- Add applyCalled tracking field to statusWriterMock
- Return error if Apply is unexpectedly called during tests
- This ensures tests fail immediately if the code starts using Apply,
rather than silently passing with incorrect assumptions
The error message clearly indicates this method is not expected to be
used, making debugging easier if the interface usage changes in the future.
Assisted-by: Cursor/Claude
* fix: improve upgrade e2e test robustness for controller-runtime v0.23.1
Controller-runtime v0.23.1+ has faster leader election startup, causing timing
issues with the upgrade e2e tests that watch pod logs for leader election messages.
The log watching approach fails because it uses Follow=true which only streams NEW
logs, missing messages emitted before the test starts watching. With faster startup
in v0.23.1+, leader election often completes before the test begins watching.
Changes:
- Replace log watching with direct lease object checking for leader election
- Poll lease.Spec.HolderIdentity to confirm leader election occurred
- Refactor watchPodLogsForSubstring to use polling with TailLines instead of Follow
- Add per-poll context timeout (5s) to prevent hanging on slow log streams
- Add scanner error checking to detect and handle stream errors
- Fix context cancellation timing - pollCancel() called after stream operations complete
- Add k8s.io/utils/ptr import for log options
This approach is timing-independent and directly verifies the desired state
rather than relying on log message observation. The per-poll timeout prevents
tests from hanging indefinitely while still respecting the outer context timeout.
Fixes address Copilot review comments about context management and error handling.
Assisted-by: Cursor/Claude
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: restore CEL validation error message format test updates for Kubernetes v1.35
Kubernetes v1.35 changed CEL validation error message format to include
the actual validated value instead of just the type ("string" or "object").
This provides more helpful error messages for debugging validation failures.
This commit was accidentally dropped during interactive rebase.
Changes:
- Update test expectations to include actual values in error messages
- Change from 'Invalid value: "string"' to 'Invalid value: "actual-value"'
- Update 20+ test cases in TestImageSourceCELValidationRules and related tests
- Fix indentation consistency across all test cases
Assisted-by: Cursor/Claude
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: address StopWithRetry false negative issue
Address code review feedback from @perdasilva: the "final attempt" after
timeout creates a confusing false negative. If the final attempt succeeds
after we've logged "timeout reached", we return success despite logging
a timeout message.
Changes:
- Remove final attempt after timeout
- Return error immediately when timeout is reached
- Clearer error message with timeout duration
- Prevents false negatives where timeout is logged but success is returned
This makes the function behavior match its log messages - if we say we
timed out, we actually return an error.
Assisted-by: Cursor/Claude
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 8927559 commit 04899a2
12 files changed
Lines changed: 459 additions & 405 deletions
File tree
- api/v1
- internal
- catalogd/webhook
- operator-controller
- applier
- authentication
- controllers
- test
- upgrade-e2e
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
| 190 | + | |
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
| 198 | + | |
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
| 206 | + | |
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
| 222 | + | |
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
231 | | - | |
| 230 | + | |
| 231 | + | |
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
| 239 | + | |
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
| 274 | + | |
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
| 282 | + | |
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | | - | |
| 312 | + | |
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
354 | | - | |
| 354 | + | |
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
60 | 64 | | |
61 | 65 | | |
0 commit comments