diff --git a/internal/manifest/applier.go b/internal/manifest/applier.go index 00e8b67..75524d7 100644 --- a/internal/manifest/applier.go +++ b/internal/manifest/applier.go @@ -75,7 +75,7 @@ func (a *applier) Apply(ctx context.Context, client ctrlruntimeclient.Client, ob return false, err } - if !HasCondition(current, conditionType) { + if !hasCondition(current, conditionType) { logger := a.objectLogger(ctx, object) logger.Debugw("Waiting for condition", "condition", conditionType) requeue = true diff --git a/internal/manifest/readiness.go b/internal/manifest/readiness.go index cb643d2..804bb68 100644 --- a/internal/manifest/readiness.go +++ b/internal/manifest/readiness.go @@ -20,9 +20,9 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ) -// HasCondition checks if an unstructured object has the specified condition +// hasCondition checks if an unstructured object has the specified condition // type with status "True". -func HasCondition(obj *unstructured.Unstructured, conditionType string) bool { +func hasCondition(obj *unstructured.Unstructured, conditionType string) bool { conditions, found, err := unstructured.NestedSlice(obj.Object, "status", "conditions") if err != nil || !found { return false diff --git a/internal/manifest/readiness_test.go b/internal/manifest/readiness_test.go index cf99f61..1b2ed0f 100644 --- a/internal/manifest/readiness_test.go +++ b/internal/manifest/readiness_test.go @@ -130,7 +130,7 @@ func TestHasCondition(t *testing.T) { for _, tt := range testcases { t.Run(tt.name, func(t *testing.T) { - result := HasCondition(tt.obj, tt.conditionType) + result := hasCondition(tt.obj, tt.conditionType) if result != tt.expected { t.Fatalf("Expected %v.", tt.expected) }