This repository was archived by the owner on Aug 14, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,11 @@ func (p *openEBSProvisioner) Provision(options controller.VolumeOptions) (*v1.Pe
111111 volumeSpec .Metadata .Labels .PersistentVolumeClaim = options .PVC .ObjectMeta .Name
112112 volumeSpec .Metadata .Name = options .PVName
113113
114+ //Pass through labels from PVC to maya-apiserver
115+ volumeSpec .Metadata .Labels .Application = options .PVC .ObjectMeta .GetLabels ()[mayav1 .PVCLabelsApplication ]
116+ volumeSpec .Metadata .Labels .ReplicaTopoKeyDomain = options .PVC .ObjectMeta .GetLabels ()[mayav1 .PVCLabelsReplicaTopKeyDomain ]
117+ volumeSpec .Metadata .Labels .ReplicaTopoKeyType = options .PVC .ObjectMeta .GetLabels ()[mayav1 .PVCLabelsReplicaTopKeyType ]
118+
114119 _ , err := openebsVol .CreateVolume (volumeSpec )
115120 if err != nil {
116121 glog .Errorf ("Error creating volume: %v" , err )
Original file line number Diff line number Diff line change @@ -16,7 +16,13 @@ limitations under the License.
1616
1717package v1
1818
19- //VolumeSpec holds the config for creating a VSM
19+ const (
20+ PVCLabelsApplication = "volumeprovisioner.mapi.openebs.io/application"
21+ PVCLabelsReplicaTopKeyDomain = "volumeprovisioner.mapi.openebs.io/replica-topology-key-domain"
22+ PVCLabelsReplicaTopKeyType = "volumeprovisioner.mapi.openebs.io/replica-topology-key-type"
23+ )
24+
25+ //VolumeSpec holds the config for creating a OpenEBS Volume
2026type VolumeSpec struct {
2127 Kind string `yaml:"kind"`
2228 APIVersion string `yaml:"apiVersion"`
@@ -27,6 +33,9 @@ type VolumeSpec struct {
2733 StorageClass string `yaml:"k8s.io/storage-class"`
2834 Namespace string `yaml:"k8s.io/namespace"`
2935 PersistentVolumeClaim string `yaml:"k8s.io/pvc"`
36+ Application string `yaml:"volumeprovisioner.mapi.openebs.io/application,omitempty"`
37+ ReplicaTopoKeyDomain string `yaml:"volumeprovisioner.mapi.openebs.io/replica-topology-key-domain,omitempty"`
38+ ReplicaTopoKeyType string `yaml:"volumeprovisioner.mapi.openebs.io/replica-topology-key-type,omitempty"`
3039 } `yaml:"labels"`
3140 } `yaml:"metadata"`
3241 CloneIP string `yaml:"cloneIP"`
You can’t perform that action at this time.
0 commit comments