roles

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSecret

func CreateSecret(ctx context.Context, c client.Client,
	clusterNamespace, clusterName, serviceAccountName string, clusterType sveltosv1alpha1.ClusterType,
	kubeconfig []byte, owner client.Object) (*corev1.Secret, error)

CreateSecret returns the secret to be used to store kubeconfig for serviceAccountName in cluster. It does create it if it does not exist yet. If Secret already exists, updates Data section if necessary (kubeconfig is different)

func DeleteSecret

func DeleteSecret(ctx context.Context, c client.Client, clusterNamespace, clusterName, serviceAccountName string,
	clusterType sveltosv1alpha1.ClusterType, owner client.Object) error

DeleteSecret finds Secret used to store kubeconfig for serviceAccountName in cluster. Removes owner as one of the OwnerReferences for secret. If no more OwnerReferences are left, deletes secret.

func GetKubeconfig

func GetKubeconfig(ctx context.Context, c client.Client,
	clusterNamespace, clusterName, serviceAccountName string, clusterType sveltosv1alpha1.ClusterType) ([]byte, error)

GetKubeconfig returns the kubeconfig for a given serviceAccount in a given cluster. Returns nil if kubeconfig is not found. Returns an error if any occurred.

func GetSecret

func GetSecret(ctx context.Context, c client.Client,
	clusterNamespace, clusterName, serviceAccountName string, clusterType sveltosv1alpha1.ClusterType) (*corev1.Secret, error)

GetSecret returns the secret to be used to store kubeconfig for serviceAccountName in cluster. It returns nil if it does not exist yet.

func ListSecretForOwnner

func ListSecretForOwnner(ctx context.Context, c client.Client, owner client.Object) ([]corev1.Secret, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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