-
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
Add Node Name to the output of nomad job status (verbose only) and nomad alloc status #5224
Conversation
Currently when operators need to log onto a machine where an alloc is running they will need to perform both an alloc/job status call and then a call to discover the node name from the node list. This updates both the job status and alloc status output to include the node name within the information to make operator use easier. Closes #2359 Cloess #1180
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.
This lgtm after removing the duplicate assertion - nice work! I wouldn't block on switching to require, but it would be a nice improvement.
I think we do need you and @jrasell to sign the CLA before we can merge this though.
command/alloc_status_test.go
Outdated
@@ -141,6 +143,16 @@ func TestAllocStatusCommand_Run(t *testing.T) { | |||
t.Fatalf("expected to have 'Modified' but saw: %s", out) | |||
} | |||
|
|||
if !strings.Contains(out, "Modified") { |
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.
Accidental duplicate?
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.
Yes, thanks for pointing it out.
t.Fatalf("expected to have 'Modified' but saw: %s", out) | ||
} | ||
|
||
nodeNameRegexpStr := fmt.Sprintf(`\nNode Name\s+= %s\n`, regexp.QuoteMeta(nodeName)) |
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.
If you migrate this test to using require
, you can use require.Regexp(regexp.MustCompile(regexpStr), out)
, which provides a nicer error message here. (example in this test:
nomad/command/alloc_status_test.go
Lines 236 to 237 in 59dec15
require.Contains(out, "Replacement Alloc ID") | |
require.Regexp(regexp.MustCompile(".*Reschedule Attempts\\s*=\\s*1/2"), out) |
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.
Updated
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. |
Building on the work done by @jrasell in #4516 .
Closes #2359
Closes #1180
Closes #4516
The plan is to merge this into 0.9.1-dev, which I just checked out from the tip of master at this point in time. Changes to 0.9.1-dev will be merged into master, only after 0.9.0 is released.
Relevant snippets from the output: