-
Notifications
You must be signed in to change notification settings - Fork 787
/
naming.go
32 lines (25 loc) · 1.15 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 vault
import "fmt"
// BucketName creates a Bucket name for a given vault name and cluster name
func BucketName(vaultName string, clusterName string) string {
return generatePrefix(vaultName, clusterName) + "bucket"
}
// ServiceAccountName creates a service account name for a given vault and cluster name
func ServiceAccountName(vaultName string, clusterName string) string {
return generatePrefix(vaultName, clusterName) + "sa"
}
// AuthServiceAccountName creates a service account name for a given vault and cluster name
func AuthServiceAccountName(vaultName string, clusterName string) string {
return generatePrefix(vaultName, clusterName) + "auth-sa"
}
// KeyringName creates a keyring name for a given vault and cluster name
func KeyringName(vaultName string, clusterName string) string {
return generatePrefix(vaultName, clusterName) + "keyring"
}
// KeyName creates a key name for a given vault and cluster name
func KeyName(vaultName string, clusterName string) string {
return generatePrefix(vaultName, clusterName) + "key"
}
func generatePrefix(vaultName string, clusterName string) string {
return fmt.Sprintf("%s-%s-", clusterName, vaultName)
}