@@ -45,16 +45,34 @@ func TestOSSMOperatorUpgradeViaIntermediateVersions(t *testing.T) {
4545 })
4646
4747 var (
48- initialOSSMVersion = "servicemeshoperator3.v3.0.0"
49- initialIstioVersion = "v1.24.3"
50- upgradeOSSMVersion = "servicemeshoperator3.v3.1.0"
51- upgradeIstioVersion = "v1.26.2"
48+ // CatalogSource image saved before the release of servicemeshoperator 3.1.0.
49+ // This image is useful because it includes intermediate versions in the
50+ // servicemeshoperator3 upgrade graph. After 3.1.0 was released, all
51+ // upgrades from 3.0.z were changed to jump directly to 3.1.0, skipping
52+ // intermediate versions.
53+ customCatalogSourceImage = "registry.redhat.io/redhat/redhat-operator-index@sha256:069050dbf2970f0762b816a054342e551802c45fb77417c216aed70cec5e843c"
54+ customCatalogSourceName = "custom-redhat-operators-4-19"
55+ initialOSSMVersion = "servicemeshoperator3.v3.0.0"
56+ initialIstioVersion = "v1.24.3"
57+ upgradeOSSMVersion = "servicemeshoperator3.v3.0.3"
58+ upgradeIstioVersion = "v1.24.6"
5259 )
5360
61+ // Create custom catalog source with expected upgrade graph for servicemeshoperator3.
62+ t .Log ("Creating custom CatalogSource..." )
63+ if err := createCatalogSource (t , "openshift-marketplace" , customCatalogSourceName , customCatalogSourceImage ); err != nil {
64+ t .Fatalf ("Failed to create CatalogSource %q: %v" , customCatalogSourceName , err )
65+ }
66+ t .Log ("Checking for the CatalogSource..." )
67+ if err := assertCatalogSourceWithConfig (t , "openshift-marketplace" , customCatalogSourceName , 2 * time .Second , 2 * time .Minute ); err != nil {
68+ t .Fatalf ("Failed to find expected CatalogSource %q: %v" , customCatalogSourceName , err )
69+ }
70+
5471 // Installation.
5572 t .Logf ("Creating GatewayClass with OSSMversion %q ans Istio version %q..." , initialOSSMVersion , initialIstioVersion )
5673 gatewayClass := buildGatewayClass ("openshift-default" , "openshift.io/gateway-controller/v1" )
5774 gatewayClass .Annotations = map [string ]string {
75+ "unsupported.do-not-use.openshift.io/ossm-catalog" : customCatalogSourceName ,
5876 "unsupported.do-not-use.openshift.io/ossm-version" : initialOSSMVersion ,
5977 "unsupported.do-not-use.openshift.io/istio-version" : initialIstioVersion ,
6078 }
@@ -65,10 +83,6 @@ func TestOSSMOperatorUpgradeViaIntermediateVersions(t *testing.T) {
6583 if err := assertSubscription (t , openshiftOperatorsNamespace , expectedSubscriptionName ); err != nil {
6684 t .Fatalf ("Failed to find expected Subscription %s: %v" , expectedSubscriptionName , err )
6785 }
68- t .Log ("Checking for the CatalogSource..." )
69- if err := assertCatalogSource (t , expectedCatalogSourceNamespace , expectedCatalogSourceName ); err != nil {
70- t .Fatalf ("Failed to find expected CatalogSource %s: %v" , expectedCatalogSourceName , err )
71- }
7286 t .Log ("Checking for the OSSM operator deployment..." )
7387 if err := assertOSSMOperatorWithConfig (t , initialOSSMVersion , 2 * time .Second , 2 * time .Minute ); err != nil {
7488 t .Fatalf ("Failed to find expected Istio operator: %v" , err )
@@ -91,6 +105,7 @@ func TestOSSMOperatorUpgradeViaIntermediateVersions(t *testing.T) {
91105 return false , nil
92106 }
93107 gc .Annotations = map [string ]string {
108+ "unsupported.do-not-use.openshift.io/ossm-catalog" : customCatalogSourceName ,
94109 "unsupported.do-not-use.openshift.io/ossm-version" : upgradeOSSMVersion ,
95110 "unsupported.do-not-use.openshift.io/istio-version" : upgradeIstioVersion ,
96111 }
0 commit comments