-
Notifications
You must be signed in to change notification settings - Fork 88
/
constants.go
58 lines (43 loc) · 1.36 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
package types
const KotsadmKey = "kots.io/kotsadm"
const KotsadmLabelValue = "true"
const ClusterTokenSecret = "kotsadm-cluster-token"
const PrivateKotsadmRegistrySecret = "kotsadm-private-registry"
const KotsadmConfigMap = "kotsadm-confg"
const ExcludeKey = "velero.io/exclude-from-backup"
const ExcludeValue = "true"
const BackupLabel = "kots.io/backup"
const BackupLabelValue = "velero"
const TroubleshootKey = "troubleshoot.io/kind"
const TroubleshootValue = "support-bundle"
const DefaultSupportBundleSpecKey = "default"
const ClusterSpecificSupportBundleSpecKey = "cluster-specific"
const VendorSpecificSupportBundleSpecKey = "vendor"
func GetKotsadmLabels(additionalLabels ...map[string]string) map[string]string {
labels := map[string]string{
KotsadmKey: KotsadmLabelValue,
BackupLabel: BackupLabelValue,
}
for _, l := range additionalLabels {
labels = MergeLabels(labels, l)
}
return labels
}
func GetTroubleshootLabels(additionalLabels ...map[string]string) map[string]string {
labels := map[string]string{
TroubleshootKey: TroubleshootValue,
}
for _, l := range additionalLabels {
labels = MergeLabels(labels, l)
}
return labels
}
func MergeLabels(labels ...map[string]string) map[string]string {
mergedLabels := map[string]string{}
for _, label := range labels {
for k, v := range label {
mergedLabels[k] = v
}
}
return mergedLabels
}