feat: add ability for users to specify alternative kubeconfig and kubecontext

This will provide the possibility for users to talk to existing kubernetes clusters, thereby removing one of the biggest reasons for having the old scheduler-kubernetes plugin around.
This commit is contained in:
Jose Diaz-Gonzalez
2024-02-14 03:50:15 -05:00
parent 7d85e213be
commit 72067fcfd2
8 changed files with 159 additions and 40 deletions

View File

@@ -75,7 +75,9 @@ func NewHelmAgent(namespace string, logger action.DebugLog) (*HelmAgent, error)
helmDriver = "secrets"
}
kubeConfig := kube.GetConfig(KubeConfigPath, "", namespace)
kubeconfigPath := getKubeconfigPath()
kubeContext := getKubeContext()
kubeConfig := kube.GetConfig(kubeconfigPath, kubeContext, namespace)
if err := actionConfig.Init(kubeConfig, namespace, helmDriver, logger); err != nil {
return nil, err
}