roles

package
v0.0.49 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ClusterRoleName is the name of the ClusterRole created to allow the
	// servie account to deploy into different environments.
	ClusterRoleName = "pipelines-clusterrole"
)

Variables

This section is empty.

Functions

func AddSecretToSA

func AddSecretToSA(sa *corev1.ServiceAccount, secretName string) *corev1.ServiceAccount

AddSecretToSA grants the provided ServiceAccount access to the named secret.

func ClusterRoleBindingForSubjects

func ClusterRoleBindingForSubjects(name types.NamespacedName, roleKind, roleName string, subjects []v1rbac.Subject) *v1rbac.ClusterRoleBinding

ClusterRoleBindingForSubjects creates and returns a ClusterRoleBinding associating the subjects with the specified role.

func CreateClusterRole

func CreateClusterRole(name types.NamespacedName, policyRules []v1rbac.PolicyRule, opts ...clusterRoleOpts) *v1rbac.ClusterRole

CreateClusterRole creates and returns a ClusterRole given a name and policy rules.

func CreateClusterRoleBinding

func CreateClusterRoleBinding(name types.NamespacedName, sa *corev1.ServiceAccount, roleKind, roleName string) *v1rbac.ClusterRoleBinding

CreateClusterRoleBinding creates and returns a new ClusterRoleBinding associating the service account with a role.

func CreateRole

func CreateRole(name types.NamespacedName, policyRules []v1rbac.PolicyRule) *v1rbac.Role

CreateRole creates and returns a Role given a name and policyRules.

func CreateRoleBinding

func CreateRoleBinding(name types.NamespacedName, sa *corev1.ServiceAccount, roleKind, roleName string) *v1rbac.RoleBinding

CreateRoleBinding creates and returns a new RoleBinding given name, sa, roleKind, and roleName.

func CreateRoleBindingForSubjects

func CreateRoleBindingForSubjects(name types.NamespacedName, roleKind, roleName string, subjects []v1rbac.Subject) *v1rbac.RoleBinding

CreateRoleBindingForSubjects creates and returns a RoleBinding with multiple subjects.

func CreateServiceAccount

func CreateServiceAccount(name types.NamespacedName) *corev1.ServiceAccount

CreateServiceAccount creates and returns a new ServiceAccount in the provided namespace.

Types

This section is empty.

Jump to

Keyboard shortcuts

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