Skip to content

Commit 5713fe5

Browse files
fabianvfestroz
authored andcommitted
Set KUBECONFIG and K8S_AUTH_KUBECONFIG environment variables for runner (#817)
1 parent 7e70e36 commit 5713fe5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/ansible/runner/runner.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ func (r *runner) Run(ident string, u *unstructured.Unstructured, kubeconfig stri
216216
Parameters: r.makeParameters(u),
217217
EnvVars: map[string]string{
218218
"K8S_AUTH_KUBECONFIG": kubeconfig,
219+
"KUBECONFIG": kubeconfig,
219220
},
220221
Settings: map[string]string{
221222
"runner_http_url": receiver.SocketPath,
@@ -244,6 +245,7 @@ func (r *runner) Run(ident string, u *unstructured.Unstructured, kubeconfig stri
244245
} else {
245246
dc = r.cmdFunc(ident, inputDir.Path)
246247
}
248+
dc.Env = append(dc.Env, fmt.Sprintf("K8S_AUTH_KUBECONFIG=%s", kubeconfig), fmt.Sprintf("KUBECONFIG=%s", kubeconfig))
247249

248250
output, err := dc.CombinedOutput()
249251
if err != nil {

0 commit comments

Comments
 (0)