mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 01:06:27 +00:00
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.
This commit is contained in:
parent
a845e3e936
commit
1fdd163dd1
@ -125,17 +125,17 @@ const annDynamicallyProvisioned = "pv.kubernetes.io/provisioned-by"
|
|||||||
// a volume for this PVC.
|
// a volume for this PVC.
|
||||||
const annStorageProvisioner = "volume.beta.kubernetes.io/storage-provisioner"
|
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.
|
// 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.
|
// 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 .
|
// 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.
|
// Number of retries when we create a PV object for a provisioned volume.
|
||||||
const createProvisionedPVRetryCount = 5
|
const createProvisionedPVRetryCount = 5
|
||||||
@ -1284,9 +1284,9 @@ func (ctrl *PersistentVolumeController) provisionClaimOperation(claimObj interfa
|
|||||||
|
|
||||||
// Gather provisioning options
|
// Gather provisioning options
|
||||||
tags := make(map[string]string)
|
tags := make(map[string]string)
|
||||||
tags[cloudVolumeCreatedForClaimNamespaceTag] = claim.Namespace
|
tags[CloudVolumeCreatedForClaimNamespaceTag] = claim.Namespace
|
||||||
tags[cloudVolumeCreatedForClaimNameTag] = claim.Name
|
tags[CloudVolumeCreatedForClaimNameTag] = claim.Name
|
||||||
tags[cloudVolumeCreatedForVolumeNameTag] = pvName
|
tags[CloudVolumeCreatedForVolumeNameTag] = pvName
|
||||||
|
|
||||||
options := vol.VolumeOptions{
|
options := vol.VolumeOptions{
|
||||||
PersistentVolumeReclaimPolicy: v1.PersistentVolumeReclaimDelete,
|
PersistentVolumeReclaimPolicy: v1.PersistentVolumeReclaimDelete,
|
||||||
|
Loading…
Reference in New Issue
Block a user