Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ workflow:
steps:
pre:
- ref: ipi-install-rbac
- ref: openshift-configure-cincinnati
post:
- chain: gather
env:
CINCINNATI_URL: https://api.integration.openshift.com/api/upgrades_info/graph
CHANGE_CHANNEL_BASE: candidate
documentation: |-
This workflows perform shared pre/post actions on clusters obtained from
preinstalled pools (https://docs.ci.openshift.org/docs/architecture/ci-operator/#testing-with-a-cluster-from-a-cluster-pool).
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
approvers:
- petr-muller
- wking
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

set -o nounset
set -o errexit
set -o pipefail

echo "Setting the cluster to Cincinnati instance: $CINCINNATI_URL"
oc patch clusterversion version --patch '{"spec":{"upstream":"'"$CINCINNATI_URL"'"}}' --type=merge

if [[ ! "$CHANGE_CHANNEL_BASE" =~ (stable|eus|fast|candidate) ]]; then
echo "CHANGE_CHANNEL_BASE is '$CHANGE_CHANNEL_BASE' which is not one of stable, eus, fast, or candidate. Skipping channel update."
exit
fi

current_channel="$(oc get clusterversion version -o jsonpath='{.spec.channel}')"
if [[ "$current_channel" =~ (stable|eus|fast|candidate)-4\.([0-9]+) ]]; then
echo "Cluster is subscribed to channel: $current_channel"
desired_channel="${current_channel//${BASH_REMATCH[1]}/$CHANGE_CHANNEL_BASE}"
echo "Setting the cluster to use channel: $desired_channel instead of $current_channel"
oc adm upgrade channel "$desired_channel"
else
echo "Cluster is subscribed to '$current_channel' which is not a known version channel (stable|eus|fast|candidate)-4.Y. Skipping channel update."
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"path": "openshift/configure-cincinnati/openshift-configure-cincinnati-ref.yaml",
"owners": {
"approvers": [
"petr-muller",
"wking"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
ref:
as: openshift-configure-cincinnati
from: cli
commands: openshift-configure-cincinnati-commands.sh
timeout: 120s
resources:
requests:
cpu: 200m
memory: 500Mi
env:
- name: CINCINNATI_URL
default: https://api.openshift.com/api/upgrades_info/graph
documentation: "URL of the Cincinnati instance to use."
- name: CHANGE_CHANNEL_BASE
default: keep
documentation: "If a cluster has a channel set, and this parameter is set to one of 'stable', 'fast', 'candidate' or 'eus' then the cluster channel will be switched to the specified channel of the same version. No changes are done otherwise."
documentation: |-
Configure the cluster to use specified OpenShift Update Service (OSUS / Cincinnati) instance and optionally change the channel the cluster is subscribed to.