Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Em/fix analyzer check for node list #1679

Closed
wants to merge 2 commits into from
Closed
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
4 changes: 4 additions & 0 deletions pkg/analyze/collected_contents.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/pkg/errors"
"github.com/replicatedhq/troubleshoot/pkg/constants"
"github.com/replicatedhq/troubleshoot/pkg/types"
)

type collectedContent struct {
Expand Down Expand Up @@ -33,6 +34,9 @@ func retrieveCollectedContents(
// Local data not available, move to remote collection
nodeListContents, err := getCollectedFileContents(constants.NODE_LIST_FILE)
if err != nil {
if _, ok := err.(*types.NotFoundError); ok {
return collectedContents, nil
}
return nil, errors.Wrap(err, "failed to get node list")
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/analyze/collected_contents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func TestRetrieveCollectedContents(t *testing.T) {
remoteNodeBaseDir: "remoteBaseDir",
remoteFileName: "remoteFileName",
expectedResult: nil,
expectedError: "failed to get node list",
expectedError: "",
},
{
name: "fail to retrieve content for one of the nodes",
Expand Down
2 changes: 1 addition & 1 deletion pkg/supportbundle/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func getPodDetailsFromFiles(files map[string][]byte, podNamespace string, podNam

// GetFilesContents will return the file contents for filenames matching the filenames parameter.
func GetFilesContents(bundleArchive string, filenames []string) (map[string][]byte, error) {
bundleDir, err := ioutil.TempDir("", "troubleshoot")
bundleDir, err := os.MkdirTemp("", "troubleshoot")
if err != nil {
return nil, errors.Wrap(err, "failed to create tmp dir")
}
Expand Down
Loading