handle the case that failed on curl kube-ps1.sh #41
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I am Jun Wang, is taking training of apac2 IBM Cloud Native Boot Camp. By following the installation instructions in https://github.com/upslopeio/ibm-cloud-garage-training/blob/main/computer-setup/ibmcloud.md, me and some of classmates ran into a problem that kube-ps1.sh is not installed, even re-run the installation command multiple times.
I found the root cause is that the network is not stable enough for us to fetch file from GitHub, the command below sometimes failed with timeout:
curl -sLO https://raw.githubusercontent.com/jonmosco/kube-ps1/master/kube-ps1.sh
So, when we run https://github.com/cloud-native-toolkit/cloud-shell-commands/blob/main/assets/install-kube-ps1-zsh, the Kubernetes-ps1.sh is not downloaded because time out, but .zshrc is configured, so, when I re-run the installation script, it won't get chance to re-download.
My patch is to separate download file and config .zshrc, so that kube-ps1.sh can get chance to re-download.
The reason I split curl xxx && chmod xxx as two steps, is because one step way won't print anything if failed with time out, whereas my patch can print "chmod: kube-ps1.sh: No such file or directory" in the terminal which is helpful for debugging.
Thanks!
Jun