-
Notifications
You must be signed in to change notification settings - Fork 3
/
common.go
49 lines (38 loc) · 1.19 KB
/
common.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
package key
import (
"fmt"
"github.com/giantswarm/aws-admission-controller/v4/pkg/internal/normalize"
"github.com/giantswarm/aws-admission-controller/v4/pkg/label"
)
const (
organizationNamespaceFormat = "org-%s"
MinEBSVolumeThroughtput = 100
MaxEBSVolumeThroughtput = 1000
MinEBSVolumeIops = 3000
MaxEBSVolumeIops = 16000
)
func AWSOperator(getter LabelsGetter) string {
return getter.GetLabels()[label.AWSOperatorVersion]
}
func Cluster(getter LabelsGetter) string {
return getter.GetLabels()[label.Cluster]
}
func ClusterOperator(getter LabelsGetter) string {
return getter.GetLabels()[label.ClusterOperatorVersion]
}
func ControlPlane(getter LabelsGetter) string {
return getter.GetLabels()[label.ControlPlane]
}
func Release(getter LabelsGetter) string {
return getter.GetLabels()[label.Release]
}
func MachineDeployment(getter LabelsGetter) string {
return getter.GetLabels()[label.MachineDeployment]
}
func Organization(getter LabelsGetter) string {
return getter.GetLabels()[label.Organization]
}
func OrganizationNamespaceFromName(name string) string {
name = normalize.AsDNSLabelName(fmt.Sprintf(organizationNamespaceFormat, name))
return name
}