Skip to content

Refactor kubernetes client - #3

Open
bart0sh wants to merge 3 commits into
mainfrom
PR002-refactor-kubernetes-client
Open

bart0sh wants to merge 3 commits into
mainfrom
PR002-refactor-kubernetes-client

Conversation

@bart0sh

@bart0sh bart0sh commented Sep 14, 2026

Copy link
Copy Markdown
Owner

This PR is based on containers#536
It's a preparation PR for upcoming DRA integration PR containers#774

  • Move pkg/agent/watch to pkg/kubernetes/watch (plain rename) so kubernetes-related helpers live under a common package, ahead of adding a new client package there.
  • Add pkg/kubernetes/client: wraps REST config, HTTP client, and clientset construction (from a kubeconfig file or in-cluster config) behind a single Client type, so callers don't need to wire up all three separately.
  • Switch pkg/agent to use client.Client instead of its own hand-rolled REST config/HTTP client/clientset setup, dropping the now-redundant getRESTConfig helper and exposing the wrapped client, kubeconfig path, and REST config via new KubeClient/KubeConfig/RestConfig accessors.

Kubernetes-related helpers are being consolidated under
pkg/kubernetes so they can be shared beyond the agent. Move the
watch package there first, as a plain rename, ahead of adding the
new kubernetes client package.

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Add a pkg/kubernetes/client package that bundles the REST config,
HTTP client, and clientset construction (from a kubeconfig file or
in-cluster config) behind a single Client type, so callers no longer
need to wire up all three separately.

Not yet used by anything; pkg/agent will be switched over next.

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Replace the agent's hand-rolled REST config/HTTP client/clientset
setup with the new pkg/kubernetes/client wrapper. This also drops
the now-redundant getRESTConfig helper and exposes the wrapped
client, kubeconfig path, and REST config to callers via new
KubeClient/KubeConfig/RestConfig accessors.

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
@bart0sh
bart0sh force-pushed the PR002-refactor-kubernetes-client branch from 7f036c6 to ba5f16e Compare September 14, 2026 16:39
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