Skip to content

Commit

Permalink
Squashed 'release-tools/' changes from f325590..204bc89
Browse files Browse the repository at this point in the history
kubernetes-csi/csi-release-tools@204bc89c Merge kubernetes-csi/csi-release-tools#158 from pohly/fix-deployment-selection
kubernetes-csi/csi-release-tools@61538bb7 prow.sh: more flexible CSI_PROW_DEPLOYMENT
kubernetes-csi/csi-release-tools@2b0e6db9 Merge kubernetes-csi/csi-release-tools#157 from humblec/csi-release
kubernetes-csi/csi-release-tools@a2fcd6de Adding myself to csi reviewers group

git-subtree-dir: release-tools
git-subtree-split: 204bc89
  • Loading branch information
pohly committed May 25, 2021
1 parent 76db306 commit a16c2f0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions KUBERNETES_CSI_OWNERS_ALIASES
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ aliases:
- chrishenzie
- ggriffiths
- gnufied
- humblec
- j-griffith
- Jiawei0227
- jingxu97
Expand Down
20 changes: 14 additions & 6 deletions prow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -654,22 +654,30 @@ delete_cluster_inside_prow_job() {
# Looks for the deployment as specified by CSI_PROW_DEPLOYMENT and CSI_PROW_KUBERNETES_VERSION
# in the given directory.
find_deployment () {
local dir file
local dir file k8sver
dir="$1"

# Fixed deployment name? Use it if it exists, otherwise fail.
# major/minor without release- prefix.
k8sver="$(echo "${CSI_PROW_KUBERNETES_VERSION}" | sed -e 's/\([0-9]*\)\.\([0-9]*\).*/\1.\2/' -e 's/^release-//')"

# Fixed deployment name? Use it if it exists.
if [ "${CSI_PROW_DEPLOYMENT}" ]; then
file="$dir/${CSI_PROW_DEPLOYMENT}/deploy.sh"
if ! [ -e "$file" ]; then
if [ -e "$file" ]; then
echo "$file"
return 0
fi

# CSI_PROW_DEPLOYMENT=kubernetes-x.yy is handled below with a fallback
# to kubernetes-latest. If it is something else, then fail here.
if ! echo "${CSI_PROW_DEPLOYMENT}" | grep -q "^kubernetes-${k8sver}\$"; then
return 1
fi
echo "$file"
return 0
fi

# Ignore: See if you can use ${variable//search/replace} instead.
# shellcheck disable=SC2001
file="$dir/kubernetes-$(echo "${CSI_PROW_KUBERNETES_VERSION}" | sed -e 's/\([0-9]*\)\.\([0-9]*\).*/\1.\2/')${CSI_PROW_DEPLOYMENT_SUFFIX}/deploy.sh"
file="$dir/kubernetes-${k8sver}${CSI_PROW_DEPLOYMENT_SUFFIX}/deploy.sh"
if ! [ -e "$file" ]; then
file="$dir/kubernetes-latest${CSI_PROW_DEPLOYMENT_SUFFIX}/deploy.sh"
if ! [ -e "$file" ]; then
Expand Down

0 comments on commit a16c2f0

Please sign in to comment.