BuildPersistentVolumeClaimLabels builds a pvc name label, and synchronize the labels from component to pvc.
(component *component.SynthesizedComponent, pvc *corev1.PersistentVolumeClaim, pvcTplName, templateName string)
| 236 | |
| 237 | // BuildPersistentVolumeClaimLabels builds a pvc name label, and synchronize the labels from component to pvc. |
| 238 | func BuildPersistentVolumeClaimLabels(component *component.SynthesizedComponent, pvc *corev1.PersistentVolumeClaim, |
| 239 | pvcTplName, templateName string) { |
| 240 | // strict args checking. |
| 241 | if pvc == nil || component == nil { |
| 242 | return |
| 243 | } |
| 244 | if pvc.Labels == nil { |
| 245 | pvc.Labels = make(map[string]string) |
| 246 | } |
| 247 | pvc.Labels[constant.VolumeClaimTemplateNameLabelKey] = pvcTplName |
| 248 | if templateName != "" { |
| 249 | pvc.Labels[constant.KBAppComponentInstanceTemplateLabelKey] = templateName |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | // GetRestorePassword gets restore password if exists during recovery. |
| 254 | func GetRestorePassword(synthesizedComp *component.SynthesizedComponent) string { |
no outgoing calls
no test coverage detected
searching dependent graphs…