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