Skip to content

Commit

Permalink
fix: installing bug on wsl in release 1.6 (#230)
Browse files Browse the repository at this point in the history
Co-authored-by: liuyu <>
  • Loading branch information
eball authored Jul 19, 2024
1 parent 40f8f06 commit c38b9a5
Showing 1 changed file with 35 additions and 8 deletions.
43 changes: 35 additions & 8 deletions build/installer/install_cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ precheck_os() {
if [ -d /opt/deps ]; then
ensure_success $sh_c "mv /opt/deps/* ${BASE_DIR}"
fi

}

is_debian() {
Expand Down Expand Up @@ -369,6 +370,16 @@ is_raspbian(){
fi
}

is_wsl(){
wsl=$(uname -a 2>&1)
if [[ ${wsl} == *WSL* ]]; then
echo 1
return
fi

echo 0
}

install_deps() {
case "$lsb_dist" in
ubuntu|debian|raspbian)
Expand Down Expand Up @@ -486,9 +497,7 @@ run_install() {
create_cmd+=" $extra"

# add env OS_LOCALIP
export OS_LOCALIP="$local_ip"

ensure_success $sh_c "$create_cmd"
ensure_success $sh_c "export OS_LOCALIP=$local_ip && $create_cmd"

log_info 'k8s and kubesphere installation is complete'

Expand Down Expand Up @@ -1201,12 +1210,12 @@ _check_velero_plugin_image_exists() {
install_velero() {
config_proxy_resolv_conf
VELERO_VERSION="v1.11.0"
VELERO_VERSION="v1.11.2"
local velero_tar="${BASE_DIR}/components/velero-${VELERO_VERSION}-linux-${ARCH}.tar.gz"
if [ -f "$velero_tar" ]; then
ensure_success $sh_c "cp ${velero_tar} velero-${VELERO_VERSION}-linux-${ARCH}.tar.gz"
else
ensure_success $sh_c "curl ${CURL_TRY} -k -sfLO https://github.com/vmware-tanzu/velero/releases/download/${VELERO_VERSION}/velero-${VELERO_VERSION}-linux-${ARCH}.tar.gz"
ensure_success $sh_c "curl ${CURL_TRY} -k -sfLO https://github.com/beclab/velero/releases/download/${VELERO_VERSION}/velero-${VELERO_VERSION}-linux-${ARCH}.tar.gz"
fi
ensure_success $sh_c "tar xf velero-${VELERO_VERSION}-linux-${ARCH}.tar.gz"
ensure_success $sh_c "install velero-${VELERO_VERSION}-linux-${ARCH}/velero /usr/local/bin"
Expand Down Expand Up @@ -1260,9 +1269,9 @@ install_velero_plugin_terminus() {
velero_plugin_install_cmd+=" --no-secret --plugins beclab/velero-plugin-for-terminus:$velero_plugin_ver"
velero_plugin_install_cmd+=" --velero-pod-cpu-request=50m --velero-pod-cpu-limit=500m"
velero_plugin_install_cmd+=" --node-agent-pod-cpu-request=50m --node-agent-pod-cpu-limit=500m"
velero_plugin_install_cmd+=" --wait"
velero_plugin_install_cmd+=" --wait --wait-minute 30"
ensure_success $sh_c "$velero_plugin_install_cmd"
velero_plugin_install_cmd="${VELERO} plugin add beclab/velero-plugin-for-terminus:$plugin -n os-system"
velero_plugin_install_cmd="${VELERO} plugin add beclab/velero-plugin-for-terminus:$velero_plugin_ver -n os-system"
msg=$($sh_c "$velero_plugin_install_cmd 2>&1")
fi
Expand Down Expand Up @@ -1438,6 +1447,10 @@ install_k8s_ks() {
log_info 'Installation wizard is complete\n'
if [[ $(is_wsl) -eq 1 ]]; then
PORT=30181
fi
# install complete
echo -e " Terminus is running at"
echo -e "${GREEN_LINE}"
Expand All @@ -1449,6 +1462,16 @@ install_k8s_ks() {
echo -e " Password: ${userpwd} "
echo -e " "
echo -e " Please change the default password after login."
if [[ $(is_wsl) -eq 1 ]]; then
echo -e " "
echo -e " "
echo -e " Press Ctrl-C to exit until initialized in Wizard."
echo -e " "
socat TCP-LISTEN:30181,fork,reuseaddr TCP4:${local_ip}:30180
fi
}
read_tty(){
Expand Down Expand Up @@ -2070,7 +2093,11 @@ Main() {
log_info 'Installing terminus ...\n'
config_proxy_resolv_conf
install_storage
if [[ $(is_wsl) -eq 0 ]]; then
install_storage
fi
install_k8s_ks
) 2>&1
Expand Down

0 comments on commit c38b9a5

Please sign in to comment.