Skip to content

Commit

Permalink
Allow overriding secretKey for kubeadm kubeconfig
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
  • Loading branch information
kvaps committed Feb 5, 2024
1 parent 6123d9a commit 83ea282
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/utilities/tenant_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ func GetTenantKubeconfig(ctx context.Context, client client.Client, tenantContro
return nil, err
}

return DecodeKubeconfig(*secretKubeconfig, kubeadmconstants.SuperAdminKubeConfigFileName)
secretKey := kubeadmconstants.SuperAdminKubeConfigFileName
v, ok := tenantControlPlane.GetAnnotations()["kamaji.clastix.io/kubeconfig-secret-key"]
if ok && v != "" {
secretKey = v
}

return DecodeKubeconfig(*secretKubeconfig, secretKey)
}

func GetRESTClientConfig(ctx context.Context, client client.Client, tenantControlPlane *kamajiv1alpha1.TenantControlPlane) (*restclient.Config, error) {
Expand Down

0 comments on commit 83ea282

Please sign in to comment.