Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Fix panic when setting odr env vars #3995

Merged
merged 2 commits into from
Oct 12, 2022
Merged

Conversation

izaaklauer
Copy link
Contributor

@izaaklauer izaaklauer commented Oct 5, 2022

Prior to this, assignment to the nil map would panic. E.x:

$ waypoint runner profile set -name=k8s -plugin-type=kubernetes -env-var=container=docker
❌ Updating runner profile "k8s" ("01GEMHHFSA3K6XXQR4Q0FVCKGJ")...
panic: assignment to entry in nil map

goroutine 1 [running]:
github.com/hashicorp/waypoint/internal/cli.(*RunnerProfileSetCommand).Run(0xc000246880, {0xc000311940, 0x6, 0xc})
	/Users/izaaklauer/dev/waypoint/internal/cli/runner_profile_set.go:231 +0x15e5
github.com/mitchellh/cli.(*CLI).Run(0xc00056a280)
	/Users/izaaklauer/go/pkg/mod/github.com/mitchellh/cli@v1.1.2/cli.go:262 +0x5f8
github.com/hashicorp/waypoint/internal/cli.Main({0xc000198000?, 0x3813f60?, 0xc0000021a0?})
	/Users/izaaklauer/dev/waypoint/internal/cli/main.go:127 +0x545
main.main()
	/Users/izaaklauer/dev/waypoint/cmd/waypoint/main.go:14 +0x7f

Prior to this, assignment to the nil map would panic. E.x:

```
$ ./waypoint runner profile set -name=k8s -plugin-type=kubernetes -default=true -oci-url=ghcr.io/hashicorp/waypoint/alpha-odr:latest -env-var=container=docker
❌ Updating runner profile "k8s" ("01GEMHHFSA3K6XXQR4Q0FVCKGJ")...
panic: assignment to entry in nil map

goroutine 1 [running]:
github.com/hashicorp/waypoint/internal/cli.(*RunnerProfileSetCommand).Run(0xc000246880, {0xc000311940, 0x6, 0xc})
	/Users/izaaklauer/dev/waypoint/internal/cli/runner_profile_set.go:231 +0x15e5
github.com/mitchellh/cli.(*CLI).Run(0xc00056a280)
	/Users/izaaklauer/go/pkg/mod/github.com/mitchellh/cli@v1.1.2/cli.go:262 +0x5f8
github.com/hashicorp/waypoint/internal/cli.Main({0xc000198000?, 0x3813f60?, 0xc0000021a0?})
	/Users/izaaklauer/dev/waypoint/internal/cli/main.go:127 +0x545
main.main()
	/Users/izaaklauer/dev/waypoint/cmd/waypoint/main.go:14 +0x7f
```
@izaaklauer izaaklauer marked this pull request as ready for review October 5, 2022 17:22
@github-actions github-actions bot added the core label Oct 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants