Skip to content

Commit

Permalink
Fixed acces
Browse files Browse the repository at this point in the history
  • Loading branch information
fd committed May 4, 2016
1 parent 84880e3 commit ddb000f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmd/k8s/gcp_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package main

import (
"bytes"
"io/ioutil"
"os"
"path"
"text/template"

"golang.org/x/oauth2"
Expand All @@ -26,13 +28,11 @@ func gcpLogin(app *kingpin.Application, gcpProjectID, gcpZone, gkeCluster string
err = k8sConfigTmpl.Execute(&buf, cluster)
app.FatalIfError(err, "k8s")

buf.WriteTo(os.Stdout)
err = os.MkdirAll(path.Join(os.Getenv("HOME"), ".kube"), 0755)
app.FatalIfError(err, "k8s")

// err = os.MkdirAll(path.Join(os.Getenv("HOME"), ".kube"), 0755)
// app.FatalIfError(err, "k8s")
//
// err = ioutil.WriteFile(path.Join(os.Getenv("HOME"), ".kube/config"), buf.Bytes(), 0600)
// app.FatalIfError(err, "k8s")
err = ioutil.WriteFile(path.Join(os.Getenv("HOME"), ".kube/config"), buf.Bytes(), 0600)
app.FatalIfError(err, "k8s")
}

var k8sConfigTmpl = template.Must(template.New("").Parse(`
Expand Down

0 comments on commit ddb000f

Please sign in to comment.