Skip to content

Commit

Permalink
remove script copying
Browse files Browse the repository at this point in the history
Signed-off-by: aerosouund <[email protected]>
  • Loading branch information
aerosouund committed Oct 30, 2024
2 parents f65ea11 + 4c3b288 commit 361171e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 51 deletions.
22 changes: 1 addition & 21 deletions cluster-provision/gocli/opts/k8sprovision/conf/k8s_provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function pull_container_retry() {
fi
}

export CRIO_VERSION=1.30
export CRIO_VERSION="$(echo $version | cut -d. -f1).$(echo $version | cut -d. -f2)"
cat << EOF >/etc/yum.repos.d/devel_kubic_libcontainers_stable_cri-o_${CRIO_VERSION}.repo
[isv_kubernetes_addons_cri-o_stable_v${CRIO_VERSION}]
name=CRI-O v${CRIO_VERSION} (Stable) (rpm)
Expand Down Expand Up @@ -345,26 +345,6 @@ chmod -R 777 /var/local/kubevirt-storage/local-volume
# Setup selinux permissions to local volume directories.
chcon -R unconfined_u:object_r:svirt_sandbox_file_t:s0 /mnt/local-storage/

# copy network addons operator manifests
# so we can use them at cluster-up
cp -rf /tmp/cnao/ /opt/

# copy whereabouts manifests
# so we can use them at cluster-up
cp -rf /tmp/whereabouts/ /opt/

# copy Multus CNI manifests so we can use them at cluster-up
cp -rf /tmp/multus /opt/

# copy cdi manifests
cp -rf /tmp/cdi*.yaml /opt/

# copy aaq manifests
cp -rf /tmp/aaq/ /opt/

# copy kwok manifests
cp -rf /tmp/kwok /opt/

# Create a properly labelled tmp directory for testing
mkdir -p /var/provision/kubevirt.io/tests
chcon -t container_file_t /var/provision/kubevirt.io/tests
Expand Down
30 changes: 0 additions & 30 deletions cluster-provision/gocli/providers/provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,40 +160,10 @@ func (kp *KubevirtProvider) Provision(ctx context.Context, cancel context.Cancel
return fmt.Errorf("error copying manifests to node")
}

success, err = docker.Exec(kp.Docker, kp.nodeContainer(kp.Version, nodeName), []string{"/bin/bash", "-c", "scp -r -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i vagrant.key -P 22 /scripts/k8s_provision.sh [email protected]:/tmp/k8s_provision.sh"}, os.Stdout)
if err != nil {
return err
}

if !success {
return fmt.Errorf("error copying manifests to node")
}

success, err = docker.Exec(kp.Docker, kp.nodeContainer(kp.Version, nodeName), []string{"/bin/bash", "-c", "if [ -f /scripts/extra-pre-pull-images ]; then scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i vagrant.key -P 22 /scripts/extra-pre-pull-images [email protected]:/tmp/extra-pre-pull-images; fi"}, os.Stdout)
if err != nil {
return err
}

if !success {
return fmt.Errorf("error copying manifests to node")
}

success, err = docker.Exec(kp.Docker, kp.nodeContainer(kp.Version, nodeName), []string{"/bin/bash", "-c", "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"}, os.Stdout)
if err != nil {
return err
}

if !success {
return fmt.Errorf("error copying manifests to node")
}

provisionK8sOpt := k8sprovision.NewK8sProvisioner(sshClient, k8sVersion, kp.Slim)
if err = provisionK8sOpt.Exec(); err != nil {
return err
}
// if err = sshClient.Command(fmt.Sprintf("sudo version=%s bash /tmp/k8s_provision.sh", k8sVersion)); err != nil {
// return err
// }
}

_ = sshClient.Command("sudo shutdown now -h")
Expand Down

0 comments on commit 361171e

Please sign in to comment.