Skip to content

Commit

Permalink
fix(zsh/alias.zsh): add missing quote to alias go-install-kind='go in…
Browse files Browse the repository at this point in the history
…stall sigs.k8s.io/kind@latest'

feat(zsh/openshift-functions.zsh): add function crc-start-version to validate and start CRC with specified version

Signed-off-by: Tiger Kaovilai <[email protected]>
  • Loading branch information
kaovilai committed Nov 12, 2024
1 parent 7bbb027 commit 2876a29
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion zsh/alias.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ alias velero-makecontainer-cluster-arch='make container IMAGE=$(ghcr_notag) VERS
alias velero-makecontainer-velero-restore-helper-cluster-arch='make container IMAGE=$(ghcr_notag) VERSION=velero-restore-helper-$(current-branch)-$(rev-sha-short)-$(cluster-arch-only) && docker push $(ghcr_notag):velero-restore-helper-$(current-branch)-$(rev-sha-short)-$(cluster-arch-only) && echo $(ghcr_notag):velero-restore-helper-$(current-branch)-$(rev-sha-short)-$(cluster-arch-only)'
alias source-zshrc='source ~/.zshrc'
alias listening-ports='lsof -i -P | grep LISTEN'
alias go-install-kind='go install sigs.k8s.io/kind@latest'
alias go-install-kind='go install sigs.k8s.io/kind@latest'
14 changes: 14 additions & 0 deletions zsh/openshift-functions.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,18 @@ znap function watchAllPodErrorsInNamespace(){
fi
# get all pod logs in namespace, grep for error, and prefix with pod name
oc get pods -n $1 -o name | xargs -n 1 -P 100 -I {} sh -c "oc logs -n $1 -f {} | grep --line-buffered error | sed \"s#^#{}: #\""
}

znap function crc-start-version(){
# check X.Y.Z version is specified
if [ -z "$1" ]; then
echo "No version supplied"
return 1
fi
# check version is semver
if ! [[ "$1" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Version $1 is not semver"
return 1
fi
crc stop; crc delete -f; crc cleanup; (cat Downloads/$1-crc.pkg >/dev/null || curl https://developers.redhat.com/content-gateway/file/pub/openshift-v4/clients/crc/$1/crc-macos-installer.pkg -L -o Downloads/$1-crc.pkg) && sudo installer -pkg Downloads/$1-crc.pkg -target LocalSystem && sw_vers && crc version && crc setup && crc start --log-level debug && crc status --log-level debug
}

0 comments on commit 2876a29

Please sign in to comment.