Documentation ¶
Index ¶
- func CreateSecret(ctx context.Context, c client.Client, ...) (*corev1.Secret, error)
- func DeleteSecret(ctx context.Context, c client.Client, ...) error
- func GetKubeconfig(ctx context.Context, c client.Client, ...) ([]byte, error)
- func GetSecret(ctx context.Context, c client.Client, ...) (*corev1.Secret, error)
- func GetServiceAccountNameInManagedCluster(namespace, name string) string
- func ListSecretForOwner(ctx context.Context, c client.Client, owner client.Object) ([]corev1.Secret, error)
- func ListSecrets(ctx context.Context, c client.Client) ([]corev1.Secret, error)
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 sveltosv1alpha1.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 sveltosv1alpha1.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 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, serviceAccountNamespace, 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 GetServiceAccountNameInManagedCluster ¶ added in v0.9.0
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.
Types ¶
This section is empty.