roles

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 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, serviceAccountNamespace, serviceAccountName string,
	clusterType libsveltosv1beta1.ClusterType, kubeconfig []byte, owner client.Object) (*corev1.Secret, error)

CreateSecret returns the secret to be used to store kubeconfig for serviceAccountNamespace/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, serviceAccountNamespace, serviceAccountName string,
	clusterType libsveltosv1beta1.ClusterType, owner client.Object) error

DeleteSecret finds Secret used to store kubeconfig for serviceAccountNamespace/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, serviceAccountNamespace, serviceAccountName string,
	clusterType libsveltosv1beta1.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, serviceAccountNamespace, serviceAccountName string,
	clusterType libsveltosv1beta1.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 GetServiceAccountNameInManagedCluster added in v0.9.0

func GetServiceAccountNameInManagedCluster(namespace, name string) string

GetServiceAccountNameInManagedCluster given: -namespace -name of a ServiceAccount in the management cluster that created a Sveltos resource, returns the name of the ServiceAccount in the managed cluster.

func ListSecretForOwner added in v0.14.0

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

ListSecretForOwner returns all Secrets created for a specific RoleRequests.

func ListSecrets added in v0.14.0

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

ListSecrets returns all Secrets created for RoleRequests.

Types

This section is empty.

Jump to

Keyboard shortcuts

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