Skip to content

Commit 36d9cd7

Browse files
committed
Fixup
1 parent 2a8e7b2 commit 36d9cd7

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

go.mod

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ module github.com/operator-framework/operator-controller
22

33
go 1.23.4
44

5-
replace pkg.package-operator.run/boxcutter => ../../package-operator/boxcutter
6-
75
require (
86
github.com/BurntSushi/toml v1.5.0
97
github.com/Masterminds/semver/v3 v3.3.1

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,8 @@ k8s.io/utils v0.0.0-20241210054802-24370beab758 h1:sdbE21q2nlQtFh65saZY+rRM6x6aJ
803803
k8s.io/utils v0.0.0-20241210054802-24370beab758/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
804804
oras.land/oras-go v1.2.5 h1:XpYuAwAb0DfQsunIyMfeET92emK8km3W4yEzZvUbsTo=
805805
oras.land/oras-go v1.2.5/go.mod h1:PuAwRShRZCsZb7g8Ar3jKKQR/2A/qN+pkYxIOd/FAoo=
806+
pkg.package-operator.run/boxcutter v0.1.0 h1:SXTrkqe19ikGrRuUgbOJUFvd/U5h928o5SWr3mTRAbo=
807+
pkg.package-operator.run/boxcutter v0.1.0/go.mod h1:1vqTF3YbUHfyuQGrFUB9Glj8xokcncIjhzePH++02SM=
806808
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0 h1:CPT0ExVicCzcpeN4baWEV2ko2Z/AsiZgEdwgcfwLgMo=
807809
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw=
808810
sigs.k8s.io/controller-runtime v0.20.3 h1:I6Ln8JfQjHH7JbtCD2HCYHoIzajoRxPNuvhvcDbZgkI=

internal/operator-controller/controllers/clusterextensionrevision_controller.go

+12-9
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,19 @@ func (c *ClusterExtensionRevisionReconciler) Reconcile(ctx context.Context, req
8383
// This situation can only appear if the ClusterExtension object has been deleted with --cascade=Orphan.
8484
// To not leave unactionable resources on the cluster, we are going to just
8585
// reap the revision reverences and propagate the Orphan deletion.
86-
err := client.IgnoreNotFound(
87-
c.Client.Delete(ctx, rev, client.PropagationPolicy(metav1.DeletePropagationOrphan), client.Preconditions{
88-
UID: ptr.To(rev.GetUID()),
89-
ResourceVersion: ptr.To(rev.GetResourceVersion()),
90-
}),
91-
)
92-
if err != nil {
93-
return res, err
86+
if rev.DeletionTimestamp.IsZero() {
87+
err := client.IgnoreNotFound(
88+
c.Client.Delete(ctx, rev, client.PropagationPolicy(metav1.DeletePropagationOrphan), client.Preconditions{
89+
UID: ptr.To(rev.GetUID()),
90+
ResourceVersion: ptr.To(rev.GetResourceVersion()),
91+
}),
92+
)
93+
if err != nil {
94+
return res, err
95+
}
96+
// we get requeued to remove the finalizer.
97+
return res, nil
9498
}
95-
9699
if err := c.removeFinalizer(ctx, rev, clusterExtensionRevisionTeardownFinalizer); err != nil {
97100
return res, err
98101
}

0 commit comments

Comments
 (0)