-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cli: ensure -stale
flag is respected by nomad operator debug
#11678
Conversation
efec2e4
to
77dd8ed
Compare
77dd8ed
to
350949d
Compare
@@ -48,6 +47,7 @@ type OperatorDebugCommand struct { | |||
manifest []string | |||
ctx context.Context | |||
cancel context.CancelFunc | |||
opts *api.QueryOptions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for reviewers: I'm not wild about having it stuck in the OperatorDebugCommand
like this, but the command keeps around a lot of state here and untangling all that was more of a refactor than I wanted to do in this PR. I can come back and do some refactoring later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks OK. Something would need to be passed around regardless, and yeah, there's a lot going on in this command 😄
350949d
to
667e926
Compare
@@ -48,6 +47,7 @@ type OperatorDebugCommand struct { | |||
manifest []string | |||
ctx context.Context | |||
cancel context.CancelFunc | |||
opts *api.QueryOptions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks OK. Something would need to be passed around regardless, and yeah, there's a lot going on in this command 😄
When a cluster doesn't have a leader, the `nomad operator debug` command can safely use stale queries to gracefully degrade the consistency of almost all its queries. The query parameter for these API calls was not being set by the command. Some `api` package queries do not include `QueryOptions` because they target a specific agent, but they can potentially be forwarded to other agents. If there is no leader, these forwarded queries will fail. Provide methods to call these APIs with `QueryOptions`.
667e926
to
9f18222
Compare
) When a cluster doesn't have a leader, the `nomad operator debug` command can safely use stale queries to gracefully degrade the consistency of almost all its queries. The query parameter for these API calls was not being set by the command. Some `api` package queries do not include `QueryOptions` because they target a specific agent, but they can potentially be forwarded to other agents. If there is no leader, these forwarded queries will fail. Provide methods to call these APIs with `QueryOptions`.
) When a cluster doesn't have a leader, the `nomad operator debug` command can safely use stale queries to gracefully degrade the consistency of almost all its queries. The query parameter for these API calls was not being set by the command. Some `api` package queries do not include `QueryOptions` because they target a specific agent, but they can potentially be forwarded to other agents. If there is no leader, these forwarded queries will fail. Provide methods to call these APIs with `QueryOptions`.
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
Fixes #10767
When a cluster doesn't have a leader, the
nomad operator debug
command can safely use stale queries to gracefully degrade the
consistency of almost all its queries. The query parameter for these
API calls was not being set by the command.
Some
api
package queries do not includeQueryOptions
becausethey target a specific agent, but they can potentially be forwarded to
other agents. If there is no leader, these forwarded queries will
fail. Provide methods to call these APIs with
QueryOptions
.