Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/manifest/applier.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions internal/manifest/readiness.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/manifest/readiness_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down