Skip to content

Commit

Permalink
Log a debug message when no resources are found
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Rodriguez committed Jan 8, 2024
1 parent 16cd18b commit 5aad4bf
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/pkg/utils/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"
"net"
"net/http"
"path/filepath"
"path"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -101,12 +101,10 @@ func ExecuteWait(waitTimeout, waitNamespace, condition, kind, identifier string,
continue
}

// If there was no identifier provided and no resources of the given kind were found,
// return an error. We don't want to return an error if an identifier
// was provided because the resource may be in the process of being created.
resourceNotFound := strings.Contains(stderr, "No resources found") && identifier == ""
if resourceNotFound {
return fmt.Errorf("unable to find resource of kind %q in the cluster", kind)
message.Debug(stdout, stderr, err)
continue
}

// If only checking for existence, exit here.
Expand Down

0 comments on commit 5aad4bf

Please sign in to comment.