Skip to content

Commit 914c3c0

Browse files
authored
[release/v0.8] Label admission-configuration-psact secret to be backed up (#1009)
* Label admission-configuration-psact secret to be backed up * Include backup label in tests
1 parent 728fba9 commit 914c3c0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

pkg/resources/provisioning.cattle.io/v1/cluster/mutator.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const (
4242
mountPath = "/etc/rancher/%s/config/rancher-psact.yaml"
4343

4444
controlPlaneRoleLabel = "rke.cattle.io/control-plane-role"
45+
backupLabel = "resources.cattle.io/backup"
4546
secretAnnotation = "rke.cattle.io/object-authorized-for-clusters"
4647
allowDynamicSchemaDropAnnotation = "provisioning.cattle.io/allow-dynamic-schema-drop"
4748
runtimeK3S = "k3s"
@@ -316,6 +317,9 @@ func (m *ProvisioningClusterMutator) ensureSecret(namespace, name string, data m
316317
ObjectMeta: metav1.ObjectMeta{
317318
Name: name,
318319
Namespace: namespace,
320+
Labels: map[string]string{
321+
backupLabel: "true",
322+
},
319323
},
320324
Data: data,
321325
Type: corev1.SecretTypeOpaque,

pkg/resources/provisioning.cattle.io/v1/cluster/mutator_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ func machineSelectorFile2() rkev1.RKEProvisioningFiles {
505505
MachineLabelSelector: &metav1.LabelSelector{
506506
MatchLabels: map[string]string{
507507
controlPlaneRoleLabel: "true",
508+
backupLabel: "true",
508509
},
509510
},
510511
FileSources: []rkev1.ProvisioningFileSource{
@@ -530,6 +531,7 @@ func machineSelectorFile1() rkev1.RKEProvisioningFiles {
530531
MachineLabelSelector: &metav1.LabelSelector{
531532
MatchLabels: map[string]string{
532533
controlPlaneRoleLabel: "true",
534+
backupLabel: "true",
533535
},
534536
},
535537
FileSources: []rkev1.ProvisioningFileSource{

0 commit comments

Comments
 (0)