Azure / kubernetes-keyvault-flexvol

Azure keyvault integration with Kubernetes via a Flex Volume
MIT License
253 stars 83 forks source link

Fix error check when failed to get token #116

Closed aramase closed 4 years ago

aramase commented 4 years ago

Reason for Change:

Issue Fixed:

Fixes https://github.com/Azure/kubernetes-keyvault-flexvol/issues/115

Notes for Reviewers: When the error is nil in errors.Wrap the final out of errors.Wrap is nil. This issue existed in v0.0.10 as well, but was caught in the next step failing to get token to initialize the kv client. In v0.0.11 this became more evident as we also check if the vault url is not nil. So by wrapping the nil error and returning from getVaultURL() the err is nil (when it's not) and the vault url is nil because there was an error. Since that check was again wrapping an error which was nil, kubelet gets nil error and assumes a success.

ritazh commented 4 years ago

LGTM