Skip to content

Commit

Permalink
Merge pull request #12 from mhrabovcin/abs-path-kubeconfig
Browse files Browse the repository at this point in the history
feat: print abspath to kubeconfig as env variable
  • Loading branch information
mhrabovcin authored Apr 27, 2023
2 parents 61b8fc5 + 58f98c1 commit 5946146
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func runServe(bundlePath string, o *serveOptions, out output.Output) error {
}

out.Infof("Running HTTPs proxy service on: %s", proxyHTTPAddress)
out.Infof("Kubeconfig path: %s", kubeconfigPath)
out.Infof("KUBECONFIG=%s", kubeconfigPath)

http.Handle("/", proxy.New(testEnv.Config, supportBundle, rewriter.Default()))
return http.ListenAndServe(o.proxyAddress, nil) //nolint:gosec // not a production server
Expand Down
7 changes: 6 additions & 1 deletion pkg/kubernetes/kubeconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ func WriteProxyKubeconfig(host, path string) (string, error) {
return "", err
}

return path, nil
absPath, err := filepath.Abs(path)
if err != nil {
return "", err
}

return absPath, nil
}

func restConfigToKubeconfig(rc *rest.Config, path string) error {
Expand Down

0 comments on commit 5946146

Please sign in to comment.