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

[Bug]: Panic on running the serve command #968

Closed
3 of 4 tasks
VaibhavMalik4187 opened this issue Feb 19, 2024 · 6 comments · Fixed by #969
Closed
3 of 4 tasks

[Bug]: Panic on running the serve command #968

VaibhavMalik4187 opened this issue Feb 19, 2024 · 6 comments · Fixed by #969

Comments

@VaibhavMalik4187
Copy link
Contributor

Checklist

  • I've searched for similar issues and couldn't find anything matching
  • I've included steps to reproduce the behavior

Affected Components

  • K8sGPT (CLI)
  • K8sGPT Operator

K8sGPT Version

No response

Kubernetes Version

No response

Host OS and its Version

Ubuntu 23.10

Steps to reproduce

  1. Run ./bin/k8sgpt serve

Expected behaviour

k8sgpt should run as a server.

Actual behaviour

k8sgpt panicked:
image

Additional Information

No response

@VaibhavMalik4187
Copy link
Contributor Author

@JuHyung-Son, I've opened this issue to track #966 (comment). Looks like this problem was introduces by f2138c7. I've not found the root cause of the problem just yet but a quick fix is to change:
ServeCmd.Flags().BoolVarP(&enableHttp, "http", "h", false, "Enable REST/http using gppc-gateway") to ServeCmd.Flags().BoolVarP(&enableHttp, "http", "", false, "Enable REST/http using gppc-gateway")

@VaibhavMalik4187
Copy link
Contributor Author

Looks like the shorthand h defined for the http flag is having problems because the help flag also uses h as the shorthand.

image

@JuHyung-Son
Copy link
Contributor

yes there should be proper replacement character

@VaibhavMalik4187
Copy link
Contributor Author

yes there should be proper replacement character

ServeCmd.Flags().BoolVarP(&enableHttp, "http", "H", false, "Enable REST/http using gppc-gateway") works fine.

@JuHyung-Son
Copy link
Contributor

hmm giving capital letter looks awkward. like first suggest, let`s just not set shorthand.

@VaibhavMalik4187
Copy link
Contributor Author

hmm giving capital letter looks awkward. like first suggest, let`s just not set shorthand.

Makes sense. I've opened a PR to address this issue.

VaibhavMalik4187 added a commit to VaibhavMalik4187/k8sgpt that referenced this issue Feb 19, 2024
Removed the shorthand for the `http` flag in the serve command because
it was contradicting with the shorthand of the `help` command which is
automatically added on execution if the `help` flag is not already
defined.

Fixes: k8sgpt-ai#968

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
AlexsJones pushed a commit that referenced this issue Feb 19, 2024
Removed the shorthand for the `http` flag in the serve command because
it was contradicting with the shorthand of the `help` command which is
automatically added on execution if the `help` flag is not already
defined.

Fixes: #968

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants