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] catch errors from kubeutil init #3310

Merged
merged 1 commit into from
Apr 20, 2017

Conversation

hkaj
Copy link
Member

@hkaj hkaj commented Apr 19, 2017

Note: Please remember to review the Datadog Contribution Guidelines
if you have not yet done so.

What does this PR do?

Kubeutil raises an exception if it can't reach the kubelet. We should catch it.

Motivation

Ugly collector logs

Testing Guidelines

Run the agent on a non-k8s node, see that the exception is now caught.

Additional Notes

sister PR: DataDog/integrations-core#345

Copy link
Contributor

@masci masci left a comment

Choose a reason for hiding this comment

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

Left a small comment but it can go as it is

@@ -89,8 +89,11 @@ def __init__(self, agentConfig):

self.docker_client = DockerUtil(config_store=self.config_store).client
if Platform.is_k8s():
self.kubeutil = KubeUtil()
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: should we assign self.kubeutil = None in case the exception is raised, to avoid attribute errors later?

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually it could be an issue, we would have an error later accessing self.kubeutil

@hkaj hkaj force-pushed the haissam/catch-kubelet-error branch from 90a09aa to 9e9e967 Compare April 20, 2017 11:36
@hkaj hkaj merged commit a7d1031 into master Apr 20, 2017
@hkaj hkaj deleted the haissam/catch-kubelet-error branch April 20, 2017 13:41
@truthbk truthbk modified the milestones: 5.13.0, 5.13.1 Apr 20, 2017
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.

None yet

3 participants