k8sclient

package
v0.0.0-...-73116f3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructRoleBindingName

func ConstructRoleBindingName(username, rolename, ns string) string

func CreateGroupRoleBinding

func CreateGroupRoleBinding(username, path, accessLevel string)

func CreateLimitRange

func CreateLimitRange(namespace string)

func CreateNamespace

func CreateNamespace(name string) string

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

func DeleteNamespace(originalName string) string

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

func GetActualNameSpaceNameByGitlabName(gitlabOriginName string) string

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 GetGroupRoleName(accessLevel string) string

func GetProjectRoleName

func GetProjectRoleName(accessLevel string) string

func GetRoleBindingsByNamespace

func GetRoleBindingsByNamespace(namespace string) map[string]bool

/ 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

func GitlabNameToK8sLabel(givenName string) (string, error)

func GitlabNameToK8sNamespace

func GitlabNameToK8sNamespace(givenName string) (string, error)

Types

type ServiceAccountInfo

type ServiceAccountInfo struct {
	Name      string
	Namespace string
	Token     string
}

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL