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

sysdump: Fix writing to absolute path #1552

Merged
merged 1 commit into from
Apr 28, 2023

Conversation

pchaigno
Copy link
Member

Writing the sysdump to an absolute path doesn't work because we always append the current directory to the output filename:

$ ./cilium sysdump --output-filename /tmp/cilium-sysdump
[...]
✅ The sysdump has been saved to /home/paul/cilium-cli/tmp/cilium-sysdump.zip

Let's remove the code that does that.

Fixes: 77a1f23 ("sysdump: initial sysdump implementation")

@pchaigno pchaigno temporarily deployed to ci April 27, 2023 20:43 — with GitHub Actions Inactive
@pchaigno pchaigno marked this pull request as ready for review April 27, 2023 20:43
@pchaigno pchaigno requested a review from a team as a code owner April 27, 2023 20:43
@pchaigno pchaigno requested a review from joamaki April 27, 2023 20:43
Writing the sysdump to an absolute path doesn't work because we always
append the current directory to the output filename:

    $ ./cilium sysdump --output-filename /tmp/cilium-sysdump
    [...]
    ✅ The sysdump has been saved to /home/paul/cilium-cli/tmp/cilium-sysdump.zip

Let's remove the code that does that.

Fixes: 77a1f23 ("sysdump: initial sysdump implementation")
Signed-off-by: Paul Chaignon <paul@cilium.io>
@pchaigno pchaigno force-pushed the pr/pchaigno/sysdump-fix-absolute-paths branch from 688fa43 to 34e04a3 Compare April 27, 2023 21:02
@pchaigno pchaigno temporarily deployed to ci April 27, 2023 21:02 — with GitHub Actions Inactive
Copy link
Member

@tklauser tklauser left a comment

Choose a reason for hiding this comment

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

Running ./cilium sysdump --output-filename /tmp/cilium-sysdump built from this PR I get:

% ./cilium sysdump --output-filename /tmp/cilium-sysdump
🔍 Collecting sysdump with cilium-cli version: v0.14.0-2-g34e04a38017f, args: [sysdump --output-filename /tmp/cilium-sysdump]
[...]
✅ The sysdump has been saved to /tmp/cilium-sysdump.zip

I'd expect the file to be written to /tmp/cilium-sysdump/cilium-sysdump.zip though.

Copy link
Member

@tklauser tklauser left a comment

Choose a reason for hiding this comment

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

Sorry I was confused, never mind my previous comment, --output-filename should actually be the filename without extension:

      --output-filename string                        The name of the resulting file (without extension)
                                                      '<ts>' can be used as the placeholder for the timestamp (default "cilium-sysdump-<ts>")

@tklauser tklauser merged commit 7154a5d into main Apr 28, 2023
12 checks passed
@tklauser tklauser deleted the pr/pchaigno/sysdump-fix-absolute-paths branch April 28, 2023 08:50
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