-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gscloud path gets hard-coded into kubectl config #10
Comments
@dennisjac thanks for opening the issue. We will work on it ASAP. |
As far as I can tell the current working directory is assumed to be the path to the package main
import (
"fmt"
"log"
"os"
"path/filepath"
)
func main() {
dir, err := filepath.Abs(filepath.Dir(os.Args[0]))
if err != nil {
log.Fatal(err)
}
absPath := fmt.Sprintf("%s%s%s", dir, string(os.PathSeparator), os.Args[0])
fmt.Println(absPath)
} Which results in something like ~/source/personal/go % go build -o test test.go && ./test
/Users/Stephan/source/personal/go/./test |
@ls42 I think @dennisjac meant that part of kubeconfig file:
|
Yes, that's true. But I think the issue is, that we assume the wrong directory as the path to the binary. @dennisjac seems to have the binary in /usr/local/bin, but we assume that it is in So in order to make a more robust solution, we should not assume that the binary is in the current working directory, but determine the absolute path to it and then write |
Couldn't we just assume that the binary is installed in $PATH and not write the path to gscloud in kubeconfig at all? |
ping |
Just an idea: How about storing the path of the gscloud binary in something like .cache/gscloud/path.env |
After setting up
kubectl
usinggscloud
kubectl
now complains that it cannot findgscloud
in/home/dennis/Downloads
for some reason (I copiedgscloud
to/usr/local/bin
):The problem seems to be that the path is hard-coded into the kubernetes config file as
command: /home/dennis/Dowloads/gscloud
. When I replace this withcommand: gscloud
thenkubectl
finds the copy in/usr/local/bin
and no longer throws an error.The text was updated successfully, but these errors were encountered: