提交 70ab8a04 编写于 作者: D Dan Lorenc

Make string formatting explicit.

上级 e5d9602d
......@@ -145,7 +145,7 @@ type KubernetesConfig struct {
// StartCluster starts a k8s cluster on the specified Host.
func StartCluster(h sshAble, config KubernetesConfig) error {
output, err := h.RunSSHCommand(fmt.Sprintf(startCommand, config.LocalkubeURL))
output, err := h.RunSSHCommand(getStartCommand(config.LocalkubeURL))
log.Println(output)
if err != nil {
return err
......
package cluster
var startCommand = `
sudo killall localkube || true
import "fmt"
var startCommand = `sudo killall localkube || true
# Download and install localkube, if it doesn't exist yet.
if [ ! -e /usr/local/bin/localkube ]; then
sudo curl -L %s -o /usr/local/bin/localkube
......@@ -32,3 +33,7 @@ fi
# Run with nohup so it stays up. Redirect logs to useful places.
PATH=/usr/local/sbin:$PATH nohup sudo /usr/local/bin/localkube --containerized=false start > /var/log/localkube.out 2> /var/log/localkube.err < /dev/null &
`
func getStartCommand(localkubeURL string) string {
return fmt.Sprintf(startCommand, localkubeURL)
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册