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

Run cluster-info in a collector pod #2

Merged
merged 1 commit into from
Jul 11, 2019
Merged

Conversation

marccampbell
Copy link
Member

No description provided.

}
}

if !alreadyReceived {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe?

if alreadyReceived {
    continue
}


decoded, err := base64.StdEncoding.DecodeString(string(body))
if err != nil {
return err
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about moving on to the next file if this fails


files := make(map[string][]byte)
if err := json.Unmarshal(decoded, &files); err != nil {
return err
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about moving on to the next file if this fails


paths := make([]string, 0, 0)
for _, id := range receivedCollectors {
paths = append(paths, filepath.Join(bundlePath, id))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if some errors are ignored, this should check if path exists

paths = append(paths, filepath.Join(bundlePath, id))
}

if err := tarGz.Archive(paths, "support-bundle.tar.gz"); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this overwrite existing bundle with the same name?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it will not . it errors with "support-bundle.tar.gz already exists".

} else {
for _, foundCollectorJob := range collectorJobs.Items {
if foundCollectorJob.Spec.Collector.Name == v.GetString("collectors") {
collectorJob = &foundCollectorJob
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

break here?

@marccampbell marccampbell merged commit 5e1893b into master Jul 11, 2019
@marccampbell marccampbell deleted the collector-job branch July 11, 2019 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants