Skip to content

Commit 7f24dfb

Browse files
Merge pull request #380 from openshift-bot/synchronize-upstream
NO-ISSUE: Synchronize From Upstream Repositories
2 parents a565ae3 + ffced32 commit 7f24dfb

File tree

32 files changed

+417
-206
lines changed

32 files changed

+417
-206
lines changed

commitchecker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
expectedMergeBase: 44de6f2e03c2f02845c9d7362ade607a0b0c501d
1+
expectedMergeBase: b152c7b294de6ebe3ea0ef2daf575d1f540014da
22
upstreamBranch: main
33
upstreamOrg: operator-framework
44
upstreamRepo: operator-controller

go.mod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/BurntSushi/toml v1.5.0
77
github.com/Masterminds/semver/v3 v3.3.1
88
github.com/blang/semver/v4 v4.0.0
9-
github.com/cert-manager/cert-manager v1.17.1
9+
github.com/cert-manager/cert-manager v1.18.0
1010
github.com/containerd/containerd v1.7.27
1111
github.com/containers/image/v5 v5.35.0
1212
github.com/fsnotify/fsnotify v1.9.0
@@ -27,7 +27,7 @@ require (
2727
golang.org/x/exp v0.0.0-20250228200357-dead58393ab7
2828
golang.org/x/mod v0.25.0
2929
golang.org/x/sync v0.15.0
30-
golang.org/x/tools v0.33.0
30+
golang.org/x/tools v0.34.0
3131
gopkg.in/yaml.v2 v2.4.0
3232
helm.sh/helm/v3 v3.17.3
3333
k8s.io/api v0.32.3
@@ -52,7 +52,7 @@ require (
5252
require (
5353
cel.dev/expr v0.23.1 // indirect
5454
dario.cat/mergo v1.0.1 // indirect
55-
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
55+
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 // indirect
5656
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
5757
github.com/MakeNowJust/heredoc v1.0.0 // indirect
5858
github.com/Masterminds/goutils v1.1.1 // indirect
@@ -224,12 +224,12 @@ require (
224224
go.opentelemetry.io/otel/sdk v1.34.0 // indirect
225225
go.opentelemetry.io/otel/trace v1.34.0 // indirect
226226
go.opentelemetry.io/proto/otlp v1.4.0 // indirect
227-
golang.org/x/crypto v0.38.0 // indirect
228-
golang.org/x/net v0.40.0 // indirect
227+
golang.org/x/crypto v0.39.0 // indirect
228+
golang.org/x/net v0.41.0 // indirect
229229
golang.org/x/oauth2 v0.29.0 // indirect
230230
golang.org/x/sys v0.33.0 // indirect
231231
golang.org/x/term v0.32.0 // indirect
232-
golang.org/x/text v0.25.0 // indirect
232+
golang.org/x/text v0.26.0 // indirect
233233
golang.org/x/time v0.11.0 // indirect
234234
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
235235
google.golang.org/genproto v0.0.0-20250303144028-a0af3efb3deb // indirect

go.sum

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s=
55
dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
66
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
77
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
8-
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU=
9-
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8=
8+
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8afgbRMd7mFxO99hRNu+6tazq8nFF9lIwo9JFroBk=
9+
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8=
1010
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg=
1111
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
1212
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
@@ -51,8 +51,8 @@ github.com/bshuster-repo/logrus-logstash-hook v1.0.0/go.mod h1:zsTqEiSzDgAa/8GZR
5151
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
5252
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
5353
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
54-
github.com/cert-manager/cert-manager v1.17.1 h1:Aig+lWMoLsmpGd9TOlTvO4t0Ah3D+/vGB37x/f+ZKt0=
55-
github.com/cert-manager/cert-manager v1.17.1/go.mod h1:zeG4D+AdzqA7hFMNpYCJgcQ2VOfFNBa+Jzm3kAwiDU4=
54+
github.com/cert-manager/cert-manager v1.18.0 h1:v7vxC1Mx5tkDz1oGOAktB88zA6TbGKcmpLM92+AIXRc=
55+
github.com/cert-manager/cert-manager v1.18.0/go.mod h1:icDJx4kG9BCNpGjBvrmsFd99d+lXUvWdkkcrSSQdIiw=
5656
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
5757
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
5858
github.com/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNSjIRk=
@@ -605,8 +605,8 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY
605605
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
606606
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
607607
golang.org/x/crypto v0.30.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
608-
golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8=
609-
golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw=
608+
golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM=
609+
golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U=
610610
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
611611
golang.org/x/exp v0.0.0-20250228200357-dead58393ab7 h1:aWwlzYV971S4BXRS9AmqwDLAD85ouC6X+pocatKY58c=
612612
golang.org/x/exp v0.0.0-20250228200357-dead58393ab7/go.mod h1:BHOTPb3L19zxehTsLoJXVaTktb06DFgmdW6Wb9s8jqk=
@@ -640,8 +640,8 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
640640
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
641641
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
642642
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
643-
golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY=
644-
golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
643+
golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw=
644+
golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA=
645645
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
646646
golang.org/x/oauth2 v0.29.0 h1:WdYw2tdTK1S8olAzWHdgeqfy+Mtm9XNhv/xJsY65d98=
647647
golang.org/x/oauth2 v0.29.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
@@ -702,8 +702,8 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
702702
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
703703
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
704704
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
705-
golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
706-
golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
705+
golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M=
706+
golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=
707707
golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0=
708708
golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
709709
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -718,8 +718,8 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc
718718
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
719719
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
720720
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
721-
golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc=
722-
golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI=
721+
golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo=
722+
golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg=
723723
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
724724
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
725725
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

internal/catalogd/controllers/core/clustercatalog_controller.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,14 @@ func (r *ClusterCatalogReconciler) reconcile(ctx context.Context, catalog *ocv1.
196196
return ctrl.Result{}, nil
197197
}
198198

199+
if catalog.GetDeletionTimestamp() != nil {
200+
// If we've gotten here, that means the cluster catalog is being deleted, we've handled all of
201+
// _our_ finalizers (above), but the cluster catalog is still present in the cluster, likely
202+
// because there are _other_ finalizers that other controllers need to handle, (e.g. the orphan
203+
// deletion finalizer).
204+
return ctrl.Result{}, nil
205+
}
206+
199207
// TODO: The below algorithm to get the current state based on an in-memory
200208
// storedCatalogs map is a hack that helps us keep the ClusterCatalog's
201209
// status up-to-date. The fact that we need this setup is indicative of

internal/catalogd/controllers/core/clustercatalog_controller_test.go

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,40 @@ func TestCatalogdControllerReconcile(t *testing.T) {
766766
},
767767
},
768768
},
769+
{
770+
name: "reconcile should be short-circuited if the clustercatalog has a deletion timestamp and all known finalizers have been removed",
771+
catalog: &ocv1.ClusterCatalog{
772+
ObjectMeta: metav1.ObjectMeta{
773+
Name: "catalog",
774+
Finalizers: []string{"finalizer"},
775+
DeletionTimestamp: &metav1.Time{Time: time.Date(2025, 6, 10, 16, 43, 0, 0, time.UTC)},
776+
},
777+
Spec: ocv1.ClusterCatalogSpec{
778+
Source: ocv1.CatalogSource{
779+
Type: ocv1.SourceTypeImage,
780+
Image: &ocv1.ImageSource{
781+
Ref: "my.org/someimage:latest",
782+
},
783+
},
784+
AvailabilityMode: ocv1.AvailabilityModeAvailable,
785+
},
786+
},
787+
expectedCatalog: &ocv1.ClusterCatalog{
788+
ObjectMeta: metav1.ObjectMeta{
789+
Name: "catalog",
790+
Finalizers: []string{"finalizer"},
791+
DeletionTimestamp: &metav1.Time{Time: time.Date(2025, 6, 10, 16, 43, 0, 0, time.UTC)}},
792+
Spec: ocv1.ClusterCatalogSpec{
793+
Source: ocv1.CatalogSource{
794+
Type: ocv1.SourceTypeImage,
795+
Image: &ocv1.ImageSource{
796+
Ref: "my.org/someimage:latest",
797+
},
798+
},
799+
AvailabilityMode: ocv1.AvailabilityModeAvailable,
800+
},
801+
},
802+
},
769803
} {
770804
t.Run(tt.name, func(t *testing.T) {
771805
reconciler := &ClusterCatalogReconciler{

internal/operator-controller/controllers/clusterextension_controller.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,14 @@ func (r *ClusterExtensionReconciler) reconcile(ctx context.Context, ext *ocv1.Cl
206206
return ctrl.Result{}, nil
207207
}
208208

209+
if ext.GetDeletionTimestamp() != nil {
210+
// If we've gotten here, that means the cluster extension is being deleted, we've handled all of
211+
// _our_ finalizers (above), but the cluster extension is still present in the cluster, likely
212+
// because there are _other_ finalizers that other controllers need to handle, (e.g. the orphan
213+
// deletion finalizer).
214+
return ctrl.Result{}, nil
215+
}
216+
209217
l.Info("getting installed bundle")
210218
installedBundle, err := r.InstalledBundleGetter.GetInstalledBundle(ctx, ext)
211219
if err != nil {

internal/operator-controller/controllers/clusterextension_controller_test.go

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,79 @@ func TestClusterExtensionDoesNotExist(t *testing.T) {
4848
require.NoError(t, err)
4949
}
5050

51+
func TestClusterExtensionShortCircuitsReconcileDuringDeletion(t *testing.T) {
52+
cl, reconciler := newClientAndReconciler(t)
53+
54+
installedBundleGetterCalledErr := errors.New("installed bundle getter called")
55+
checkInstalledBundleGetterCalled := func(t require.TestingT, err error, args ...interface{}) {
56+
require.Equal(t, installedBundleGetterCalledErr, err)
57+
}
58+
reconciler.InstalledBundleGetter = &MockInstalledBundleGetter{
59+
err: installedBundleGetterCalledErr,
60+
}
61+
62+
type testCase struct {
63+
name string
64+
finalizers []string
65+
shouldDelete bool
66+
expectErr require.ErrorAssertionFunc
67+
}
68+
for _, tc := range []testCase{
69+
{
70+
name: "no finalizers, not deleted",
71+
expectErr: checkInstalledBundleGetterCalled,
72+
},
73+
{
74+
name: "has finalizers, not deleted",
75+
finalizers: []string{"finalizer"},
76+
expectErr: checkInstalledBundleGetterCalled,
77+
},
78+
{
79+
name: "has finalizers, deleted",
80+
finalizers: []string{"finalizer"},
81+
shouldDelete: true,
82+
expectErr: require.NoError,
83+
},
84+
} {
85+
t.Run(tc.name, func(t *testing.T) {
86+
pkgName := fmt.Sprintf("test-pkg-%s", rand.String(6))
87+
88+
ctx := context.Background()
89+
extKey := types.NamespacedName{Name: fmt.Sprintf("cluster-extension-test-%s", rand.String(8))}
90+
91+
t.Log("When the cluster extension specifies a non-existent package")
92+
t.Log("By initializing cluster state")
93+
clusterExtension := &ocv1.ClusterExtension{
94+
ObjectMeta: metav1.ObjectMeta{
95+
Name: extKey.Name,
96+
Finalizers: tc.finalizers,
97+
},
98+
Spec: ocv1.ClusterExtensionSpec{
99+
Source: ocv1.SourceConfig{
100+
SourceType: "Catalog",
101+
Catalog: &ocv1.CatalogFilter{
102+
PackageName: pkgName,
103+
},
104+
},
105+
Namespace: "default",
106+
ServiceAccount: ocv1.ServiceAccountReference{
107+
Name: "default",
108+
},
109+
},
110+
}
111+
require.NoError(t, cl.Create(ctx, clusterExtension))
112+
if tc.shouldDelete {
113+
require.NoError(t, cl.Delete(ctx, clusterExtension))
114+
}
115+
116+
t.Log("By running reconcile")
117+
res, err := reconciler.Reconcile(ctx, ctrl.Request{NamespacedName: extKey})
118+
require.Equal(t, ctrl.Result{}, res)
119+
tc.expectErr(t, err)
120+
})
121+
}
122+
}
123+
51124
func TestClusterExtensionResolutionFails(t *testing.T) {
52125
pkgName := fmt.Sprintf("non-existent-%s", rand.String(6))
53126
cl, reconciler := newClientAndReconciler(t)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ PyYAML==6.0.2
2828
pyyaml_env_tag==1.1
2929
readtime==3.0.0
3030
regex==2024.11.6
31-
requests==2.32.3
31+
requests==2.32.4
3232
six==1.17.0
3333
soupsieve==2.7
3434
urllib3==2.4.0

vendor/github.com/AdaLogics/go-fuzz-headers/consumer.go

Lines changed: 47 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)