testuser

package
v1.31.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

package testuser handles creating a user within the cluster that can be used for authentication by the tests.

A ServiceAccount is created and associated with the `cluster-admin` ClusterRole. A Secret is created and linked to the ServiceAccount to ensure an API token is generated for the ServiceAccount. The details from this Secret is then used to template a new KubeConfig and build a new Kubernetes client that is then returned for use by the test suite from then onwards.

This approach is specifically required for clusters that use an `exec` auth method (such as EKS) that isn't possible within the test environment but should be used for all providers / clusters for consistency.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(ctx context.Context, kubeClient *client.Client) (*client.Client, error)

Create handles the creation of a ServiceAccount with cluster-admin permission within the cluster and generated a new Kubernetes client that authenticates as that account.

Types

This section is empty.

Jump to

Keyboard shortcuts

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