Skip to content

Commit cc46694

Browse files
Per G. da Silvaclaude
andcommitted
🌱 Upgrade boxcutter to v0.14.0 and adapt sibling owners API
Adapt the ClusterObjectSet controller to boxcutter v0.14.0's API: - WithPreviousOwners is replaced by WithSiblingOwners, which takes all active sibling revisions (both lower and higher) so boxcutter can distinguish siblings from true collisions during handover. - NewObjectEngine now requires a managedBy parameter. Changes: - listSiblingRevisions: returns all active revisions for the same ClusterExtension, excluding self, archived, and deleting revisions. - listPreviousRevisions: returns only lower-revision active siblings, used for archiving after rollout completes. - listOtherActiveRevisions: shared helper with predicate-based filtering used by both methods above. - buildBoxcutterPhases: uses WithSiblingOwners instead of WithPreviousOwners. - NewObjectEngine: passes FieldOwnerPrefix as the new managedBy param. - Unit tests: separate table-driven tests for listSiblingRevisions and listPreviousRevisions with shared callRevisionLister helper. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7d6a00d commit cc46694

10,147 files changed

Lines changed: 2774600 additions & 95 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

go.mod

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ require (
4747
k8s.io/klog/v2 v2.140.0
4848
k8s.io/kubernetes v1.36.1
4949
k8s.io/utils v0.0.0-20260319190234-28399d86e0b5
50-
pkg.package-operator.run/boxcutter v0.13.1
50+
pkg.package-operator.run/boxcutter v0.14.0
5151
sigs.k8s.io/controller-runtime v0.24.1
5252
sigs.k8s.io/controller-tools v0.21.0
5353
sigs.k8s.io/crdify v0.6.1-0.20260602124154-bb9957dbf465
@@ -57,11 +57,11 @@ require (
5757

5858
require (
5959
k8s.io/component-helpers v0.36.1 // indirect
60-
k8s.io/kube-openapi v0.0.0-20260427204847-8949caaa1199 // indirect
60+
k8s.io/kube-openapi v0.0.0-20260520065146-aa012df4f4af // indirect
6161
)
6262

6363
require (
64-
cel.dev/expr v0.25.1 // indirect
64+
cel.dev/expr v0.25.2 // indirect
6565
dario.cat/mergo v1.0.2 // indirect
6666
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 // indirect
6767
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
@@ -107,7 +107,7 @@ require (
107107
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect
108108
github.com/fatih/color v1.19.0 // indirect
109109
github.com/felixge/httpsnoop v1.0.4 // indirect
110-
github.com/fxamacker/cbor/v2 v2.9.1 // indirect
110+
github.com/fxamacker/cbor/v2 v2.9.2 // indirect
111111
github.com/go-errors/errors v1.5.1 // indirect
112112
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
113113
github.com/go-git/go-billy/v5 v5.9.0 // indirect
@@ -116,7 +116,7 @@ require (
116116
github.com/go-jose/go-jose/v4 v4.1.4 // indirect
117117
github.com/go-logr/stdr v1.2.2 // indirect
118118
github.com/go-openapi/jsonpointer v0.23.1 // indirect
119-
github.com/go-openapi/jsonreference v0.21.5 // indirect
119+
github.com/go-openapi/jsonreference v0.21.6 // indirect
120120
github.com/go-openapi/swag v0.26.0 // indirect
121121
github.com/go-openapi/swag/cmdutils v0.26.0 // indirect
122122
github.com/go-openapi/swag/conv v0.26.0 // indirect
@@ -163,7 +163,7 @@ require (
163163
github.com/lib/pq v1.11.2 // indirect
164164
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
165165
github.com/mattn/go-colorable v0.1.14 // indirect
166-
github.com/mattn/go-isatty v0.0.20 // indirect
166+
github.com/mattn/go-isatty v0.0.22 // indirect
167167
github.com/mattn/go-runewidth v0.0.23 // indirect
168168
github.com/mattn/go-sqlite3 v1.14.45 // indirect
169169
github.com/miekg/pkcs11 v1.1.2 // indirect
@@ -215,12 +215,12 @@ require (
215215
go.opencensus.io v0.24.0 // indirect
216216
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
217217
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.68.0 // indirect
218-
go.opentelemetry.io/otel v1.43.0 // indirect
218+
go.opentelemetry.io/otel v1.44.0 // indirect
219219
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.43.0 // indirect
220220
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.43.0 // indirect
221-
go.opentelemetry.io/otel/metric v1.43.0 // indirect
221+
go.opentelemetry.io/otel/metric v1.44.0 // indirect
222222
go.opentelemetry.io/otel/sdk v1.43.0 // indirect
223-
go.opentelemetry.io/otel/trace v1.43.0 // indirect
223+
go.opentelemetry.io/otel/trace v1.44.0 // indirect
224224
go.opentelemetry.io/proto/otlp v1.10.0 // indirect
225225
go.podman.io/common v0.68.0 // indirect
226226
go.podman.io/storage v1.63.0 // indirect

go.sum

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
cel.dev/expr v0.25.1 h1:1KrZg61W6TWSxuNZ37Xy49ps13NUovb66QLprthtwi4=
2-
cel.dev/expr v0.25.1/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4=
1+
cel.dev/expr v0.25.2 h1:K6j46C81hXtZQfuX60cVWQFBJahKSE2gfRbNuvr5bFs=
2+
cel.dev/expr v0.25.2/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4=
33
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
44
dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8=
55
dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA=
@@ -149,8 +149,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z
149149
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
150150
github.com/fsnotify/fsnotify v1.10.1 h1:b0/UzAf9yR5rhf3RPm9gf3ehBPpf0oZKIjtpKrx59Ho=
151151
github.com/fsnotify/fsnotify v1.10.1/go.mod h1:TLheqan6HD6GBK6PrDWyDPBaEV8LspOxvPSjC+bVfgo=
152-
github.com/fxamacker/cbor/v2 v2.9.1 h1:2rWm8B193Ll4VdjsJY28jxs70IdDsHRWgQYAI80+rMQ=
153-
github.com/fxamacker/cbor/v2 v2.9.1/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
152+
github.com/fxamacker/cbor/v2 v2.9.2 h1:X4Ksno9+x3cz0TZv69ec1hxP/+tymuR8PXQJyDwfh78=
153+
github.com/fxamacker/cbor/v2 v2.9.2/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
154154
github.com/go-errors/errors v1.5.1 h1:ZwEMSLRCapFLflTpT7NKaAc7ukJ8ZPEjzlxt8rPN8bk=
155155
github.com/go-errors/errors v1.5.1/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
156156
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
@@ -172,8 +172,8 @@ github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ=
172172
github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg=
173173
github.com/go-openapi/jsonpointer v0.23.1 h1:1HBACs7XIwR2RcmItfdSFlALhGbe6S92p0ry4d1GWg4=
174174
github.com/go-openapi/jsonpointer v0.23.1/go.mod h1:iWRmZTrGn7XwYhtPt/fvdSFj1OfNBngqRT2UG3BxSqY=
175-
github.com/go-openapi/jsonreference v0.21.5 h1:6uCGVXU/aNF13AQNggxfysJ+5ZcU4nEAe+pJyVWRdiE=
176-
github.com/go-openapi/jsonreference v0.21.5/go.mod h1:u25Bw85sX4E2jzFodh1FOKMTZLcfifd1Q+iKKOUxExw=
175+
github.com/go-openapi/jsonreference v0.21.6 h1:NZ5nGfnaM1n4I43Xjm1e5/M2GjOwQwndQz22uhxwD+Y=
176+
github.com/go-openapi/jsonreference v0.21.6/go.mod h1:xzbgtQ3ZbWxvET3AxdzCJlJt6vkovbf+IfSPJjD0tUY=
177177
github.com/go-openapi/swag v0.26.0 h1:GVDXCmfvhfu1BxiHo8/FA+BbKmhecHnG3varjON5/RI=
178178
github.com/go-openapi/swag v0.26.0/go.mod h1:82g3193sZJRbocs7bNCqGfIgq8pkuwVwCfhKIRlEQF0=
179179
github.com/go-openapi/swag/cmdutils v0.26.0 h1:iowihOcvq7y4egO8cOq0dmfohz6wfeQ63U1EnuhO2TU=
@@ -202,8 +202,8 @@ github.com/go-openapi/swag/yamlutils v0.26.0 h1:H7O8l/8NJJQ/oiReEN+oMpnGMyt8G0hl
202202
github.com/go-openapi/swag/yamlutils v0.26.0/go.mod h1:1evKEGAtP37Pkwcc7EWMF0hedX0/x3Rkvei2wtG/TbU=
203203
github.com/go-openapi/testify/enable/yaml/v2 v2.4.2 h1:5zRca5jw7lzVREKCZVNBpysDNBjj74rBh0N2BGQbSR0=
204204
github.com/go-openapi/testify/enable/yaml/v2 v2.4.2/go.mod h1:XVevPw5hUXuV+5AkI1u1PeAm27EQVrhXTTCPAF85LmE=
205-
github.com/go-openapi/testify/v2 v2.4.2 h1:tiByHpvE9uHrrKjOszax7ZvKB7QOgizBWGBLuq0ePx4=
206-
github.com/go-openapi/testify/v2 v2.4.2/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw=
205+
github.com/go-openapi/testify/v2 v2.5.1 h1:TMdhCaw8fUNraVSf3Omoob1dO/AzBfhtFAPW0an6sBo=
206+
github.com/go-openapi/testify/v2 v2.5.1/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw=
207207
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
208208
github.com/go-sql-driver/mysql v1.9.2 h1:4cNKDYQ1I84SXslGddlsrMhc8k4LeDVj6Ad6WRjiHuU=
209209
github.com/go-sql-driver/mysql v1.9.2/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU=
@@ -351,8 +351,8 @@ github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhn
351351
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE=
352352
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
353353
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
354-
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
355-
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
354+
github.com/mattn/go-isatty v0.0.22 h1:j8l17JJ9i6VGPUFUYoTUKPSgKe/83EYU2zBC7YNKMw4=
355+
github.com/mattn/go-isatty v0.0.22/go.mod h1:ZXfXG4SQHsB/w3ZeOYbR0PrPwLy+n6xiMrJlRFqopa4=
356356
github.com/mattn/go-runewidth v0.0.23 h1:7ykA0T0jkPpzSvMS5i9uoNn2Xy3R383f9HDx3RybWcw=
357357
github.com/mattn/go-runewidth v0.0.23/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs=
358358
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
@@ -538,8 +538,8 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.6
538538
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.65.0/go.mod h1:KDgtbWKTQs4bM+VPUr6WlL9m/WXcmkCcBlIzqxPGzmI=
539539
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.68.0 h1:CqXxU8VOmDefoh0+ztfGaymYbhdB/tT3zs79QaZTNGY=
540540
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.68.0/go.mod h1:BuhAPThV8PBHBvg8ZzZ/Ok3idOdhWIodywz2xEcRbJo=
541-
go.opentelemetry.io/otel v1.43.0 h1:mYIM03dnh5zfN7HautFE4ieIig9amkNANT+xcVxAj9I=
542-
go.opentelemetry.io/otel v1.43.0/go.mod h1:JuG+u74mvjvcm8vj8pI5XiHy1zDeoCS2LB1spIq7Ay0=
541+
go.opentelemetry.io/otel v1.44.0 h1:JjwHmHpA4iZ3wBxluu2fbbE7j4kqlE8jXyAyPXH7HqU=
542+
go.opentelemetry.io/otel v1.44.0/go.mod h1:BMgjTHL9WPRlRjL2oZCBTL4whCGtXch2H4BhOPIAyYc=
543543
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.19.0 h1:Dn8rkudDzY6KV9dr/D/bTUuWgqDf9xe0rr4G2elrn0Y=
544544
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.19.0/go.mod h1:gMk9F0xDgyN9M/3Ed5Y1wKcx/9mlU91NXY2SNq7RQuU=
545545
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.19.0 h1:HIBTQ3VO5aupLKjC90JgMqpezVXwFuq6Ryjn0/izoag=
@@ -564,16 +564,16 @@ go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.43.0 h1:mS47AX77OtFfKG4
564564
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.43.0/go.mod h1:PJnsC41lAGncJlPUniSwM81gc80GkgWJWr3cu2nKEtU=
565565
go.opentelemetry.io/otel/log v0.19.0 h1:KUZs/GOsw79TBBMfDWsXS+KZ4g2Ckzksd1ymzsIEbo4=
566566
go.opentelemetry.io/otel/log v0.19.0/go.mod h1:5DQYeGmxVIr4n0/BcJvF4upsraHjg6vudJJpnkL6Ipk=
567-
go.opentelemetry.io/otel/metric v1.43.0 h1:d7638QeInOnuwOONPp4JAOGfbCEpYb+K6DVWvdxGzgM=
568-
go.opentelemetry.io/otel/metric v1.43.0/go.mod h1:RDnPtIxvqlgO8GRW18W6Z/4P462ldprJtfxHxyKd2PY=
567+
go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc=
568+
go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo=
569569
go.opentelemetry.io/otel/sdk v1.43.0 h1:pi5mE86i5rTeLXqoF/hhiBtUNcrAGHLKQdhg4h4V9Dg=
570570
go.opentelemetry.io/otel/sdk v1.43.0/go.mod h1:P+IkVU3iWukmiit/Yf9AWvpyRDlUeBaRg6Y+C58QHzg=
571571
go.opentelemetry.io/otel/sdk/log v0.19.0 h1:scYVLqT22D2gqXItnWiocLUKGH9yvkkeql5dBDiXyko=
572572
go.opentelemetry.io/otel/sdk/log v0.19.0/go.mod h1:vFBowwXGLlW9AvpuF7bMgnNI95LiW10szrOdvzBHlAg=
573573
go.opentelemetry.io/otel/sdk/metric v1.43.0 h1:S88dyqXjJkuBNLeMcVPRFXpRw2fuwdvfCGLEo89fDkw=
574574
go.opentelemetry.io/otel/sdk/metric v1.43.0/go.mod h1:C/RJtwSEJ5hzTiUz5pXF1kILHStzb9zFlIEe85bhj6A=
575-
go.opentelemetry.io/otel/trace v1.43.0 h1:BkNrHpup+4k4w+ZZ86CZoHHEkohws8AY+WTX09nk+3A=
576-
go.opentelemetry.io/otel/trace v1.43.0/go.mod h1:/QJhyVBUUswCphDVxq+8mld+AvhXZLhe+8WVFxiFff0=
575+
go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk=
576+
go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE=
577577
go.opentelemetry.io/proto/otlp v1.10.0 h1:IQRWgT5srOCYfiWnpqUYz9CVmbO8bFmKcwYxpuCSL2g=
578578
go.opentelemetry.io/proto/otlp v1.10.0/go.mod h1:/CV4QoCR/S9yaPj8utp3lvQPoqMtxXdzn7ozvvozVqk=
579579
go.podman.io/common v0.68.0 h1:6V8nZS33vLTPC047RfSGxARgS/Ui6CQtgdZXLo18qAc=
@@ -588,8 +588,8 @@ go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y=
588588
go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU=
589589
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
590590
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
591-
go.uber.org/zap v1.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc=
592-
go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
591+
go.uber.org/zap v1.28.0 h1:IZzaP1Fv73/T/pBMLk4VutPl36uNC+OSUh3JLG3FIjo=
592+
go.uber.org/zap v1.28.0/go.mod h1:rDLpOi171uODNm/mxFcuYWxDsqWSAVkFdX4XojSKg/Q=
593593
go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ=
594594
go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ=
595595
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
@@ -664,7 +664,6 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
664664
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
665665
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
666666
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
667-
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
668667
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
669668
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
670669
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
@@ -793,8 +792,8 @@ k8s.io/controller-manager v0.36.1 h1:d1ifPnAe3FFSnnvcDQiM93bGroFT1lF72GEBKsl+cbg
793792
k8s.io/controller-manager v0.36.1/go.mod h1:jeJUuFlgbgohGJWrm59Wdlgo3WqxssWXgD2sU6HG/Vo=
794793
k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc=
795794
k8s.io/klog/v2 v2.140.0/go.mod h1:o+/RWfJ6PwpnFn7OyAG3QnO47BFsymfEfrz6XyYSSp0=
796-
k8s.io/kube-openapi v0.0.0-20260427204847-8949caaa1199 h1:sWu4Td5mgJlwunsUydnhKEAfNUHM7hm1wfKEQmD7G5c=
797-
k8s.io/kube-openapi v0.0.0-20260427204847-8949caaa1199/go.mod h1:uGBT7iTA6c6MvqUvSXIaYZo9ukscABYi2btjhvgKGZ0=
795+
k8s.io/kube-openapi v0.0.0-20260520065146-aa012df4f4af h1:zLXA2Irn14q2/06WMkxViyr7YCPUO2lJ0QYE9Juy5vA=
796+
k8s.io/kube-openapi v0.0.0-20260520065146-aa012df4f4af/go.mod h1:V/QaCUYDa+0QpcHhVVc5l99Uz56wEMEXBSj9oCDkNDY=
798797
k8s.io/kubectl v0.36.1 h1:96HqS9twIdHM0MlJLTwbo14b9kUKPkOzZ4tlRDLv4qI=
799798
k8s.io/kubectl v0.36.1/go.mod h1:/DGPAIewKsFWF9VFgGvkPhao2Ev4SNuE3BioZo8yPbk=
800799
k8s.io/kubernetes v1.36.1 h1:Mt7NKigaZ2KmOmCLhX81lGlH9JU5wjXnYhXnxAun9XA=
@@ -805,8 +804,8 @@ k8s.io/utils v0.0.0-20260319190234-28399d86e0b5 h1:kBawHLSnx/mYHmRnNUf9d4CpjREbe
805804
k8s.io/utils v0.0.0-20260319190234-28399d86e0b5/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk=
806805
oras.land/oras-go/v2 v2.6.1 h1:bonOEkjLfp8tt6qXWRRWP6p1F+9octchOf2EqnWB4Zs=
807806
oras.land/oras-go/v2 v2.6.1/go.mod h1:dhtFrFOuZuDtAVeZ9FUnaa5zfzplG3ZnFX9/uH1J/Yk=
808-
pkg.package-operator.run/boxcutter v0.13.1 h1:FvrSBnHWuf6Co+HPyxRSw2Y5mHSkUtteW8klXS6L8gk=
809-
pkg.package-operator.run/boxcutter v0.13.1/go.mod h1:rR2jd32uNt2eml7UvlYNCpCAYIpTALDzHxaftMfgkZo=
807+
pkg.package-operator.run/boxcutter v0.14.0 h1:6aUYMtj/gfyHkro/uIAYA9iRmkRweeqOVKRrf+j4dZU=
808+
pkg.package-operator.run/boxcutter v0.14.0/go.mod h1:9FXDqdX+TzIf6clHoKeNfSR7pD1QgWfXhQX7uNJ6iO8=
810809
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.34.0 h1:hSfpvjjTQXQY2Fol2CS0QHMNs/WI1MOSGzCm1KhM5ec=
811810
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.34.0/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw=
812811
sigs.k8s.io/controller-runtime v0.24.1 h1:miPEwrmirImAvgME1L9qebGHrOnGJoVmVdtOU9fRfo4=

internal/operator-controller/controllers/clusterobjectset_controller.go

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -417,12 +417,27 @@ func (c *ClusterObjectSetReconciler) removeFinalizer(ctx context.Context, obj cl
417417
return nil
418418
}
419419

420+
// listSiblingRevisions returns all active revisions belonging to the same ClusterExtension, excluding the current one.
421+
// This includes both lower and higher revision numbers, enabling boxcutter to properly classify
422+
// sibling owners and avoid reporting false collisions during revision handover.
423+
func (c *ClusterObjectSetReconciler) listSiblingRevisions(ctx context.Context, cos *ocv1.ClusterObjectSet) ([]*ocv1.ClusterObjectSet, error) {
424+
return c.listOtherActiveRevisions(ctx, cos, func(*ocv1.ClusterObjectSet) bool { return true })
425+
}
426+
420427
// listPreviousRevisions returns active revisions belonging to the same ClusterExtension with lower revision numbers.
421-
// Filters out the current revision, archived revisions, deleting revisions, and revisions with equal or higher numbers.
422428
func (c *ClusterObjectSetReconciler) listPreviousRevisions(ctx context.Context, cos *ocv1.ClusterObjectSet) ([]*ocv1.ClusterObjectSet, error) {
429+
return c.listOtherActiveRevisions(ctx, cos, func(r *ocv1.ClusterObjectSet) bool {
430+
return r.Spec.Revision < cos.Spec.Revision
431+
})
432+
}
433+
434+
func (c *ClusterObjectSetReconciler) listOtherActiveRevisions(
435+
ctx context.Context,
436+
cos *ocv1.ClusterObjectSet,
437+
predicate func(*ocv1.ClusterObjectSet) bool,
438+
) ([]*ocv1.ClusterObjectSet, error) {
423439
ownerLabel, ok := cos.Labels[labels.OwnerNameKey]
424440
if !ok {
425-
// No owner label means this revision isn't properly labeled - return empty list
426441
return nil, nil
427442
}
428443

@@ -433,37 +448,34 @@ func (c *ClusterObjectSetReconciler) listPreviousRevisions(ctx context.Context,
433448
return nil, fmt.Errorf("listing revisions: %w", err)
434449
}
435450

436-
previous := make([]*ocv1.ClusterObjectSet, 0, len(revList.Items))
451+
result := make([]*ocv1.ClusterObjectSet, 0, len(revList.Items))
437452
for i := range revList.Items {
438453
r := &revList.Items[i]
439454
if r.Name == cos.Name {
440455
continue
441456
}
442-
// Skip archived or deleting revisions
443457
if r.Spec.LifecycleState == ocv1.ClusterObjectSetLifecycleStateArchived ||
444458
!r.DeletionTimestamp.IsZero() {
445459
continue
446460
}
447-
// Only include revisions with lower revision numbers (actual previous revisions)
448-
if r.Spec.Revision >= cos.Spec.Revision {
461+
if !predicate(r) {
449462
continue
450463
}
451-
previous = append(previous, r)
464+
result = append(result, r)
452465
}
453466

454-
return previous, nil
467+
return result, nil
455468
}
456469

457470
func (c *ClusterObjectSetReconciler) buildBoxcutterPhases(ctx context.Context, cos *ocv1.ClusterObjectSet) ([]boxcutter.Phase, []ocv1.ObservedPhase, []boxcutter.RevisionReconcileOption, error) {
458-
previous, err := c.listPreviousRevisions(ctx, cos)
471+
siblings, err := c.listSiblingRevisions(ctx, cos)
459472
if err != nil {
460-
return nil, nil, nil, fmt.Errorf("listing previous revisions: %w", err)
473+
return nil, nil, nil, fmt.Errorf("listing sibling revisions: %w", err)
461474
}
462475

463-
// Convert to []client.Object for boxcutter
464-
previousObjs := make([]client.Object, len(previous))
465-
for i, rev := range previous {
466-
previousObjs[i] = rev
476+
siblingObjs := make([]client.Object, len(siblings))
477+
for i, rev := range siblings {
478+
siblingObjs[i] = rev
467479
}
468480

469481
progressionProbes, err := buildProgressionProbes(cos.Spec.ProgressionProbes)
@@ -472,7 +484,7 @@ func (c *ClusterObjectSetReconciler) buildBoxcutterPhases(ctx context.Context, c
472484
}
473485

474486
opts := []boxcutter.RevisionReconcileOption{
475-
boxcutter.WithPreviousOwners(previousObjs),
487+
boxcutter.WithSiblingOwners(siblingObjs),
476488
boxcutter.WithProbe(boxcutter.ProgressProbeType, progressionProbes),
477489
boxcutter.WithAggregatePhaseReconcileErrors(),
478490
}

0 commit comments

Comments
 (0)