· 7 years ago · Sep 01, 2018, 07:12 PM
1package controller
2
3import "time"
4
5// General constants we use for various labels and checks
6const (
7 cdiLabelKey = "app" //CDI_LABEL_KEY
8 cdiLabelValue = "containerized-data-importer" //CDI_LABEL_VALUE
9 CDILabelSelector = cdiLabelKey + "=" + cdiLabelValue //CDI_LABEL_SELECTOR
10 importerPodName = "importer" //IMPORTER_PODNAME
11 importerDataDir = "/data" //IMPORTER_DATA_DIR
12 cloningLabelKey = "cloning" //CLONING_LABEL_KEY
13 cloningLabelValue = "host-assisted-cloning" //CLONING_LABEL_VALUE
14 cloningTopologyKey = "kubernetes.io/hostname" //CLONING_TOPOLOGY_KEY *check this one
15 ClonerSourcePodName = "clone-source-pod" //CLONER_SOURCE_PODNAME
16 ClonerTargetPodName = "clone-target-pod" //CLONER_TARGET_PODNAME
17 clonerImagePath = "/tmp/clone/image" // CLONER_IMAGE_PATH
18 clonerSocketPath = "/tmp/clone/socket" // CLONER_SOCKET_PATH
19 keyAccess = "accessKeyId" //KeyAccess
20 keySecret = "secretKey" //KeySecret
21 defaultResyncPeriod = 10 * time.Minute // DEFAULT_RESYNC_PERIOD
22 dataVolumeName = "cdi-data-vol" //DataVolName
23 imagePathName = "image-path" //ImagePathName
24 socketPathName = "socket-path" //SocketPathName
25)
26
27// PVC Annotation related constants
28const (
29 cloneRequestAnnotation = "k8s.io/CloneRequest"
30 cloneOfAnnotation = "k8s.io/CloneOf"
31 cloningCreatedByAnnotation = "cdi.kubevirt.io/storage.cloningCreatedByController"
32 clonePodPhaseAnnotation = "cdi.kubevirt.io/storage.clone.pod.phase"
33 cloneUniqeIDAnnotation = "cdi.kubevirt.io/storage.clone.cloneUniqeId"
34 targetPodNamespaceAnnotation = "cdi.kubevirt.io/storage.clone.targetPod.namespace"
35 pvcEndpointAnnotation = "cdi.kubevirt.io/storage.import/endpoint" //AnnEndppoint
36 pvcSecretAnnotation = "cdi.kubevirt.io/storage.import.import.secretName" //AnnSecret
37 pvcImportPodAnnotation = "cdi.kubevirt.io/storage.import.importPodName" //AnnImportPod
38)
39
40// Importer POD Annotations
41const (
42 podCreateByAnnotation = "cdi.kubevirt.io/storage.createdByController" //AnnCreatedBy
43)