Skip to content

Commit

Permalink
Backport of cli: fix panic on job plan when -diff=false into release/…
Browse files Browse the repository at this point in the history
…1.5.x (#16951)

This pull request was automerged via backport-assistant
  • Loading branch information
hc-github-team-nomad-core authored Apr 21, 2023
1 parent 54394b0 commit 089e09f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .changelog/16944.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
cli: Fix panic on job plan when -diff=false
```
6 changes: 3 additions & 3 deletions command/job_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ func (c *JobPlanCommand) Run(args []string) int {
}

// Setup the options
opts := &api.PlanOptions{}
if diff {
opts.Diff = true
opts := &api.PlanOptions{
// Always request the diff so we can tell if there are changes.
Diff: true,
}
if policyOverride {
opts.PolicyOverride = true
Expand Down

0 comments on commit 089e09f

Please sign in to comment.