Skip to content

Commit

Permalink
bal
Browse files Browse the repository at this point in the history
  • Loading branch information
aerosouund committed Sep 11, 2024
1 parent 058c6ec commit f6f0ce0
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions cluster-provision/gocli/cmd/provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {} [email protected]:/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")
Expand All @@ -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 [email protected]:/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/* [email protected]:/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 {} [email protected]:/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
Expand Down

0 comments on commit f6f0ce0

Please sign in to comment.