Skip to content

status: Panic when calling status command with namespace wildcard #827

@jrasell

Description

@jrasell

The CLI panics when attempting to use the wildcard namespace identifier with the status command:

$ nomad-pack status --namespace='*'

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x10 pc=0x101c9e5b8]

goroutine 1 [running]:
github.com/hashicorp/nomad-pack/internal/cli.getDeployedPacks(0x140004f9b48?)
        /Users/jrasell/Projects/Go/nomad-pack/internal/cli/helpers.go:307 +0x268
github.com/hashicorp/nomad-pack/internal/cli.(*StatusCommand).renderAllDeployedPacks(0x14000482690, 0x101d14ee7?, 0x14000067cd0)
        /Users/jrasell/Projects/Go/nomad-pack/internal/cli/status.go:87 +0x30
github.com/hashicorp/nomad-pack/internal/cli.(*StatusCommand).Run(0x14000482690, {0x14000112080?, 0x1022c4900?, 0x0?})
        /Users/jrasell/Projects/Go/nomad-pack/internal/cli/status.go:53 +0x1f4
github.com/mitchellh/cli.(*CLI).Run(0x1400047ec80)
        /Users/jrasell/go/pkg/mod/github.com/mitchellh/cli@v1.1.5/cli.go:262 +0x420
github.com/hashicorp/nomad-pack/internal/cli.Main({0x14000112060, 0x3, 0x3})
        /Users/jrasell/Projects/Go/nomad-pack/internal/cli/main.go:98 +0x228
main.main()
        /Users/jrasell/Projects/Go/nomad-pack/main.go:15 +0x80

Reproduction:

  1. run a Nomad development agent
  2. deploy a pack: nomad-pack run fabio
  3. attempt to use the status cli command: nomad-pack status --namespace='*'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions