MCPcopy
hub / github.com/apecloud/kubeblocks / BuildPersistentVolumeClaimLabels

Function BuildPersistentVolumeClaimLabels

pkg/controller/factory/builder.go:238–251  ·  view source on GitHub ↗

BuildPersistentVolumeClaimLabels builds a pvc name label, and synchronize the labels from component to pvc.

(component *component.SynthesizedComponent, pvc *corev1.PersistentVolumeClaim,
	pvcTplName, templateName string)

Source from the content-addressed store, hash-verified

236
237// BuildPersistentVolumeClaimLabels builds a pvc name label, and synchronize the labels from component to pvc.
238func 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.
254func GetRestorePassword(synthesizedComp *component.SynthesizedComponent) string {

Callers 3

getPVCMapAndVolumesFunction · 0.92
BuildInstanceSetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…