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

Fix Ceph collector file extension #298

Merged
merged 1 commit into from Nov 13, 2020
Merged

Fix Ceph collector file extension #298

merged 1 commit into from Nov 13, 2020

Conversation

emosbaugh
Copy link
Member

No description provided.

Copy link

@codelingo codelingo bot left a comment

Choose a reason for hiding this comment

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

2 issues found.

case strings.HasSuffix(filename, "-stderr.txt"):
final[path.Join(pathPrefix, fmt.Sprintf("%s-stderr.json", command.ID))] = result
final[path.Join(pathPrefix, fmt.Sprintf("%s-stderr.txt", command.ID))] = result
Copy link

Choose a reason for hiding this comment

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

path.Join only works for paths separated by forward slashes. Use filepath.Join instead.

View Rule

@@ -108,9 +117,9 @@ func cephCommandExec(ctx context.Context, c *Collector, cephCollector *troublesh
pathPrefix := GetCephCollectorFilepath(cephCollector.Name, cephCollector.Namespace)
switch {
case strings.HasSuffix(filename, "-stdout.txt"):
final[path.Join(pathPrefix, fmt.Sprintf("%s.json", command.ID))] = result
final[path.Join(pathPrefix, fmt.Sprintf("%s.%s", command.ID, command.Format))] = result
Copy link

Choose a reason for hiding this comment

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

path.Join only works for paths separated by forward slashes. Use filepath.Join instead.

View Rule

@emosbaugh emosbaugh merged commit 4cdfa5b into master Nov 13, 2020
@emosbaugh emosbaugh deleted the ceph-format branch November 13, 2020 20:17
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.

None yet

2 participants