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

Kubernetes authenticator fails with a misleading error #1182

Closed
micahlee opened this issue Sep 11, 2019 · 0 comments · Fixed by #1183
Closed

Kubernetes authenticator fails with a misleading error #1182

micahlee opened this issue Sep 11, 2019 · 0 comments · Fixed by #1183

Comments

@micahlee
Copy link
Contributor

micahlee commented Sep 11, 2019

Issue description

When the authenticating pod has no init containers, and the authenticator sidecar container doesn't have the expected name, then the authenticator fails with the internal error:

Authentication Error: #<NoMethodError: undefined method `find' for nil:NilClass>

This occurs in the lookup for the authenticator container because pod.spec.initContainers is nil:

def container
pod.spec.containers.find { |c| c.name == container_name } ||
pod.spec.initContainers.find { |c| c.name == container_name }
end

micahlee added a commit that referenced this issue Sep 11, 2019
Closes #1182

If `initContainers` or `containers` is not included in the deployment config for a pod, then the pod spec attributes for these are `nil` rather than an empty array.

This commit accounts for that possibility when searching for the authenticator containerby defaulting to an empty array if the value is `nil`. It also adds spec tests to verify this behavior.
jtuttle pushed a commit that referenced this issue Sep 11, 2019
Closes #1182

If `initContainers` or `containers` is not included in the deployment config for a pod, then the pod spec attributes for these are `nil` rather than an empty array.

This commit accounts for that possibility when searching for the authenticator containerby defaulting to an empty array if the value is `nil`. It also adds spec tests to verify this behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant