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

Make --help work without environment variables set #68

Closed
invidian opened this issue Apr 17, 2020 · 2 comments · Fixed by #75
Closed

Make --help work without environment variables set #68

invidian opened this issue Apr 17, 2020 · 2 comments · Fixed by #75

Comments

@invidian
Copy link
Contributor

Currently running tink --help gives me not the nicest panic:

$ tink --help
{"level":"panic","ts":1587130851.119304,"caller":"rollbar/rollbar.go:20","msg":"required envvar is unset","service":"github.com/tinkerbell/tink","pkg":"log","envvar":"ROLLBAR_TOKEN"}
panic: required envvar is unset

goroutine 1 [running]:
go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc00049e2c0, 0xc0002afd80, 0x1, 0x2)
        /home/invidian/go/pkg/mod/go.uber.org/zap@v1.7.1/zapcore/entry.go:229 +0x547
go.uber.org/zap.(*SugaredLogger).log(0xc00028c398, 0x4, 0x55873649a79c, 0x18, 0x0, 0x0, 0x0, 0xc0003dfa58, 0x2, 0x2)
        /home/invidian/go/pkg/mod/go.uber.org/zap@v1.7.1/sugar.go:234 +0x102
go.uber.org/zap.(*SugaredLogger).Panicw(...)
        /home/invidian/go/pkg/mod/go.uber.org/zap@v1.7.1/sugar.go:204
github.com/packethost/pkg/log/internal/rollbar.Setup(0xc00028c398, 0x55873649bbe5, 0x1a, 0x2)
        /home/invidian/go/pkg/mod/github.com/packethost/pkg@v0.0.0-20190410153520-e8e15f4ce770/log/internal/rollbar/rollbar.go:20 +0x44d
github.com/packethost/pkg/log.configureLogger(0xc00040a780, 0x55873649bbe5, 0x1a, 0x55873648bace, 0x4, 0x55873648b4dc, 0x3, 0x55873648c9da, 0x5)
        /home/invidian/go/pkg/mod/github.com/packethost/pkg@v0.0.0-20190410153520-e8e15f4ce770/log/log.go:39 +0x26c
github.com/packethost/pkg/log.Init(0x55873649bbe5, 0x1a, 0x558736699a00, 0xc0002b1100, 0x100, 0x30, 0x30, 0xc0003eccc0)
        /home/invidian/go/pkg/mod/github.com/packethost/pkg@v0.0.0-20190410153520-e8e15f4ce770/log/log.go:73 +0x228
main.main()
        /home/invidian/go/pkg/mod/github.com/tinkerbell/tink@v0.0.0-20200414145942-43213ee31781/main.go:17 +0x6c
@invidian invidian changed the title Make --help work without envvar set Make --help work without environment variables set Apr 17, 2020
@alexellis
Copy link
Contributor

alexellis commented Apr 23, 2020

Turns out that the CLI itself has the same error behaviour:

root@ams1-c3:~/tink/cli/tink# ./tink  --help
2020/04/23 10:03:40 undefined TINKERBELL_CERT_URL

@alexellis
Copy link
Contributor

This code in init() causes the error, and should not be run unless there is a verb supplied:

	client.Setup()

cc @gauravgahlot

@gauravgahlot gauravgahlot linked a pull request Apr 23, 2020 that will close this issue
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 a pull request may close this issue.

2 participants