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

"panic: assignment to entry in nil map" with 0.5.3 and master #116

Closed
cruwe opened this issue Oct 23, 2018 · 3 comments
Closed

"panic: assignment to entry in nil map" with 0.5.3 and master #116

cruwe opened this issue Oct 23, 2018 · 3 comments

Comments

@cruwe
Copy link

cruwe commented Oct 23, 2018

With 0.5.3 and master, I observe when calling via cmdline

g10k -cachedir=./tmp -puppetfile -verbose -tags 

or IntelliJ

GOROOT=/usr/lib/go-1.10 #gosetup
GOPATH=/home/cjr/media/src/go #gosetup
/usr/lib/go-1.10/bin/go build -o /tmp/___go_build_github_com_xorpaul_g10k -gcflags "all=-N -l" . #gosetup
/home/cjr/.IntelliJIdea2018.2/config/plugins/intellij-go/lib/dlv/linux/dlv --listen=localhost:46573 --headless=true --api-version=2 --backend=default exec /tmp/___go_build_github_com_xorpaul_g10k -- -puppetfile -cachedir=./tmp #gosetup
panic: assignment to entry in nil map

goroutine 119 [running]:
main.syncToModuleDir(0xc4203da5a0, 0x48, 0xc4203ee330, 0x10, 0xc42026e27c, 0x5, 0x0, 0x83c3e3, 0xc, 0x0)
	/home/cjr/media/src/go/src/github.com/xorpaul/g10k/git.go:165 +0x1270
main.resolvePuppetfile.func3(0xc420120fe0, 0xc4204ae0d0, 0xa, 0xc420472020, 0x839d51, 0x2, 0xc420472010, 0xc420270990, 0xc42026e21f, 0x5, ...)
	/home/cjr/media/src/go/src/github.com/xorpaul/g10k/puppetfile.go:330 +0xbd7
created by main.resolvePuppetfile
	/home/cjr/media/src/go/src/github.com/xorpaul/g10k/puppetfile.go:276 +0x19b5

I do not understand the intent of

if _, ok := needSyncEnvs[correspondingPuppetEnvironment]; !ok {
			needSyncEnvs[correspondingPuppetEnvironment] = struct{}{}
		}

I imagine that because I have no mapping of module branches to environments, ok == false, but after that, I am lost. Do I miss some braking change in invocation? Thanks and thanks for your work on g10k.

@xorpaul
Copy link
Owner

xorpaul commented Oct 24, 2018

The global map needSyncEnvs was not initialized when run in -puppetfile mode. I've overlooked this, because it doesn't make sense that there is more than 1 modified Puppet environment, when running in -puppetfile mode.

I fixed it in v0.5.4 https://github.com/xorpaul/g10k/releases/tag/v0.5.4

The intent of needSyncEnvs is to get a list of all modified Puppet environments, mainly for the postrun command, see #112 (comment)

@cruwe
Copy link
Author

cruwe commented Oct 24, 2018

Thank you!

@xorpaul
Copy link
Owner

xorpaul commented Oct 24, 2018

Thank you for pointing this out! 😏

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

No branches or pull requests

2 participants