@@ -1683,6 +1683,7 @@ var _ = Describe("Install Plan", func() {
1683
1683
mainPackageName := genName ("nginx-update-" )
1684
1684
1685
1685
mainPackageStable := fmt .Sprintf ("%s-stable" , mainPackageName )
1686
+ mainPackageBeta := fmt .Sprintf ("%s-beta" , mainPackageName )
1686
1687
1687
1688
stableChannel := "stable"
1688
1689
@@ -1742,6 +1743,7 @@ var _ = Describe("Install Plan", func() {
1742
1743
}
1743
1744
1744
1745
mainCSV := newCSV (mainPackageStable , testNamespace , "" , semver .MustParse ("0.1.0" ), []apiextensions.CustomResourceDefinition {mainCRD }, nil , mainNamedStrategy )
1746
+ betaCSV := newCSV (mainPackageBeta , testNamespace , mainPackageStable , semver .MustParse ("0.2.0" ), []apiextensions.CustomResourceDefinition {updatedCRD }, nil , mainNamedStrategy )
1745
1747
1746
1748
c := newKubeClient ()
1747
1749
crc := newCRClient ()
@@ -1770,7 +1772,7 @@ var _ = Describe("Install Plan", func() {
1770
1772
_ , err := fetchCatalogSourceOnStatus (crc , mainCatalogName , testNamespace , catalogSourceRegistryPodSynced )
1771
1773
require .NoError (GinkgoT (), err )
1772
1774
1773
- subscriptionName := genName ("sub-nginx-update-before- " )
1775
+ subscriptionName := genName ("sub-nginx-update-" )
1774
1776
createSubscriptionForCatalog (crc , testNamespace , subscriptionName , mainCatalogName , mainPackageName , stableChannel , "" , operatorsv1alpha1 .ApprovalAutomatic )
1775
1777
1776
1778
subscription , err := fetchSubscription (crc , testNamespace , subscriptionName , subscriptionHasInstallPlanChecker )
@@ -1798,19 +1800,19 @@ var _ = Describe("Install Plan", func() {
1798
1800
_ , err = awaitCSV (GinkgoT (), crc , testNamespace , mainCSV .GetName (), csvAnyChecker )
1799
1801
require .NoError (GinkgoT (), err )
1800
1802
1801
- updateInternalCatalog (GinkgoT (), c , crc , mainCatalogName , testNamespace , []apiextensions.CustomResourceDefinition {updatedCRD }, []operatorsv1alpha1.ClusterServiceVersion {mainCSV }, mainManifests )
1802
-
1803
- // Update the subscription resource
1804
- err = crc .OperatorsV1alpha1 ().Subscriptions (testNamespace ).DeleteCollection (context .TODO (), * metav1 .NewDeleteOptions (0 ), metav1.ListOptions {})
1805
- require .NoError (GinkgoT (), err )
1806
-
1807
- // existing cleanup should remove this
1808
- subscriptionName = genName ("sub-nginx-update-after-" )
1809
- subscriptionCleanup := createSubscriptionForCatalog (crc , testNamespace , subscriptionName , mainCatalogName , mainPackageName , stableChannel , "" , operatorsv1alpha1 .ApprovalAutomatic )
1810
- defer subscriptionCleanup ()
1803
+ mainManifests = []registry.PackageManifest {
1804
+ {
1805
+ PackageName : mainPackageName ,
1806
+ Channels : []registry.PackageChannel {
1807
+ {Name : stableChannel , CurrentCSVName : mainPackageBeta },
1808
+ },
1809
+ DefaultChannelName : stableChannel ,
1810
+ },
1811
+ }
1811
1812
1813
+ updateInternalCatalog (GinkgoT (), c , crc , mainCatalogName , testNamespace , []apiextensions.CustomResourceDefinition {updatedCRD }, []operatorsv1alpha1.ClusterServiceVersion {mainCSV , betaCSV }, mainManifests )
1812
1814
// Wait for subscription to update
1813
- updatedSubscription , err := fetchSubscription (crc , testNamespace , subscriptionName , subscriptionHasInstallPlanChecker )
1815
+ updatedSubscription , err := fetchSubscription (crc , testNamespace , subscriptionName , subscriptionHasInstallPlanDifferentChecker ( fetchedInstallPlan . GetName ()) )
1814
1816
require .NoError (GinkgoT (), err )
1815
1817
1816
1818
// Verify installplan created and installed
@@ -1819,7 +1821,7 @@ var _ = Describe("Install Plan", func() {
1819
1821
require .NotEqual (GinkgoT (), fetchedInstallPlan .GetName (), fetchedUpdatedInstallPlan .GetName ())
1820
1822
1821
1823
// Wait for csv to update
1822
- _ , err = awaitCSV (GinkgoT (), crc , testNamespace , mainCSV .GetName (), csvAnyChecker )
1824
+ _ , err = awaitCSV (GinkgoT (), crc , testNamespace , betaCSV .GetName (), csvAnyChecker )
1823
1825
require .NoError (GinkgoT (), err )
1824
1826
1825
1827
// Get the CRD to see if it is updated
0 commit comments