Skip to content

Commit

Permalink
Job run command gets namespaces, and no longer gets ui hints for --ou…
Browse files Browse the repository at this point in the history
…tput flag
  • Loading branch information
philrenaud committed Dec 16, 2024
1 parent 6bbb350 commit 93d4d49
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
22 changes: 9 additions & 13 deletions command/job_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,17 +311,6 @@ func (c *JobRunCommand) Run(args []string) int {

c.Ui.Output(string(buf))

hint, _ := c.Meta.showUIPath(UIHintContext{
Command: "job run",
PathParams: map[string]string{
"jobID": *job.ID,
},
OpenURL: openURL,
})
if hint != "" {
c.Ui.Output(hint)
}

return 0
}

Expand Down Expand Up @@ -370,6 +359,11 @@ func (c *JobRunCommand) Run(args []string) int {

evalID := resp.EvalID

jobNamespace := c.Meta.namespace
if jobNamespace == "" {
jobNamespace = "default"
}

// Check if we should enter monitor mode
if detach || periodic || paramjob || multiregion {
c.Ui.Output("Job registration successful")
Expand All @@ -392,7 +386,8 @@ func (c *JobRunCommand) Run(args []string) int {
hint, _ := c.Meta.showUIPath(UIHintContext{
Command: "job run",
PathParams: map[string]string{
"jobID": *job.ID,
"jobID": *job.ID,
"namespace": jobNamespace,
},
OpenURL: openURL,
})
Expand All @@ -407,7 +402,8 @@ func (c *JobRunCommand) Run(args []string) int {
hint, _ := c.Meta.showUIPath(UIHintContext{
Command: "job run",
PathParams: map[string]string{
"jobID": *job.ID,
"jobID": *job.ID,
"namespace": jobNamespace,
},
OpenURL: openURL,
})
Expand Down
6 changes: 4 additions & 2 deletions command/job_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,8 @@ func (c *JobStatusCommand) Run(args []string) int {
hint, _ := c.Meta.showUIPath(UIHintContext{
Command: "job status single",
PathParams: map[string]string{
"jobID": *job.ID,
"jobID": *job.ID,
"namespace": *job.Namespace,
},
OpenURL: c.openURL,
})
Expand Down Expand Up @@ -325,7 +326,8 @@ func (c *JobStatusCommand) Run(args []string) int {
hint, _ := c.Meta.showUIPath(UIHintContext{
Command: "job status single",
PathParams: map[string]string{
"jobID": *job.ID,
"jobID": *job.ID,
"namespace": *job.Namespace,
},
OpenURL: c.openURL,
})
Expand Down
4 changes: 2 additions & 2 deletions command/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,11 +470,11 @@ var CommandUIRoutes = map[string]UIRoute{
Description: "View and manage Nomad jobs",
},
"job status single": {
Path: "/jobs/:jobID",
Path: "/jobs/:jobID@:namespace",
Description: "View job details and metrics",
},
"job run": {
Path: "/jobs/:jobID",
Path: "/jobs/:jobID@:namespace",
Description: "View this job",
},
"alloc status": {
Expand Down

0 comments on commit 93d4d49

Please sign in to comment.