diff --git a/cluster-provision/gocli/cmd/provision.go b/cluster-provision/gocli/cmd/provision.go index 24f0bde6ef..64ec548b4e 100644 --- a/cluster-provision/gocli/cmd/provision.go +++ b/cluster-provision/gocli/cmd/provision.go @@ -255,6 +255,12 @@ func provisionCluster(cmd *cobra.Command, args []string) (retErr error) { return err } + // Copy scripts to the VM + err = _cmd(cli, nodeContainer(prefix, nodeName), `find /scripts/ -maxdepth 1 -type f -exec scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i vagrant.key -P 22 {} vagrant@192.168.66.101:/tmp \;`, "copying manifests to the VM") + if err != nil { + return err + } + envVars := fmt.Sprintf("version=%s slim=%t", version, slim) if strings.Contains(phases, "linux") { err := sshClient.Command("sudo " + envVars + " /bin/bash /scripts/provision.sh") @@ -268,25 +274,14 @@ func provisionCluster(cmd *cobra.Command, args []string) (retErr error) { if err != nil { return err } - err = _cmd(cli, nodeContainer(prefix, nodeName), "", "copying /scripts/extra-pre-pull-images if existing") - if err != nil { - return err - } err = _cmd(cli, nodeContainer(prefix, nodeName), "if [ -f /scripts/fetch-images.sh ]; then scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i vagrant.key -P 22 /scripts/fetch-images.sh vagrant@192.168.66.101:/tmp/fetch-images.sh; fi", "copying /scripts/fetch-images.sh if existing") if err != nil { return err } - err = _cmd(cli, nodeContainer(prefix, nodeName), "scp -r -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i vagrant.key -P 22 /scripts/manifests/* vagrant@192.168.66.101:/tmp", "copying manifests to the VM") if err != nil { return err } - - err = _cmd(cli, nodeContainer(prefix, nodeName), `find /scripts/ -maxdepth 1 -type f -exec scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i vagrant.key -P 22 {} vagrant@192.168.66.101:/tmp \;`, "copying manifests to the VM") - if err != nil { - return err - } - err = sshClient.Command("sudo " + envVars + " /bin/bash /tmp/k8s_provision.sh") if err != nil { return err