Skip to content

Commit 6901190

Browse files
authored
Update NSS operator channel logic for CPFS 4.13 (#2530)
* Update NSS operator channel Signed-off-by: YuChen <[email protected]> * introduce a singleton channel for singleton services using only Signed-off-by: YuChen <[email protected]> --------- Signed-off-by: YuChen <[email protected]>
1 parent f5abe83 commit 6901190

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

cp3pt0-deployment/migrate_tenant.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ CONTROL_NS=""
2121
CHANNEL="v4.13"
2222
ODLM_CHANNEL="v4.5"
2323
MAINTAINED_CHANNEL="v4.2"
24+
SINGLETON_CHANNEL="v4.2"
2425
SOURCE="opencloud-operators"
2526
CERT_MANAGER_SOURCE="ibm-cert-manager-catalog"
2627
LICENSING_SOURCE="ibm-licensing-catalog"
@@ -85,7 +86,7 @@ function main() {
8586
arguments+=" --enable-private-catalog"
8687
fi
8788

88-
${BASE_DIR}/setup_singleton.sh "--operator-namespace" "$SERVICES_NS" "-c" "$MAINTAINED_CHANNEL" "--cert-manager-source" "$CERT_MANAGER_SOURCE" "--licensing-source" "$LICENSING_SOURCE" "--license-accept" $arguments "--yq" "$YQ" "--oc" "$OC"
89+
${BASE_DIR}/setup_singleton.sh "--operator-namespace" "$SERVICES_NS" "-c" "$SINGLETON_CHANNEL" "--cert-manager-source" "$CERT_MANAGER_SOURCE" "--licensing-source" "$LICENSING_SOURCE" "--license-accept" $arguments "--yq" "$YQ" "--oc" "$OC"
8990

9091
if [ $? -ne 0 ]; then
9192
error "Failed to migrate singleton services"
@@ -364,15 +365,21 @@ function pre_req() {
364365
error "Channel is not semantic vx.y"
365366
fi
366367

367-
# When Common Service channel info is less then maintained channel, update maintained channel for backward compatibility e.g., v4.1 and v4.0
368-
# Otherwise, maintained channel is pinned at v4.2
368+
# When Common Service channel is less than v4.2, maintained channel is the same as CS channel (e.g., v4.1 or v4.0)
369+
# When Common Service channel is between v4.2 and v4.12, maintained channel is pinned at v4.2
370+
# When Common Service channel is greater than v4.12, maintained channel is pinned at v4.3
371+
# The singleton channel follows the same rule as maintained channel for channels less than v4.2
372+
369373
IFS='.' read -r channel_major channel_minor <<< "${CHANNEL#v}"
370374
IFS='.' read -r maintained_major maintained_minor <<< "${MAINTAINED_CHANNEL#v}"
371375

372376
if (( channel_major < maintained_major )) || { (( channel_major == maintained_major )) && (( channel_minor < maintained_minor )); }; then
373377
MAINTAINED_CHANNEL="$CHANNEL"
378+
SINGLETON_CHANNEL="$CHANNEL"
379+
elif (( channel_major == 4 )) && (( channel_minor > 12 )); then
380+
MAINTAINED_CHANNEL="v4.3"
374381
fi
375-
382+
376383
# When Common Service channel is less than v4.5, use maintained channel for ODLM channel
377384
# When Common Service channel is between v4.5 and v4.10, use v4.3 for ODLM channel
378385
# When Common Service channel is v4.11, use v4.4 for ODLM channel

cp3pt0-deployment/setup_tenant.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,16 @@ function pre_req() {
264264
error "Must provide additional namespaces for --tethered-namespaces, different from operator-namespace and services-namespace"
265265
fi
266266

267-
# When Common Service channel info is less then maintained channel, update maintained channel for backward compatibility e.g., v4.1 and v4.0
268-
# Otherwise, maintained channel is pinned at v4.2
267+
# When Common Service channel is less than v4.2, maintained channel is the same as CS channel (e.g., v4.1 or v4.0)
268+
# When Common Service channel is between v4.2 and v4.12, maintained channel is pinned at v4.2
269+
# When Common Service channel is greater than v4.12, maintained channel is pinned at v4.3
269270
IFS='.' read -r channel_major channel_minor <<< "${CHANNEL#v}"
270271
IFS='.' read -r maintained_major maintained_minor <<< "${MAINTAINED_CHANNEL#v}"
271272

272273
if (( channel_major < maintained_major )) || { (( channel_major == maintained_major )) && (( channel_minor < maintained_minor )); }; then
273274
MAINTAINED_CHANNEL="$CHANNEL"
275+
elif (( channel_major == 4 )) && (( channel_minor > 12 )); then
276+
MAINTAINED_CHANNEL="v4.3"
274277
fi
275278

276279
# Check if the file path to the minimal RBAC permissions exists

0 commit comments

Comments
 (0)