-
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
Changes from 3 commits
e1e019a
bdd3eeb
59dec15
de5386e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -120,9 +120,11 @@ func TestAllocStatusCommand_Run(t *testing.T) { | |||||
} | ||||||
// get an alloc id | ||||||
allocId1 := "" | ||||||
nodeName := "" | ||||||
if allocs, _, err := client.Jobs().Allocations(jobID, false, nil); err == nil { | ||||||
if len(allocs) > 0 { | ||||||
allocId1 = allocs[0].ID | ||||||
nodeName = allocs[0].NodeName | ||||||
} | ||||||
} | ||||||
if allocId1 == "" { | ||||||
|
@@ -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") { | ||||||
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 commentThe reason will be displayed to describe this comment to others. Learn more. If you migrate this test to using nomad/command/alloc_status_test.go Lines 236 to 237 in 59dec15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated |
||||||
nodeNameRegexp := regexp.MustCompile(nodeNameRegexpStr) | ||||||
if !nodeNameRegexp.MatchString(out) { | ||||||
t.Fatalf("expected to have 'Node Name' but saw: %s", out) | ||||||
} | ||||||
|
||||||
ui.OutputWriter.Reset() | ||||||
|
||||||
if code := cmd.Run([]string{"-address=" + url, "-verbose", allocId1}); code != 0 { | ||||||
|
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.