Skip to content

Commit

Permalink
fix mkdir bug
Browse files Browse the repository at this point in the history
  • Loading branch information
fanux committed Apr 11, 2019
1 parent 91591ca commit 49112ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion install/sealos.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (s *SealosInstaller) InstallMaster0() {
output := Cmd(s.Masters[0], cmd)
s.decodeOutput(output)

cmd = `mkdir ~/.kube && cp /etc/kubernetes/admin.conf ~/.kube/config`
cmd = `mkdir -p ~/.kube && cp /etc/kubernetes/admin.conf ~/.kube/config`
output = Cmd(s.Masters[0], cmd)

cmd = `kubectl apply -f net/calico.yaml`
Expand Down
8 changes: 3 additions & 5 deletions install/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@ func Cmd(host string, cmd string) []byte {
defer session.Close()

b, err := session.CombinedOutput(cmd)
fmt.Println("\n\n exec command\n")
fmt.Println(host, " ", cmd)
fmt.Printf("%s\n\n", b)
if err != nil {
fmt.Println(" Error exec command failed", err)
return []byte{}
}

fmt.Println("\n\n exec command\n")
fmt.Println(host, " ", cmd)
fmt.Printf("%s\n\n", b)

return b
}

Expand Down

0 comments on commit 49112ca

Please sign in to comment.