-
Notifications
You must be signed in to change notification settings - Fork 785
/
naming.go
32 lines (25 loc) · 1.01 KB
/
naming.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
package gke
import "fmt"
// BucketName creates a Bucket name for a given service name
func BucketName(serviceName string) string {
return generateName(serviceName, "bucket")
}
// ServiceAccountName creates a service account name for a given service and cluster name
func ServiceAccountName(clusterName, serviceAbbreviation string) string {
return generateName(clusterName, serviceAbbreviation)
}
// KeyringName creates a keyring name for a given service and cluster name
func KeyringName(serviceName string) string {
return generateName(serviceName, "keyring")
}
// KeyName creates a key name for a given service and cluster name
func KeyName(serviceName string) string {
return generateName(serviceName, "key")
}
// GcpServiceAccountSecretName builds the secret name where the GCP service account is stored
func GcpServiceAccountSecretName(serviceName string) string {
return generateName(serviceName, "gcp-sa")
}
func generateName(serviceName string, name string) string {
return fmt.Sprintf("%s-%s", serviceName, name)
}