Skip to content

Commit f2c01e2

Browse files
stuggiclaude
andcommitted
[b/r] Use GetRestoreLabels for CR instance labeling
Update backup controller to use the new GetRestoreLabels() API from lib-common. CR instances only need restore ordering labels, not OADP backup selection labels (which are for PVCs). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 30ebc6f commit f2c01e2

5 files changed

Lines changed: 21 additions & 21 deletions

File tree

api/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ replace k8s.io/component-base => k8s.io/component-base v0.31.14 //allow-merging
144144

145145
replace github.com/cert-manager/cmctl/v2 => github.com/cert-manager/cmctl/v2 v2.1.2-0.20241127223932-88edb96860cf //allow-merging
146146

147-
replace github.com/openstack-k8s-operators/lib-common/modules/common => github.com/stuggi/lib-common/modules/common v0.0.0-20260309175117-e79744208cf4
147+
replace github.com/openstack-k8s-operators/lib-common/modules/common => github.com/stuggi/lib-common/modules/common v0.0.0-20260310162126-a02e181bb4fe
148148

149-
replace github.com/openstack-k8s-operators/mariadb-operator/api => github.com/stuggi/mariadb-operator/api v0.0.0-20260306144419-2488094f460d
149+
replace github.com/openstack-k8s-operators/mariadb-operator/api => github.com/stuggi/mariadb-operator/api v0.0.0-20260310162619-bbe04d26ad80
150150

151-
replace github.com/openstack-k8s-operators/glance-operator/api => github.com/stuggi/glance-operator/api v0.0.0-20260306145615-9f64fd5c91e9
151+
replace github.com/openstack-k8s-operators/glance-operator/api => github.com/stuggi/glance-operator/api v0.0.0-20260310162611-c4f8e273f674

api/go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,12 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
183183
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
184184
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
185185
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
186-
github.com/stuggi/glance-operator/api v0.0.0-20260306145615-9f64fd5c91e9 h1:tBPkvGo3t7x44hVYL18scD3HrZKyQnkOajXo8ubiIOo=
187-
github.com/stuggi/glance-operator/api v0.0.0-20260306145615-9f64fd5c91e9/go.mod h1:4Y0Q6mnvhxYe4ZXhfr20NAZ23QOT5qsaU3R1E5tdd34=
188-
github.com/stuggi/lib-common/modules/common v0.0.0-20260309175117-e79744208cf4 h1:AYnU40LwZBB3Stckb51OtpfGeY2Ul5XLrjTGYLQ1O1k=
189-
github.com/stuggi/lib-common/modules/common v0.0.0-20260309175117-e79744208cf4/go.mod h1:I/VBXZLdjk8DUGsEbB+Ha72JBFYYntP7Pm2FpEto9K8=
190-
github.com/stuggi/mariadb-operator/api v0.0.0-20260306144419-2488094f460d h1:zS3ZlThcTUbyNrX5Tdh9z72Bd7+jLugTIxGJq+qwZzQ=
191-
github.com/stuggi/mariadb-operator/api v0.0.0-20260306144419-2488094f460d/go.mod h1:z/bs1jL8R+hafiMPKpY+aLbyE9efBpLdznbUw1XK5tA=
186+
github.com/stuggi/glance-operator/api v0.0.0-20260310162611-c4f8e273f674 h1:fQyaEVm0qXxXWgGscaZJbgXfdhoLdTHFJTr+xt34TTU=
187+
github.com/stuggi/glance-operator/api v0.0.0-20260310162611-c4f8e273f674/go.mod h1:4Y0Q6mnvhxYe4ZXhfr20NAZ23QOT5qsaU3R1E5tdd34=
188+
github.com/stuggi/lib-common/modules/common v0.0.0-20260310162126-a02e181bb4fe h1:rF2oKDNtSB1FW9upDT+pavj3k4tTijeiDpsj6PSKYww=
189+
github.com/stuggi/lib-common/modules/common v0.0.0-20260310162126-a02e181bb4fe/go.mod h1:I/VBXZLdjk8DUGsEbB+Ha72JBFYYntP7Pm2FpEto9K8=
190+
github.com/stuggi/mariadb-operator/api v0.0.0-20260310162619-bbe04d26ad80 h1:5gdFdNiwb/xOW+LoBB+UdIMcPUm9yPZwhfHlKs9K2O8=
191+
github.com/stuggi/mariadb-operator/api v0.0.0-20260310162619-bbe04d26ad80/go.mod h1:z/bs1jL8R+hafiMPKpY+aLbyE9efBpLdznbUw1XK5tA=
192192
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
193193
github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
194194
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ replace k8s.io/component-base => k8s.io/component-base v0.31.14 //allow-merging
182182

183183
replace github.com/cert-manager/cmctl/v2 => github.com/cert-manager/cmctl/v2 v2.1.2-0.20241127223932-88edb96860cf //allow-merging
184184

