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

antctl.exe supportbundle command doesn't support path flag on Windows #6688

Open
XinShuYang opened this issue Sep 24, 2024 · 2 comments
Open
Assignees
Labels
area/OS/windows Issues or PRs related to the Windows operating system. kind/bug Categorizes issue or PR as related to a bug.

Comments

@XinShuYang
Copy link
Contributor

XinShuYang commented Sep 24, 2024

Describe the bug
In Windows, running antctl.exe supportbundle -d reports an error. The antctl tool is expected to support the -d (path) flag according to https://github.com/antrea-io/antrea/blob/main/docs/antctl.md#collecting-support-information, but it is not working on Windows.

To Reproduce

  1. Run the following command in Windows:
.\antctl.exe supportbundle -d C:\var\log\antrea\
  1. The following error is observed:
Error: unknown shorthand flag: 'd' in -d

Expected
The command should allow the user to specify a path to save the support bundle file on Windows using the -d flag.

Actual behavior
An error is thrown when trying to use the -d flag in Windows:
Error: unknown shorthand flag: 'd' in -d

Versions:
Antrea V2.1

@XinShuYang XinShuYang added area/OS/windows Issues or PRs related to the Windows operating system. kind/bug Categorizes issue or PR as related to a bug. labels Sep 24, 2024
@XinShuYang
Copy link
Contributor Author

Hi @luolanzone @rajnkamr, recently @wenyingd and I found two bugs with antctl on Windows(#6688 #6687). While they are not urgent, we believe they should be addressed eventually. Please feel free to assign them to anyone interested or needing familiarity with the antrea Windows/antctl modules. Thanks!

@XinShuYang
Copy link
Contributor Author

After investigation, I found supportbundle -d flag is only available outside pod in the controller mode.

} else if runtime.Mode == runtime.ModeController && !runtime.InPod {
. When this command is run in the pod, the -d flag is not supported, and the file is saved to a fixed path.
fmt.Fprintf(writer, "Created bundle under %s\n", os.TempDir())

On Windows, there is a slight difference. The reason why antctl supportbundle -d may still fail on a remote node is that if the server API token exists at the Windows path C:\var\run\antrea\apiserver, the current implementation sets InPod and agent mode to true. As the result, antctl supportbundle always saves the file to the fixed path in this mode.

if runtime.IsWindowsPlatform() && !InPod {
if _, err := os.Stat(apis.APIServerLoopbackTokenPath); err == nil {
InPod = true
Mode = ModeAgent
return
}
}

Perhaps we can discuss potential changes to the documentation to prevent misunderstandings. cc @luolanzone @wenyingd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/OS/windows Issues or PRs related to the Windows operating system. kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants