Skip to content

Commit

Permalink
workaround for amd certified operator in ocp < 4.16
Browse files Browse the repository at this point in the history
  • Loading branch information
bdattoma committed Dec 17, 2024
1 parent c0d5bfc commit 27d97ef
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions ods_ci/tasks/Resources/Provisioning/GPU/AMD/amd_operator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,32 @@ EOF
fi
}

function applyWorkaroundForOlderOCPVersions () {
# workaround for OCP versions less than 4.16
# AMD certified operator is published starting from OCP v4.16
ocpVersion=$(oc version --output json | jq '.openshiftVersion' | tr -d '"')
IFS='.' read -ra ocpVersionSplit <<< "$ocpVersion"
if [ "${ocpVersionSplit[1]}" -lt 16 ]; then
echo "OCP Version: $ocpVersion"
echo "AMD Operator is not available for versions < 4.16, hence creating custom catalog source as workaround"
oc apply -f - <<EOF
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: certified-operators-416-amd
namespace: openshift-marketplace
spec:
displayName: Certfied operator
image: 'registry.redhat.io/redhat/certified-operator-index:v4.16'
publisher: Model RHAOI
sourceType: grpc
EOF
oc wait --timeout="120s" --for=condition=ready=true pod -n openshift-marketplace -l olm.catalogSource=certified-operators-416-amd
sed -i'' -e "s/certified-operators/certified-operators-416-amd/g" "$GPU_INSTALL_DIR/amd_gpu_install.yaml"
fi
}

applyWorkaroundForOlderOCPVersions
check_registry
status=$?

Expand Down

0 comments on commit 27d97ef

Please sign in to comment.