From 0201c2ba561ed87eadf458f44fc364542ffdb3db Mon Sep 17 00:00:00 2001 From: cristi Date: Mon, 9 Dec 2024 11:59:21 +0200 Subject: [PATCH] fix: write kubeconfig if not in deploying --- docs/CHANGELOG.md | 6 +++++- internal/controller/k8s/k8scluster/cluster.go | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 8c6c8803..46e532d4 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,9 @@ +## [1.1.7] +### Fixes: +- Write kubeconfig to k8s cluster, only if not in deploying state. + ## [1.1.6] -- **Chore**: +### Chore - Update crossplane-runtime to 1.18.0 ## [1.1.4] diff --git a/internal/controller/k8s/k8scluster/cluster.go b/internal/controller/k8s/k8scluster/cluster.go index ac01a5c5..66fd96ba 100644 --- a/internal/controller/k8s/k8scluster/cluster.go +++ b/internal/controller/k8s/k8scluster/cluster.go @@ -155,8 +155,8 @@ func (c *externalCluster) Observe(ctx context.Context, mg resource.Managed) (man if kubeconfig, _, err = c.service.GetKubeConfig(ctx, cr.Status.AtProvider.ClusterID); err != nil { c.log.Info(fmt.Sprintf("failed to get connection details. error: %v", err)) } + mo.ConnectionDetails = createKubernetesConnectionDetails(c, kubeconfig, mg) } - mo.ConnectionDetails = createKubernetesConnectionDetails(c, kubeconfig, mg) return mo, nil }