Documentation
¶
Overview ¶
Package kubecfg builds *rest.Config instances using kubeconfig loading rules, honoring an optional kubeconfig context override. It is the shared REST config entry point for crossplane-diff commands so that every command consults the same kubeconfig the user's kubectl context points at, rather than preferring an in-cluster ServiceAccount when run inside a pod.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Provide ¶
Provide builds a *rest.Config using the provider's context.
Resolution order:
- Standard clientcmd loading rules ($KUBECONFIG, then $HOME/.kube/config).
- If the provider supplies a non-empty context, it overrides the kubeconfig's current-context.
- If no kubeconfig is available at all, fall back to the in-cluster ServiceAccount config and emit a warning to stderr.
This differs from controller-runtime's GetConfig, which prefers in-cluster first — that behavior causes `crossplane-diff` running inside a pod to ignore the user's kubeconfig context.
Types ¶
Click to show internal directories.
Click to hide internal directories.