Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Update-Strategy for the Subscription #723

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 38 additions & 13 deletions .rhdh/scripts/install-rhdh-catalog-source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ IS_OPENSHIFT=""
NAMESPACE_SUBSCRIPTION="rhdh-operator"
OLM_CHANNEL="fast"
UPSTREAM_IIB_OVERRIDE=""
INSTALL_PLAN_APPROVAL="Automatic"

function logf() {
set -euo pipefail
Expand Down Expand Up @@ -58,11 +59,12 @@ Usage:
$0 [OPTIONS]

Options:
-v 1.y : Install from iib quay.io/rhdh/iib:1.y-\$OCP_VER-\$OCP_ARCH (eg., 1.4-v4.14-x86_64)
--latest : Install from iib quay.io/rhdh/iib:latest-\$OCP_VER-\$OCP_ARCH (eg., latest-v4.14-x86_64) [default]
--next : Install from iib quay.io/rhdh/iib:next-\$OCP_VER-\$OCP_ARCH (eg., next-v4.14-x86_64)
--catalog-source : Install from specified catalog source, like brew.registry.redhat.io/rh-osbs/iib-pub-pending:v4.18
--install-operator <NAME> : Install operator named \$NAME after creating CatalogSource
-v 1.y : Install from iib quay.io/rhdh/iib:1.y-\$OCP_VER-\$OCP_ARCH (eg., 1.4-v4.14-x86_64)
--latest : Install from iib quay.io/rhdh/iib:latest-\$OCP_VER-\$OCP_ARCH (eg., latest-v4.14-x86_64) [default]
--next : Install from iib quay.io/rhdh/iib:next-\$OCP_VER-\$OCP_ARCH (eg., next-v4.14-x86_64)
--catalog-source : Install from specified catalog source, like brew.registry.redhat.io/rh-osbs/iib-pub-pending:v4.18
--install-operator <NAME> : Install operator named \$NAME after creating CatalogSource
--install-plan-approval <STRATEGY> : Specify the install plan strategy for the subscription (default: Automatic)

Examples:
$0 \\
Expand Down Expand Up @@ -689,17 +691,40 @@ TO_INSTALL=""
while [[ "$#" -gt 0 ]]; do
case $1 in
'--install-operator')
TO_INSTALL="$2"; shift 1;;
TO_INSTALL="$2"
shift 1
;;
'--next'|'--latest')
# if logged in, this should return something like latest-v4.12-x86_64 or next-v4.12-x86_64
IIB_TAG="${1/--/}-${OCP_VER}-$OCP_ARCH";;
IIB_TAG="${1/--/}-${OCP_VER}-$OCP_ARCH"
;;
'-v')
IIB_TAG="${2}-${OCP_VER}-$OCP_ARCH";
IIB_TAG="${2}-${OCP_VER}-$OCP_ARCH"
OLM_CHANNEL="fast-${2}"
shift 1;;
'--catalog-source') UPSTREAM_IIB_OVERRIDE="$2"; shift 1;;
'-h'|'--help') usage; exit 0;;
*) errorf "Unknown parameter is used: $1."; usage; exit 1;;
shift 1
;;
'--catalog-source')
UPSTREAM_IIB_OVERRIDE="$2"
shift 1
;;
'--install-plan-approval')
if [[ "$2" != "Manual" && "$2" != "Automatic" ]]; then
errorf "Unknown parameter used: $2. Must be Manual or Automatic."
usage
exit 1
fi
INSTALL_PLAN_APPROVAL="$2"
shift 1
;;
'-h'|'--help')
usage
exit 0
;;
*)
errorf "Unknown parameter is used: $1."
usage
exit 1
;;
esac
shift 1
done
Expand Down Expand Up @@ -821,7 +846,7 @@ metadata:
namespace: ${NAMESPACE_SUBSCRIPTION}
spec:
channel: $OLM_CHANNEL
installPlanApproval: Automatic
installPlanApproval: ${INSTALL_PLAN_APPROVAL}
name: ${OPERATOR_NAME_TO_INSTALL}
source: ${CATALOGSOURCE_NAME}
sourceNamespace: ${NAMESPACE_CATALOGSOURCE}
Expand Down
Loading