Skip to content

Commit

Permalink
PR comments addressed; switched the env var to be consistent and scru…
Browse files Browse the repository at this point in the history
…nched monitor-adjacent hints a bit more
  • Loading branch information
philrenaud committed Jan 23, 2025
1 parent 5b5a482 commit 64f4796
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion command/deployment_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (c *DeploymentStatusCommand) Run(args []string) int {
if hint != "" {
c.Ui.Output(hint)
// Because this is before monitor, newline so we don't scrunch
c.Ui.Output("\n")
c.Ui.Output("")
}

return 0
Expand Down
2 changes: 1 addition & 1 deletion command/job_dispatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func (c *JobDispatchCommand) Run(args []string) int {
if hint != "" {
c.Ui.Output(hint)
// Because this is before monitor, newline so we don't scrunch
c.Ui.Output("\n")
c.Ui.Output("")
}
return mon.monitor(resp.EvalID)
}
2 changes: 1 addition & 1 deletion command/job_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ func (c *JobRunCommand) Run(args []string) int {
if hint != "" {
c.Ui.Output(hint)
// Because this is before monitor, newline so we don't scrunch
c.Ui.Output("\n")
c.Ui.Output("")
}

mon := newMonitor(c.Ui, client, length)
Expand Down
4 changes: 2 additions & 2 deletions command/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func (m *Meta) SetupUi(args []string) {
}

// Check to see if the user has disabled hints via env var.
showCLIHints := os.Getenv(EnvNomadShowCLIHints)
showCLIHints := os.Getenv(EnvNomadCLIShowHints)

Check failure on line 256 in command/meta.go

View workflow job for this annotation

GitHub Actions / checks

undefined: EnvNomadCLIShowHints (typecheck)

Check failure on line 256 in command/meta.go

View workflow job for this annotation

GitHub Actions / checks

undefined: EnvNomadCLIShowHints) (typecheck)

Check failure on line 256 in command/meta.go

View workflow job for this annotation

GitHub Actions / test-e2e-vault

undefined: EnvNomadCLIShowHints

Check failure on line 256 in command/meta.go

View workflow job for this annotation

GitHub Actions / test-windows

undefined: EnvNomadCLIShowHints

Check failure on line 256 in command/meta.go

View workflow job for this annotation

GitHub Actions / test-e2e-consul

undefined: EnvNomadCLIShowHints

Check failure on line 256 in command/meta.go

View workflow job for this annotation

GitHub Actions / checks / checks

undefined: EnvNomadCLIShowHints (typecheck)

Check failure on line 256 in command/meta.go

View workflow job for this annotation

GitHub Actions / checks / checks

undefined: EnvNomadCLIShowHints) (typecheck)
if showCLIHints == "false" {
m.showCLIHints = pointer.Of(false)
} else if showCLIHints == "true" {
Expand Down Expand Up @@ -612,7 +612,7 @@ func (m *Meta) uiHintsDisabled() bool {
}

agentConfig := agent.Config
agentUIConfig, ok := agentConfig["UI"].(map[string]interface{})
agentUIConfig, ok := agentConfig["UI"].(map[string]any)
if !ok {
return false
}
Expand Down
2 changes: 1 addition & 1 deletion command/meta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ func TestMeta_ShowUIPath_EnvVarOverride(t *testing.T) {

// Set environment variable
if tc.envValue != "" {
t.Setenv("NOMAD_SHOW_CLI_HINTS", tc.envValue)
t.Setenv("NOMAD_CLI_SHOW_HINTS", tc.envValue)
}

// Create a test server with UI enabled and CLI hints as per test case
Expand Down
2 changes: 1 addition & 1 deletion website/content/docs/commands/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ flags.

- `NOMAD_CLI_NO_COLOR` - Disables colored command output.

- `NOMAD_SHOW_CLI_HINTS` - Enables ui-hints in common CLI command output.
- `NOMAD_CLI_SHOW_HINTS` - Enables ui-hints in common CLI command output.

#### mTLS Environment Variables

Expand Down

0 comments on commit 64f4796

Please sign in to comment.