From 1fdd163dd1bf3737a8437ed36c1fd4c158f18afd Mon Sep 17 00:00:00 2001 From: pospispa Date: Fri, 24 Mar 2017 16:44:43 +0100 Subject: [PATCH] Make Some Constants Public so that They Can Be Used in an External Provisioner Out-of-tree external provisioners have the same purpose as in-tree provisioners. As external provisioners work with PV and PVC datastructures it's an advantage to import certain Kubernetes packages instead of copy-pasting the Kubernetes code. That's why the constants are made public so that they can be used in an external provisioner. --- .../volume/persistentvolume/pv_controller.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/controller/volume/persistentvolume/pv_controller.go b/pkg/controller/volume/persistentvolume/pv_controller.go index c3385a5483c..56b49027191 100644 --- a/pkg/controller/volume/persistentvolume/pv_controller.go +++ b/pkg/controller/volume/persistentvolume/pv_controller.go @@ -125,17 +125,17 @@ const annDynamicallyProvisioned = "pv.kubernetes.io/provisioned-by" // a volume for this PVC. const annStorageProvisioner = "volume.beta.kubernetes.io/storage-provisioner" -// Name of a tag attached to a real volume in cloud (e.g. AWS EBS or GCE PD) +// CloudVolumeCreatedForClaimNamespaceTag is a name of a tag attached to a real volume in cloud (e.g. AWS EBS or GCE PD) // with namespace of a persistent volume claim used to create this volume. -const cloudVolumeCreatedForClaimNamespaceTag = "kubernetes.io/created-for/pvc/namespace" +const CloudVolumeCreatedForClaimNamespaceTag = "kubernetes.io/created-for/pvc/namespace" -// Name of a tag attached to a real volume in cloud (e.g. AWS EBS or GCE PD) +// CloudVolumeCreatedForClaimNameTag is a name of a tag attached to a real volume in cloud (e.g. AWS EBS or GCE PD) // with name of a persistent volume claim used to create this volume. -const cloudVolumeCreatedForClaimNameTag = "kubernetes.io/created-for/pvc/name" +const CloudVolumeCreatedForClaimNameTag = "kubernetes.io/created-for/pvc/name" -// Name of a tag attached to a real volume in cloud (e.g. AWS EBS or GCE PD) +// CloudVolumeCreatedForVolumeNameTag is a name of a tag attached to a real volume in cloud (e.g. AWS EBS or GCE PD) // with name of appropriate Kubernetes persistent volume . -const cloudVolumeCreatedForVolumeNameTag = "kubernetes.io/created-for/pv/name" +const CloudVolumeCreatedForVolumeNameTag = "kubernetes.io/created-for/pv/name" // Number of retries when we create a PV object for a provisioned volume. const createProvisionedPVRetryCount = 5 @@ -1284,9 +1284,9 @@ func (ctrl *PersistentVolumeController) provisionClaimOperation(claimObj interfa // Gather provisioning options tags := make(map[string]string) - tags[cloudVolumeCreatedForClaimNamespaceTag] = claim.Namespace - tags[cloudVolumeCreatedForClaimNameTag] = claim.Name - tags[cloudVolumeCreatedForVolumeNameTag] = pvName + tags[CloudVolumeCreatedForClaimNamespaceTag] = claim.Namespace + tags[CloudVolumeCreatedForClaimNameTag] = claim.Name + tags[CloudVolumeCreatedForVolumeNameTag] = pvName options := vol.VolumeOptions{ PersistentVolumeReclaimPolicy: v1.PersistentVolumeReclaimDelete,