Skip to content

Commit 072c1cd

Browse files
Merge pull request #1301 from rhamini3/enhance-images
NE-1334: Enhancement to add operator channel when creating gatewayclass
2 parents 0cac97a + 389ab58 commit 072c1cd

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

hack/test-pre-release-ossm-images.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,18 +151,22 @@ fi
151151
CUSTOM_CATALOG_SOURCE=custom-istio-catalog
152152
TRIES=0
153153
while (( TRIES < MAX_TRIES )); do
154-
OSSM_VERSION=$(oc get packagemanifests -n openshift-marketplace -o json | jq -r '.items[] | select(.metadata.labels.catalog=="custom-istio-catalog") | .status.channels[] | select(.currentCSV | contains("servicemeshoperator3")) | .currentCSV' | tail -n 1)
155-
if [[ "$OSSM_VERSION" != "" ]]; then
154+
OUTPUT=$(oc get packagemanifests -n openshift-marketplace -o json | jq -r '.items[] | select(.metadata.labels.catalog=="custom-istio-catalog") | .status.channels[] | select(.currentCSV | contains("servicemeshoperator3")) | "\(.name),\(.currentCSV)"' | tail -n 1)
155+
OSSM_CHANNEL=$(echo "$OUTPUT" | cut -d ',' -f 1)
156+
OSSM_VERSION=$(echo "$OUTPUT" | cut -d ',' -f 2)
157+
if [[ "$OSSM_VERSION" != "" && "$OSSM_CHANNEL" != "" ]]; then
158+
echo "> OSSM channel found: ${OSSM_CHANNEL}"
156159
echo "> OSSM version found: ${OSSM_VERSION}"
157160
break
158161
fi
159162
TRIES=$((TRIES+1))
160-
echo "(${TRIES}/${MAX_TRIES}) OSSM version is not available, retrying..."
163+
echo "(${TRIES}/${MAX_TRIES}) OSSM channel and/or version is not available, retrying..."
161164
sleep 2
162165
done
163166
if (( TRIES >= MAX_TRIES )); then
164-
echo "> OSSM version is not found in $CUSTOM_CATALOG_SOURCE"
167+
echo "> OSSM version and channel not found in $CUSTOM_CATALOG_SOURCE"
165168
exit 4
166169
fi
170+
167171
echo "> Run GatewayAPI tests"
168-
CUSTOM_OSSM_VERSION=$OSSM_VERSION CUSTOM_CATALOG_SOURCE=$CUSTOM_CATALOG_SOURCE TEST=TestGatewayAPI make test-e2e
172+
CUSTOM_OSSM_VERSION=$OSSM_VERSION CUSTOM_CATALOG_SOURCE=$CUSTOM_CATALOG_SOURCE CUSTOM_OSSM_CHANNEL=$OSSM_CHANNEL TEST=TestGatewayAPI make test-e2e

test/e2e/util_gatewayapi_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,11 @@ func createGatewayClass(t *testing.T, name, controllerName string) (*gatewayapiv
285285
gatewayClass := buildGatewayClass(name, controllerName)
286286
customCatalog := os.Getenv("CUSTOM_CATALOG_SOURCE")
287287
ossmVersion := os.Getenv("CUSTOM_OSSM_VERSION")
288-
if customCatalog != "" && ossmVersion != "" {
288+
ossmChannel := os.Getenv("CUSTOM_OSSM_CHANNEL")
289+
if customCatalog != "" && ossmVersion != "" && ossmChannel != "" {
289290
gatewayClass.Annotations = map[string]string{
290291
"unsupported.do-not-use.openshift.io/ossm-catalog": customCatalog,
292+
"unsupported.do-not-use.openshift.io/ossm-channel": ossmChannel,
291293
"unsupported.do-not-use.openshift.io/ossm-version": ossmVersion,
292294
}
293295
}

0 commit comments

Comments
 (0)