clusteradmin

package
v1.239.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultNamespace is the namespace the cluster-admin-email secret lives in.
	DefaultNamespace = "codesphere"
	// DefaultSecretName is the name of the secret holding the cluster admin email.
	// It is referenced by the platform deployment via a secretKeyRef.
	DefaultSecretName = "cluster-admin-email"
	// EmailKey is the secret data key under which the admin email is stored.
	EmailKey = "email"
)

Variables

This section is empty.

Functions

func AddClusterAdmin

func AddClusterAdmin(ctx context.Context, clientset kubernetes.Interface, opts Opts) error

AddClusterAdmin writes the given email to the cluster-admin-email secret in the target cluster, creating the secret if it does not exist yet or updating it otherwise.

The email is stored under the EmailKey data key. Running the command again with a different email overwrites the previous value.

func NormalizeEmail added in v1.227.0

func NormalizeEmail(raw string) (string, error)

NormalizeEmail validates and canonicalizes an email address.

Types

type Opts

type Opts struct {
	Email      string
	Namespace  string
	SecretName string
	// CreateNamespace creates the target namespace if it does not exist yet
	// instead of failing. Used during installation, where the secret may be
	// written before the platform charts have created the namespace.
	CreateNamespace bool
}

Opts contains the options for adding a cluster admin.

Jump to

Keyboard shortcuts

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