From 66fc699207bf256bf8a3d93288d6d293acb1a750 Mon Sep 17 00:00:00 2001 From: Somtochi Onyekwere Date: Thu, 23 Nov 2023 21:49:10 +0100 Subject: [PATCH] add better comment Signed-off-by: Somtochi Onyekwere --- pkg/bootstrap/bootstrap.go | 3 ++- pkg/bootstrap/bootstrap_test.go | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/bootstrap/bootstrap.go b/pkg/bootstrap/bootstrap.go index 5bedd1044a..0e2858d91f 100644 --- a/pkg/bootstrap/bootstrap.go +++ b/pkg/bootstrap/bootstrap.go @@ -185,7 +185,8 @@ type objectWithConditions interface { func objectReconciled(kube client.Client, objKey client.ObjectKey, clientObject objectWithConditions, expectRevision string) wait.ConditionWithContextFunc { return func(ctx context.Context) (bool, error) { - // for some reason, TypeMeta gets unset after kube.Get so we want to get the kind before that + // for some reason, TypeMeta gets unset after kube.Get so we want to store the GVK and set it after + // ref https://github.com/kubernetes-sigs/controller-runtime/issues/1517#issuecomment-844703142 gvk := clientObject.GetObjectKind().GroupVersionKind() if err := kube.Get(ctx, objKey, clientObject); err != nil { return false, err diff --git a/pkg/bootstrap/bootstrap_test.go b/pkg/bootstrap/bootstrap_test.go index 4ffea0132e..b27b49c8a9 100644 --- a/pkg/bootstrap/bootstrap_test.go +++ b/pkg/bootstrap/bootstrap_test.go @@ -162,6 +162,12 @@ func Test_objectReconciled(t *testing.T) { Namespace: "flux-system", }, }, + statuses: []updateStatus{ + { + expectedErr: false, + expectedBool: false, + }, + }, }, { name: "suspended Kustomization",