mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2026-01-08 16:21:50 +00:00
Remove PV annotations for quobyte provisioner
This commit is contained in:
@@ -147,36 +147,6 @@ func GetSecretForPV(secretNamespace, secretName, volumePluginName string, kubeCl
|
||||
return secret, nil
|
||||
}
|
||||
|
||||
// AddVolumeAnnotations adds a golang Map as annotation to a PersistentVolume
|
||||
func AddVolumeAnnotations(pv *api.PersistentVolume, annotations map[string]string) {
|
||||
if pv.Annotations == nil {
|
||||
pv.Annotations = map[string]string{}
|
||||
}
|
||||
|
||||
for k, v := range annotations {
|
||||
pv.Annotations[k] = v
|
||||
}
|
||||
}
|
||||
|
||||
// ParseVolumeAnnotations reads the defined annoations from a PersistentVolume
|
||||
func ParseVolumeAnnotations(pv *api.PersistentVolume, parseAnnotations []string) (map[string]string, error) {
|
||||
result := map[string]string{}
|
||||
|
||||
if pv.Annotations == nil {
|
||||
return result, fmt.Errorf("cannot parse volume annotations: no annotations found")
|
||||
}
|
||||
|
||||
for _, annotation := range parseAnnotations {
|
||||
if val, ok := pv.Annotations[annotation]; ok {
|
||||
result[annotation] = val
|
||||
} else {
|
||||
return result, fmt.Errorf("cannot parse volume annotations: annotation %s not found", annotation)
|
||||
}
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func GetClassForVolume(kubeClient clientset.Interface, pv *api.PersistentVolume) (*storage.StorageClass, error) {
|
||||
// TODO: replace with a real attribute after beta
|
||||
className, found := pv.Annotations["volume.beta.kubernetes.io/storage-class"]
|
||||
|
||||
Reference in New Issue
Block a user