Skip to content

Conversation

@CedArctic
Copy link

@CedArctic CedArctic commented Jan 22, 2026

This PR adds a whitelist feature for docker containers similar to that supported by the raw_cgroup_prefix_whitelist flag. The code is written in a way such that the same feature can be later added to other plugins (e.g podman, containerd etc).

Example use with Docker container IDs: --docker_id_prefix_whitelist=412a30bf29e6,82e3a4670a41,5f338e361e94

Summary of changes:

  • cmd/cadvisor.go: Added docker_id_prefix_whitelist flag. Create a whiteLists map that aggregates all whitelists and pass it to the manager constructor (New()).
  • manager/manager.go: Updated New() and manager{} to store the whiteLists map and pass it to the plugin initializer and the raw cgroups whitelist to raw.Register().
  • container/factory.go: Updated InitializePlugins() to use whiteLists for every plugin registration function.
  • container/*/plugin.go: Updated the plugin registration functions to receive the whitelists.
  • container/docker/factory.go: Stored whitelist in dockerFactory{}, and updated CanHandleAndAccept() to filter based on the whitelist. The whitelist feature can be enabled for other plugins by modifying their factory.go files the same way.

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.

1 participant