You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/api/kubernetes/cli/naming.go

27 lines
903 B

package cli
import "fmt"
const (
defaultNamespace = "default"
portainerNamespace = "portainer"
portainerUserCRName = "portainer-cr-user"
portainerUserCRBName = "portainer-crb-user"
portainerUserServiceAccountPrefix = "portainer-sa-user"
portainerRBPrefix = "portainer-rb"
portainerConfigMapName = "portainer-config"
portainerConfigMapAccessPoliciesKey = "NamespaceAccessPolicies"
)
func userServiceAccountName(userID int, username string) string {
return fmt.Sprintf("%s-%d-%s", portainerUserServiceAccountPrefix, userID, username)
}
func userServiceAccountTokenSecretName(serviceAccountName string) string {
return fmt.Sprintf("%s-secret", serviceAccountName)
}
func namespaceClusterRoleBindingName(namespace string) string {
return fmt.Sprintf("%s-%s", portainerRBPrefix, namespace)
}