From 376283d208f6c7be066f488ffebc24ade7431a9c Mon Sep 17 00:00:00 2001 From: richardxz Date: Wed, 20 Jun 2018 12:47:15 +0800 Subject: [PATCH] use pvc annotations' "volume.beta.kubernetes.io/storage-class" as storage-class name when spec.storageClassName is nil --- pkg/models/controllers/pvcs.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/models/controllers/pvcs.go b/pkg/models/controllers/pvcs.go index e1eeb3af3..2c61aa8d7 100644 --- a/pkg/models/controllers/pvcs.go +++ b/pkg/models/controllers/pvcs.go @@ -47,6 +47,9 @@ func (ctl *PvcCtl) generateObject(item *v1.PersistentVolumeClaim) *Pvc { } storageClass := "-" + if len(item.Annotations["volume.beta.kubernetes.io/storage-class"]) > 0 { + storageClass = item.Annotations["volume.beta.kubernetes.io/storage-class"] + } if item.Spec.StorageClassName != nil { storageClass = *item.Spec.StorageClassName }