Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changelog: Do not add to a nil map #252

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

jrajahalme
Copy link
Member

Initialize a nil map before writing to it.

From https://github.com/cilium/cilium/actions/runs/10349027982/job/28642554669:

panic: assignment to entry in nil map

goroutine 1 [running]:
github.com/cilium/release/cmd/changelog.(*ChangeLog).PrintReleaseNotesForWriter(0xc0005f6270, {0xb0e140, 0xc0003a4090})
/home/runner/work/cilium/release/cmd/changelog/generate.go:181 +0x170e
github.com/cilium/release/cmd/release.(*PrepareCommit).generateChangeLog(0xc000058128, {0xb12260, 0xc00007cb90}, 0xc0001e2b90)
/home/runner/work/cilium/release/cmd/release/git.go:244 +0x40c
github.com/cilium/release/cmd/release.(*PrepareCommit).Run(0xc000058128, {0xb12260, 0xc00007cb90}, 0x5f?, 0x25?, 0xc0001e2b90)
/home/runner/work/cilium/release/cmd/release/git.go:139 +0xc65
github.com/cilium/release/cmd/release.Command.func2(0xc000193208, {0xa39d47?, 0x4?, 0xa39d4b?})
/home/runner/work/cilium/release/cmd/release/start.go:288 +0x98c
github.com/spf13/cobra.(*Command).execute(0xc000193208, {0xc00011e840, 0xb, 0xb})
/home/runner/work/cilium/release/vendor/github.com/spf13/cobra/command.go:983 +0xaca
github.com/spf13/cobra.(*Command).ExecuteC(0xefc780)
/home/runner/work/cilium/release/vendor/github.com/spf13/cobra/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
/home/runner/work/cilium/release/vendor/github.com/spf13/cobra/command.go:1039
main.main()
/home/runner/work/cilium/release/cmd/main.go:115 +0x1a

Initialize a nil map before writing to it.

From https://github.com/cilium/cilium/actions/runs/10349027982/job/28642554669:

panic: assignment to entry in nil map

goroutine 1 [running]:
github.com/cilium/release/cmd/changelog.(*ChangeLog).PrintReleaseNotesForWriter(0xc0005f6270, {0xb0e140, 0xc0003a4090})
	/home/runner/work/cilium/release/cmd/changelog/generate.go:181 +0x170e
github.com/cilium/release/cmd/release.(*PrepareCommit).generateChangeLog(0xc000058128, {0xb12260, 0xc00007cb90}, 0xc0001e2b90)
	/home/runner/work/cilium/release/cmd/release/git.go:244 +0x40c
github.com/cilium/release/cmd/release.(*PrepareCommit).Run(0xc000058128, {0xb12260, 0xc00007cb90}, 0x5f?, 0x25?, 0xc0001e2b90)
	/home/runner/work/cilium/release/cmd/release/git.go:139 +0xc65
github.com/cilium/release/cmd/release.Command.func2(0xc000193208, {0xa39d47?, 0x4?, 0xa39d4b?})
	/home/runner/work/cilium/release/cmd/release/start.go:288 +0x98c
github.com/spf13/cobra.(*Command).execute(0xc000193208, {0xc00011e840, 0xb, 0xb})
	/home/runner/work/cilium/release/vendor/github.com/spf13/cobra/command.go:983 +0xaca
github.com/spf13/cobra.(*Command).ExecuteC(0xefc780)
	/home/runner/work/cilium/release/vendor/github.com/spf13/cobra/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/work/cilium/release/vendor/github.com/spf13/cobra/command.go:1039
main.main()
	/home/runner/work/cilium/release/cmd/main.go:115 +0x1a

Signed-off-by: Jarno Rajahalme <[email protected]>
@jrajahalme jrajahalme merged commit d6508f7 into main Aug 12, 2024
1 check passed
@jrajahalme jrajahalme deleted the pr/jrajahalme/init-map-before-write branch August 12, 2024 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant