test

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StringWithCharset

func StringWithCharset(length int, charset string) string

Types

type Environment

type Environment struct {
	GardenEnv  *gardenenvtest.GardenerTestEnvironment
	K8sManager ctrl.Manager
	Config     *rest.Config
	K8sClient  client.Client
}

func New

func New(mutator admission.Handler, validator admission.Handler) Environment

func (Environment) AddClusterAdminServiceAccount added in v0.31.0

func (e Environment) AddClusterAdminServiceAccount(ctx context.Context, name string, namespace string, timeout time.Duration, interval time.Duration)

AddClusterAdminServiceAccount adds a service account and creates a ClusterRoleBinding for this service account and cluster-admin ClusterRole.

func (Environment) AddServiceAccount added in v0.31.0

func (e Environment) AddServiceAccount(ctx context.Context, sa ServiceAccount, timeout time.Duration, interval time.Duration)

AddServiceAccount adds a service account and optionally also creates a ClusterRoleBinding for this service account for the given RoleRef of the passed ServiceAccount.

func (Environment) CreateObject added in v0.31.0

func (e Environment) CreateObject(ctx context.Context, obj client.Object, key types.NamespacedName, timeout time.Duration, interval time.Duration)

func (Environment) Start

func (e Environment) Start(ctx context.Context)

type ServiceAccount added in v0.31.0

type ServiceAccount struct {
	// Name is the service acocunt's Name.
	Name string
	// Namespace is the service acocunt's Namespace.
	Namespace string
	// RoleRef is the desired roleRef for the ClusterRoleBinding. The service account will receive this role
	// +optional
	RoleRef *rbacv1.RoleRef
}

ServiceAccount represents a Kubernetes service account.

type User added in v0.31.0

type User struct {
	Name string
	// Groups are the groups to which the user belongs.
	Groups []string
}

Jump to

Keyboard shortcuts

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