pvc name is same as component ns
compName is saved as label in pvc
@@ -50,18 +50,20 @@ func (builder *Builder) BuildVolumeResponse(
allocatedQuantity = formatQuantity(*storage)
}
- var compName, compNamespace string
+ var compName string
+ if v, exist := pvc.Labels[controllers.KalmLabelComponentKey]; exist {
+ compName = v
+ }
+ if compName == "" {
if v, exist := pv.Labels[controllers.KalmLabelComponentKey]; exist {
compName = v
}
- if v, exist := pv.Labels[controllers.KalmLabelNamespaceKey]; exist {
- compNamespace = v
}
return &Volume{
Name: pvc.Name,
ComponentName: compName,
- ComponentNamespace: compNamespace,
+ ComponentNamespace: pvc.Namespace,
IsInUse: isInUse,
Capacity: capInStr,
RequestedCapacity: capInStr,
