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

[ipamd] throw an error on configuration validation failure #1698

Merged
merged 1 commit into from
Oct 25, 2021

Conversation

veshij
Copy link
Contributor

@veshij veshij commented Oct 20, 2021

What type of PR is this?: Bugfix

Which issue does this PR fix: N/A

What does this PR do / Why do we need it:: Existing implementation panics in case of config validation error since returned error value is nil.

If an issue # is not available please add repro steps and logs from IPAMD/CNI showing the issue:
Launch ipamd with no ipv* env variables set:

{"level":"debug","ts":"2021-10-20T03:42:42.546Z","caller":"ipamd/ipamd.go:2164","msg":"Instance hypervisor family nitro"}
{"level":"error","ts":"2021-10-20T03:42:42.546Z","caller":"ipamd/ipamd.go:399","msg":"IPv4 and IPv6 are both disabled. One of them have to be enabled"}
{"level":"info","ts":"2021-10-20T03:42:42.546Z","caller":"aws-k8s-agent/main.go:73","msg":"Serving RPC Handler version  on 127.0.0.1:50051"}
{"level":"info","ts":"2021-10-20T03:42:42.546Z","caller":"runtime/asm_amd64.s:1371","msg":"Serving metrics on port 61678"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x39 pc=0x19d2a26]

goroutine 497 [running]:
github.com/aws/amazon-vpc-cni-k8s/pkg/ipamd.(*IPAMContext).StartNodeIPPoolManager(0x0)
        go/src/github.com/aws/amazon-vpc-cni-k8s/pkg/ipamd/ipamd.go:633 +0x26
created by main._main
        go/src/github.com/aws/amazon-vpc-cni-k8s/cmd/aws-k8s-agent/main.go:64 +0x32c

Testing done on this change: Y

Will this break upgrades or downgrades. Has updating a running cluster been tested?: No. No.

Does this change require updates to the CNI daemonset config files to work?: No.

Does this PR introduce any user-facing change?: No.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@jayanthvn jayanthvn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks for the PR.

@veshij
Copy link
Contributor Author

veshij commented Oct 20, 2021

Is anything needed from me to merge this PR? Not sure why codeconv check is not happy.

@veshij
Copy link
Contributor Author

veshij commented Oct 22, 2021

Is anything needed from me to merge this PR? Not sure why codeconv check is not happy.

cc @jayanthvn

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.

3 participants