Merge pull request #137 from M3t0r/fix-127-0-0-1-not-replaced

Fix kubeconfig not pointing to correct host when using docker-machine
This commit is contained in:
Andy Zhou 2019-11-04 11:56:14 -08:00 committed by GitHub
commit 3fd1061e8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -161,6 +161,7 @@ func createKubeConfigFile(cluster string) error {
if apiHost != "" {
s := string(trimBytes)
s = strings.Replace(s, "localhost", apiHost, 1)
s = strings.Replace(s, "127.0.0.1", apiHost, 1)
trimBytes = []byte(s)
}
_, err = kubeconfigfile.Write(trimBytes)