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

[docker] Kubernetes support (new cgroups path) #1759

Merged
merged 1 commit into from
Jul 10, 2015

Conversation

degemer
Copy link
Member

@degemer degemer commented Jul 9, 2015

On Kubernetes, container files are directly at the top level of cgroups,
instead of being in a directory (docker or lxc).

Fixes #1748.

@degemer degemer added this to the 5.5.0 milestone Jul 9, 2015
@@ -422,6 +422,9 @@ def _find_cgroup_filename_pattern(self):
return os.path.join('%(mountpoint)s/docker/%(id)s/%(file)s')
elif os.path.exists(stat_file_path_coreos):
return os.path.join('%(mountpoint)s/system.slice/docker-%(id)s.scope/%(file)s')
# Kubernetes, we can't test the existence of the path without the id
else:
Copy link
Member

Choose a reason for hiding this comment

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

Not sure we want an else here since it acts as a default. An elif could be interesting too don't you think? This way if the path is not found because of a problem, we'll get an exception here instead of later in the execution.

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, it was a quick fix. 😞
I updated the PR, passing a container_id to _find_cgroup_filename_pattern to be able to test the path.

@degemer degemer force-pushed the quentin/kubernetes-docker branch from af76c8f to c7ced87 Compare July 9, 2015 19:54
@hkaj
Copy link
Member

hkaj commented Jul 9, 2015

lgtm

@degemer
Copy link
Member Author

degemer commented Jul 10, 2015

Merging then.

On Kubernetes, container files are directly at the top level of cgroups,
instead of being in a directory (`docker` or `lxc`).
@degemer degemer merged commit 1d70c72 into master Jul 10, 2015
@degemer degemer deleted the quentin/kubernetes-docker branch July 10, 2015 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants