|
9 | 9 | "strings" |
10 | 10 |
|
11 | 11 | metal3v1 "github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1" |
| 12 | + "github.com/openstack-k8s-operators/lib-common/modules/common/backup" |
12 | 13 | "github.com/openstack-k8s-operators/lib-common/modules/common/env" |
13 | 14 | "github.com/openstack-k8s-operators/lib-common/modules/common/helper" |
14 | 15 | "github.com/openstack-k8s-operators/lib-common/modules/common/labels" |
@@ -71,7 +72,11 @@ func BaremetalHostProvision( |
71 | 72 | templateParameters["CloudUserName"] = instance.Spec.CloudUserName |
72 | 73 |
|
73 | 74 | // Prepare cloudinit (create secret) |
74 | | - secretLabels := labels.GetLabels(instance, labels.GetGroupLabel(baremetalv1.ServiceName), map[string]string{}) |
| 75 | + backupLabels := util.MergeStringMaps( |
| 76 | + backup.GetBackupLabels(backup.CategoryDataPlane), |
| 77 | + backup.GetRestoreLabels(backup.RestoreOrder10, backup.CategoryDataPlane), |
| 78 | + ) |
| 79 | + secretLabels := labels.GetLabels(instance, labels.GetGroupLabel(baremetalv1.ServiceName), backupLabels) |
75 | 80 | if passwordSecret != nil && len(passwordSecret.Data["NodeRootPassword"]) > 0 { |
76 | 81 | templateParameters["NodeRootPassword"] = string(passwordSecret.Data["NodeRootPassword"]) |
77 | 82 | } |
@@ -152,9 +157,12 @@ func BaremetalHostProvision( |
152 | 157 | networkDataSecretName := fmt.Sprintf(CloudInitNetworkDataSecretName, instance.Name, hostName) |
153 | 158 |
|
154 | 159 | // Flag the network data secret as safe to collect with must-gather |
155 | | - secretLabelsWithMustGather := labels.GetLabels(instance, labels.GetGroupLabel(baremetalv1.ServiceName), map[string]string{ |
156 | | - MustGatherSecret: "yes", |
157 | | - }) |
| 160 | + networkDataLabels := util.MergeStringMaps( |
| 161 | + map[string]string{MustGatherSecret: "yes"}, |
| 162 | + backup.GetBackupLabels(backup.CategoryDataPlane), |
| 163 | + backup.GetRestoreLabels(backup.RestoreOrder10, backup.CategoryDataPlane), |
| 164 | + ) |
| 165 | + secretLabelsWithMustGather := labels.GetLabels(instance, labels.GetGroupLabel(baremetalv1.ServiceName), networkDataLabels) |
158 | 166 |
|
159 | 167 | networkDataSt := util.Template{ |
160 | 168 | Name: networkDataSecretName, |
|
0 commit comments