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 ListSecretForOwnner(ctx context.Context, c client.Client, owner client.Object) ([]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, 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.
Types ¶
This section is empty.