Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions cocoonset/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"

cocoonv1 "github.com/cocoonstack/cocoon-common/apis/v1"
commonk8s "github.com/cocoonstack/cocoon-common/k8s"
"github.com/cocoonstack/cocoon-common/meta"
)

Expand Down Expand Up @@ -108,12 +109,12 @@ func (r *Reconciler) stashDeleteVMNames(ctx context.Context, cs *cocoonv1.Cocoon
if cs.Annotations[annotationDeleteVMNames] == joined {
return nil
}
patch := client.MergeFrom(cs.DeepCopy())
if cs.Annotations == nil {
cs.Annotations = map[string]string{}
}
cs.Annotations[annotationDeleteVMNames] = joined
return r.Patch(ctx, cs, patch)
return commonk8s.Patch(ctx, r.Client, cs, func(c *cocoonv1.CocoonSet) {
if c.Annotations == nil {
c.Annotations = map[string]string{}
}
c.Annotations[annotationDeleteVMNames] = joined
})
}

// vmNamesForGC returns the canonical GC list, read from the stashed annotation.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/cocoonstack/cocoon-operator
go 1.26.5

require (
github.com/cocoonstack/cocoon-common v0.2.8-0.20260724145826-4363e4ff03ee
github.com/cocoonstack/cocoon-common v0.2.8-0.20260726095001-32dacef3f4c1
github.com/go-logr/logr v1.4.3
github.com/google/go-containerregistry v0.21.7
github.com/projecteru2/core v0.0.0-20241016125006-ff909eefe04c
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZe
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs=
github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ=
github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
github.com/cocoonstack/cocoon-common v0.2.8-0.20260724145826-4363e4ff03ee h1:KshBIXkOlQMNdL7DPoYXitxq+qeWyQSqQsvIpDV0gv4=
github.com/cocoonstack/cocoon-common v0.2.8-0.20260724145826-4363e4ff03ee/go.mod h1:VSfgYiWxoHRnWybzQNaxmK4kVoLT9ffiMKll5/i92CM=
github.com/cocoonstack/cocoon-common v0.2.8-0.20260726095001-32dacef3f4c1 h1:JTQr97YGwJ71druXkVHYb6m1HIIzY/J3pputWAeYHUM=
github.com/cocoonstack/cocoon-common v0.2.8-0.20260726095001-32dacef3f4c1/go.mod h1:VSfgYiWxoHRnWybzQNaxmK4kVoLT9ffiMKll5/i92CM=
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
Expand Down