use the latest point release for upgrades
@@ -51,9 +51,18 @@ readonly PRE_INSTALL_V016="config/pre-install/v0.16.0"
# Should deploy a Knative Monitoring as well
readonly DEPLOY_KNATIVE_MONITORING="${DEPLOY_KNATIVE_MONITORING:-1}"
+
+latest_version() {
+ local semver=$(git describe --match "v[0-9]*" --abbrev=0)
+ local major_minor=$(echo "$semver" | cut -d. -f1-2)
+
+ # Get the latest patch release for the major minor
+ git tag -l "${major_minor}*" | sort -r --version-sort | head -n1
+}
+
# Latest release. If user does not supply this as a flag, the latest
# tagged release on the current branch will be used.
-readonly LATEST_RELEASE_VERSION=$(git describe --match "v[0-9]*" --abbrev=0)
+readonly LATEST_RELEASE_VERSION=$(latest_version)
UNINSTALL_LIST=()
