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: cli auth and error handling for flux tasks #2579

Merged
merged 1 commit into from
Jun 14, 2021
Merged

Conversation

lesam
Copy link
Contributor

@lesam lesam commented Jun 14, 2021

Closes #2578

Before:

➜ ./kapacitor -url http://steve:pas@localhost:9092 flux task list
undefined response type
➜ ./kapacitor -url http://steve:pass@localhost:9092 flux task list
undefined response type


After:

➜ ./kapacitor -url http://steve:pas@localhost:9092 flux task list
Error: authorization failed
➜ ./kapacitor -url http://steve:pass@localhost:9092 flux task list
ID Name Organization ID Organization Status Every Cron
079625bc3aeb8000 poster active 3s

Required for all non-trivial PRs
  • Rebased/mergable
  • Tests pass
  • CHANGELOG.md updated

@@ -555,13 +555,17 @@ func serveExpvar(w http.ResponseWriter, r *http.Request) {

// HttpError writes an error to the client in a standard format.
func HttpError(w http.ResponseWriter, err string, pretty bool, code int) {
w.Header().Set("Content-Type", "application/json")
Copy link
Contributor

Choose a reason for hiding this comment

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

This is unnecessary, there is something that is already taking care of this, and it collides with that.

Before:

➜  ./kapacitor -url http://steve:pas@localhost:9092 flux task list
undefined response type
➜  ./kapacitor -url http://steve:pass@localhost:9092 flux task list
undefined response type


After:

➜  ./kapacitor -url http://steve:pas@localhost:9092 flux task list
Error: authorization failed
➜  ./kapacitor -url http://steve:pass@localhost:9092 flux task list
ID                      Name    Organization ID Organization    Status  Every   Cron
079625bc3aeb8000        poster                                  active  3s
@docmerlin docmerlin merged commit 931e72a into master Jun 14, 2021
@docmerlin docmerlin deleted the fix-cli-flux-auth branch June 14, 2021 20:11
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.

Kapacitor cli does not handle authentication properly with flux tasks
2 participants