185-
replace github.com/openstack-k8s-operators/lib-common/modules/common => github.com/stuggi/lib-common/modules/common v0.0.0-20260309175117-e79744208cf4
185+
replace github.com/openstack-k8s-operators/lib-common/modules/common => github.com/stuggi/lib-common/modules/common v0.0.0-20260310162126-a02e181bb4fe
186186

187-
replace github.com/openstack-k8s-operators/mariadb-operator/api => github.com/stuggi/mariadb-operator/api v0.0.0-20260306144419-2488094f460d
187+
replace github.com/openstack-k8s-operators/mariadb-operator/api => github.com/stuggi/mariadb-operator/api v0.0.0-20260310162619-bbe04d26ad80
188188

189-
replace github.com/openstack-k8s-operators/glance-operator/api => github.com/stuggi/glance-operator/api v0.0.0-20260306145615-9f64fd5c91e9
189+
replace github.com/openstack-k8s-operators/glance-operator/api => github.com/stuggi/glance-operator/api v0.0.0-20260310162611-c4f8e273f674

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,12 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
226226
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
227227
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
228228
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
229-
github.com/stuggi/glance-operator/api v0.0.0-20260306145615-9f64fd5c91e9 h1:tBPkvGo3t7x44hVYL18scD3HrZKyQnkOajXo8ubiIOo=
230-
github.com/stuggi/glance-operator/api v0.0.0-20260306145615-9f64fd5c91e9/go.mod h1:4Y0Q6mnvhxYe4ZXhfr20NAZ23QOT5qsaU3R1E5tdd34=
231-
github.com/stuggi/lib-common/modules/common v0.0.0-20260309175117-e79744208cf4 h1:AYnU40LwZBB3Stckb51OtpfGeY2Ul5XLrjTGYLQ1O1k=
232-
github.com/stuggi/lib-common/modules/common v0.0.0-20260309175117-e79744208cf4/go.mod h1:I/VBXZLdjk8DUGsEbB+Ha72JBFYYntP7Pm2FpEto9K8=
233-
github.com/stuggi/mariadb-operator/api v0.0.0-20260306144419-2488094f460d h1:zS3ZlThcTUbyNrX5Tdh9z72Bd7+jLugTIxGJq+qwZzQ=
234-
github.com/stuggi/mariadb-operator/api v0.0.0-20260306144419-2488094f460d/go.mod h1:z/bs1jL8R+hafiMPKpY+aLbyE9efBpLdznbUw1XK5tA=
229+
github.com/stuggi/glance-operator/api v0.0.0-20260310162611-c4f8e273f674 h1:fQyaEVm0qXxXWgGscaZJbgXfdhoLdTHFJTr+xt34TTU=
230+
github.com/stuggi/glance-operator/api v0.0.0-20260310162611-c4f8e273f674/go.mod h1:4Y0Q6mnvhxYe4ZXhfr20NAZ23QOT5qsaU3R1E5tdd34=
231+
github.com/stuggi/lib-common/modules/common v0.0.0-20260310162126-a02e181bb4fe h1:rF2oKDNtSB1FW9upDT+pavj3k4tTijeiDpsj6PSKYww=
232+
github.com/stuggi/lib-common/modules/common v0.0.0-20260310162126-a02e181bb4fe/go.mod h1:I/VBXZLdjk8DUGsEbB+Ha72JBFYYntP7Pm2FpEto9K8=
233+
github.com/stuggi/mariadb-operator/api v0.0.0-20260310162619-bbe04d26ad80 h1:5gdFdNiwb/xOW+LoBB+UdIMcPUm9yPZwhfHlKs9K2O8=
234+
github.com/stuggi/mariadb-operator/api v0.0.0-20260310162619-bbe04d26ad80/go.mod h1:z/bs1jL8R+hafiMPKpY+aLbyE9efBpLdznbUw1XK5tA=
235235
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
236236
github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
237237
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=

internal/controller/backup/openstackbackupconfig_controller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ func (r *OpenStackBackupConfigReconciler) labelResource(ctx context.Context, log
133133
return nil
134134
}
135135

136-
// Add backup labels
137-
backupLabels := backup.GetBackupLabels(restoreOrder)
136+
// Add restore labels for ordered restore
137+
backupLabels := backup.GetRestoreLabels(restoreOrder, "")
138138
labels = util.MergeStringMaps(labels, backupLabels)
139139
obj.SetLabels(labels)
140140

@@ -270,7 +270,7 @@ func (r *OpenStackBackupConfigReconciler) labelCRInstances(ctx context.Context,
270270
patch := client.MergeFrom(obj.DeepCopy())
271271
labels = util.MergeStringMaps(
272272
labels,
273-
backup.GetBackupLabelsWithCategory(backupConfig.RestoreOrder, backupConfig.Category),
273+
backup.GetRestoreLabels(backupConfig.RestoreOrder, backupConfig.Category),
274274
)
275275
obj.SetLabels(labels)
276276

0 commit comments

Comments
 (0)