Documentation ¶
Index ¶
- func ConstructRoleBindingName(username, rolename, ns string) string
- func CreateGroupRoleBinding(username, path, accessLevel string)
- func CreateLimitRange(namespace string)
- func CreateNamespace(name string) string
- func CreateProjectRoleBinding(username, path, accessLevel string)
- func DeleteGroupRoleBinding(username, path, accessLevel string)
- func DeleteGroupRoleBindingByName(roleBindingName, actualNamespace string)
- func DeleteNamespace(originalName string) string
- func DeleteProjectRoleBinding(username, path, accessLevel string)
- func DeleteProjectRoleBindingByName(roleBindingName, actualNamespace string)
- func DeployAdditionalServiceAccounts(namespace string)
- func DeployCEPHSecretUser(namespace string)
- func GetActualNameSpaceNameByGitlabName(gitlabOriginName string) string
- func GetAllGitlabOriginNamesFromNamespacesWithOriginLabel() []string
- func GetGroupRoleName(accessLevel string) string
- func GetProjectRoleName(accessLevel string) string
- func GetRoleBindingsByNamespace(namespace string) map[string]bool
- func GitlabNameToK8sLabel(givenName string) (string, error)
- func GitlabNameToK8sNamespace(givenName string) (string, error)
- type ServiceAccountInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateGroupRoleBinding ¶
func CreateGroupRoleBinding(username, path, accessLevel string)
func CreateLimitRange ¶
func CreateLimitRange(namespace string)
func CreateNamespace ¶
CreateNamespace creates a namespace. It checks if that namespace has already been created by either CreateProjectRoleBinding or CreateGroupRoleBinding. This has been implemented due to the asynchronous manner in which the webhook calls might be received. GetActualNameSpaceNameByGitlabName checks for the origin label field, so it only finds the namespace if it's the correct one.
func CreateProjectRoleBinding ¶
func CreateProjectRoleBinding(username, path, accessLevel string)
func DeleteGroupRoleBinding ¶
func DeleteGroupRoleBinding(username, path, accessLevel string)
func DeleteGroupRoleBindingByName ¶
func DeleteGroupRoleBindingByName(roleBindingName, actualNamespace string)
func DeleteNamespace ¶
DeleteNamespace deletes a namespace by its originalName
func DeleteProjectRoleBinding ¶
func DeleteProjectRoleBinding(username, path, accessLevel string)
func DeleteProjectRoleBindingByName ¶
func DeleteProjectRoleBindingByName(roleBindingName, actualNamespace string)
func DeployAdditionalServiceAccounts ¶
func DeployAdditionalServiceAccounts(namespace string)
func DeployCEPHSecretUser ¶
func DeployCEPHSecretUser(namespace string)
func GetActualNameSpaceNameByGitlabName ¶
GetActualNameSpaceNameByGitlabName looks for the original name from gitlab in the gitlab-origin labels of namespaces and returns the given namespace name in the K8s cluster or an empty string if namespace has not been found
func GetAllGitlabOriginNamesFromNamespacesWithOriginLabel ¶
func GetAllGitlabOriginNamesFromNamespacesWithOriginLabel() []string
func GetGroupRoleName ¶
func GetProjectRoleName ¶
func GetRoleBindingsByNamespace ¶
/ GetRoleBindingsByNamespace retrieves the rolebindings present in K8s for the provided namespace / the namespace parameter is assumed to be the real namespace name in k8s!
func GitlabNameToK8sLabel ¶
Types ¶
type ServiceAccountInfo ¶
func CreateServiceAccountAndRoleBinding ¶
func CreateServiceAccountAndRoleBinding(fullProjectPath string) (ServiceAccountInfo, string, error)
CreateServiceAccountAndRoleBinding creates a ServiceAccount and a RoleBinding for it to use it. If either of the two already exists, it will instead return their information to the caller returns (InfoAboutServiceAccount, RoleBindingName, error)