forked from kubernetes-sigs/aws-ebs-csi-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.go
111 lines (87 loc) · 4.08 KB
/
constants.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/*
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package driver
// constants of keys in PublishContext
const (
// devicePathKey represents key for device path in PublishContext
// devicePath is the device path where the volume is attached to
DevicePathKey = "devicePath"
)
// constants of keys in VolumeContext
const (
// VolumeAttributePartition represents key for partition config in VolumeContext
// this represents the partition number on a device used to mount
VolumeAttributePartition = "partition"
)
// constants of disk partition suffix
const (
diskPartitionSuffix = ""
nvmeDiskPartitionSuffix = "p"
)
// constants of keys in volume parameters
const (
// VolumeTypeKey represents key for volume type
VolumeTypeKey = "type"
// IopsPerGBKey represents key for IOPS per GB
IopsPerGBKey = "iopspergb"
// AllowAutoIOPSPerGBIncreaseKey represents key for allowing automatic increase of IOPS
AllowAutoIOPSPerGBIncreaseKey = "allowautoiopspergbincrease"
// Iops represents key for IOPS for volume
IopsKey = "iops"
// ThroughputKey represents key for throughput
ThroughputKey = "throughput"
// EncryptedKey represents key for whether filesystem is encrypted
EncryptedKey = "encrypted"
// KmsKeyId represents key for KMS encryption key
KmsKeyIDKey = "kmskeyid"
// PVCNameKey contains name of the PVC for which is a volume provisioned.
PVCNameKey = "csi.storage.k8s.io/pvc/name"
// PVCNamespaceKey contains namespace of the PVC for which is a volume provisioned.
PVCNamespaceKey = "csi.storage.k8s.io/pvc/namespace"
// PVNameKey contains name of the final PV that will be used for the dynamically
// provisioned volume
PVNameKey = "csi.storage.k8s.io/pv/name"
)
// constants for volume tags and their values
const (
// ResourceLifecycleTagPrefix is prefix of tag for provisioned EBS volume that
// marks them as owned by the cluster. Used only when --cluster-id is set.
ResourceLifecycleTagPrefix = "kubernetes.io/cluster/"
// ResourceLifecycleOwned is the value we use when tagging resources to indicate
// that the resource is considered owned and managed by the cluster,
// and in particular that the lifecycle is tied to the lifecycle of the cluster.
// From k8s.io/legacy-cloud-providers/aws/tags.go.
ResourceLifecycleOwned = "owned"
// NameTag is tag applied to provisioned EBS volume for backward compatibility with
// in-tree volume plugin. Used only when --cluster-id is set.
NameTag = "Name"
// PVCNameTag is tag applied to provisioned EBS volume for backward compatibility
// with in-tree volume plugin. Value of the tag is PVC name. It is applied only when
// the external provisioner sidecar is started with --extra-create-metadata=true and
// thus provides such metadata to the CSI driver.
PVCNameTag = "kubernetes.io/created-for/pvc/name"
// PVCNamespaceTag is tag applied to provisioned EBS volume for backward compatibility
// with in-tree volume plugin. Value of the tag is PVC namespace. It is applied only when
// the external provisioner sidecar is started with --extra-create-metadata=true and
// thus provides such metadata to the CSI driver.
PVCNamespaceTag = "kubernetes.io/created-for/pvc/namespace"
// PVNameTag is tag applied to provisioned EBS volume for backward compatibility
// with in-tree volume plugin. Value of the tag is PV name. It is applied only when
// the external provisioner sidecar is started with --extra-create-metadata=true and
// thus provides such metadata to the CSI driver.
PVNameTag = "kubernetes.io/created-for/pv/name"
)
// constants for default command line flag values
const (
DefaultCSIEndpoint = "unix://tmp/csi.sock"
)