@@ -934,8 +934,6 @@ var _ = Describe("Install Plan", func() {
934
934
mainPackageDelta := fmt .Sprintf ("%s-delta" , mainPackageName )
935
935
936
936
stableChannel := "stable"
937
- betaChannel := "beta"
938
- deltaChannel := "delta"
939
937
940
938
// Create manifests
941
939
mainManifests := []registry.PackageManifest {
@@ -998,30 +996,17 @@ var _ = Describe("Install Plan", func() {
998
996
{
999
997
PackageName : mainPackageName ,
1000
998
Channels : []registry.PackageChannel {
1001
- {Name : stableChannel , CurrentCSVName : mainPackageStable },
1002
- {Name : betaChannel , CurrentCSVName : mainPackageBeta },
999
+ {Name : stableChannel , CurrentCSVName : mainPackageBeta },
1003
1000
},
1004
- DefaultChannelName : betaChannel ,
1001
+ DefaultChannelName : stableChannel ,
1005
1002
},
1006
1003
}
1007
1004
1008
1005
updateInternalCatalog (GinkgoT (), c , crc , mainCatalogSourceName , testNamespace , []apiextensions.CustomResourceDefinition {* tt .intermediateCRD }, []operatorsv1alpha1.ClusterServiceVersion {mainStableCSV , mainBetaCSV }, mainManifests )
1009
-
1010
1006
// Attempt to get the catalog source before creating install plan(s)
1011
1007
_ , err = fetchCatalogSourceOnStatus (crc , mainCatalogSourceName , testNamespace , catalogSourceRegistryPodSynced )
1012
1008
require .NoError (GinkgoT (), err )
1013
-
1014
- // Update the subscription resource to point to the beta CSV
1015
- err = crc .OperatorsV1alpha1 ().Subscriptions (testNamespace ).DeleteCollection (context .TODO (), * metav1 .NewDeleteOptions (0 ), metav1.ListOptions {})
1016
- require .NoError (GinkgoT (), err )
1017
-
1018
- // Delete orphaned csv
1019
- require .NoError (GinkgoT (), crc .OperatorsV1alpha1 ().ClusterServiceVersions (testNamespace ).Delete (context .TODO (), mainStableCSV .GetName (), metav1.DeleteOptions {}))
1020
-
1021
- // existing cleanup should remove this
1022
- createSubscriptionForCatalog (crc , testNamespace , subscriptionName , mainCatalogSourceName , mainPackageName , betaChannel , "" , operatorsv1alpha1 .ApprovalAutomatic )
1023
-
1024
- subscription , err = fetchSubscription (crc , testNamespace , subscriptionName , subscriptionHasInstallPlanChecker )
1009
+ subscription , err = fetchSubscription (crc , testNamespace , subscriptionName , subscriptionHasInstallPlanDifferentChecker (installPlanName ))
1025
1010
require .NoError (GinkgoT (), err )
1026
1011
require .NotNil (GinkgoT (), subscription )
1027
1012
@@ -1047,35 +1032,21 @@ var _ = Describe("Install Plan", func() {
1047
1032
validateCRDVersions (GinkgoT (), c , tt .oldCRD .GetName (), expectedVersions )
1048
1033
1049
1034
// Update the manifest
1050
- mainBetaCSV = newCSV (mainPackageBeta , testNamespace , "" , semver .MustParse ("0.2.0" ), []apiextensions.CustomResourceDefinition {* tt .intermediateCRD }, nil , mainNamedStrategy )
1051
1035
mainManifests = []registry.PackageManifest {
1052
1036
{
1053
1037
PackageName : mainPackageName ,
1054
1038
Channels : []registry.PackageChannel {
1055
- {Name : betaChannel , CurrentCSVName : mainPackageBeta },
1056
- {Name : deltaChannel , CurrentCSVName : mainPackageDelta },
1039
+ {Name : stableChannel , CurrentCSVName : mainPackageDelta },
1057
1040
},
1058
- DefaultChannelName : deltaChannel ,
1041
+ DefaultChannelName : stableChannel ,
1059
1042
},
1060
1043
}
1061
1044
1062
- updateInternalCatalog (GinkgoT (), c , crc , mainCatalogSourceName , testNamespace , []apiextensions.CustomResourceDefinition {* tt .newCRD }, []operatorsv1alpha1.ClusterServiceVersion {mainBetaCSV , mainDeltaCSV }, mainManifests )
1063
-
1045
+ updateInternalCatalog (GinkgoT (), c , crc , mainCatalogSourceName , testNamespace , []apiextensions.CustomResourceDefinition {* tt .newCRD }, []operatorsv1alpha1.ClusterServiceVersion {mainStableCSV , mainBetaCSV , mainDeltaCSV }, mainManifests )
1064
1046
// Attempt to get the catalog source before creating install plan(s)
1065
1047
_ , err = fetchCatalogSourceOnStatus (crc , mainCatalogSourceName , testNamespace , catalogSourceRegistryPodSynced )
1066
1048
require .NoError (GinkgoT (), err )
1067
-
1068
- // Update the subscription resource to point to the beta CSV
1069
- err = crc .OperatorsV1alpha1 ().Subscriptions (testNamespace ).DeleteCollection (context .TODO (), * metav1 .NewDeleteOptions (0 ), metav1.ListOptions {})
1070
- require .NoError (GinkgoT (), err )
1071
-
1072
- // Delete orphaned csv
1073
- require .NoError (GinkgoT (), crc .OperatorsV1alpha1 ().ClusterServiceVersions (testNamespace ).Delete (context .TODO (), mainBetaCSV .GetName (), metav1.DeleteOptions {}))
1074
-
1075
- // existing cleanup should remove this
1076
- createSubscriptionForCatalog (crc , testNamespace , subscriptionName , mainCatalogSourceName , mainPackageName , deltaChannel , "" , operatorsv1alpha1 .ApprovalAutomatic )
1077
-
1078
- subscription , err = fetchSubscription (crc , testNamespace , subscriptionName , subscriptionHasInstallPlanChecker )
1049
+ subscription , err = fetchSubscription (crc , testNamespace , subscriptionName , subscriptionHasInstallPlanDifferentChecker (installPlanName ))
1079
1050
require .NoError (GinkgoT (), err )
1080
1051
require .NotNil (GinkgoT (), subscription )
1081
1052
@@ -1710,6 +1681,7 @@ var _ = Describe("Install Plan", func() {
1710
1681
mainPackageName := genName ("nginx-update-" )
1711
1682
1712
1683
mainPackageStable := fmt .Sprintf ("%s-stable" , mainPackageName )
1684
+ mainPackageBeta := fmt .Sprintf ("%s-beta" , mainPackageName )
1713
1685
1714
1686
stableChannel := "stable"
1715
1687
@@ -1769,6 +1741,7 @@ var _ = Describe("Install Plan", func() {
1769
1741
}
1770
1742
1771
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 )
1772
1745
1773
1746
c := newKubeClient ()
1774
1747
crc := newCRClient ()
@@ -1797,7 +1770,7 @@ var _ = Describe("Install Plan", func() {
1797
1770
_ , err := fetchCatalogSourceOnStatus (crc , mainCatalogName , testNamespace , catalogSourceRegistryPodSynced )
1798
1771
require .NoError (GinkgoT (), err )
1799
1772
1800
- subscriptionName := genName ("sub-nginx-update-before- " )
1773
+ subscriptionName := genName ("sub-nginx-update-" )
1801
1774
createSubscriptionForCatalog (crc , testNamespace , subscriptionName , mainCatalogName , mainPackageName , stableChannel , "" , operatorsv1alpha1 .ApprovalAutomatic )
1802
1775
1803
1776
subscription , err := fetchSubscription (crc , testNamespace , subscriptionName , subscriptionHasInstallPlanChecker )
@@ -1825,19 +1798,19 @@ var _ = Describe("Install Plan", func() {
1825
1798
_ , err = awaitCSV (GinkgoT (), crc , testNamespace , mainCSV .GetName (), csvAnyChecker )
1826
1799
require .NoError (GinkgoT (), err )
1827
1800
1828
- updateInternalCatalog (GinkgoT (), c , crc , mainCatalogName , testNamespace , []apiextensions.CustomResourceDefinition {updatedCRD }, []operatorsv1alpha1.ClusterServiceVersion {mainCSV }, mainManifests )
1829
-
1830
- // Update the subscription resource
1831
- err = crc .OperatorsV1alpha1 ().Subscriptions (testNamespace ).DeleteCollection (context .TODO (), * metav1 .NewDeleteOptions (0 ), metav1.ListOptions {})
1832
- require .NoError (GinkgoT (), err )
1833
-
1834
- // existing cleanup should remove this
1835
- subscriptionName = genName ("sub-nginx-update-after-" )
1836
- subscriptionCleanup := createSubscriptionForCatalog (crc , testNamespace , subscriptionName , mainCatalogName , mainPackageName , stableChannel , "" , operatorsv1alpha1 .ApprovalAutomatic )
1837
- 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
+ }
1838
1810
1811
+ updateInternalCatalog (GinkgoT (), c , crc , mainCatalogName , testNamespace , []apiextensions.CustomResourceDefinition {updatedCRD }, []operatorsv1alpha1.ClusterServiceVersion {mainCSV , betaCSV }, mainManifests )
1839
1812
// Wait for subscription to update
1840
- updatedSubscription , err := fetchSubscription (crc , testNamespace , subscriptionName , subscriptionHasInstallPlanChecker )
1813
+ updatedSubscription , err := fetchSubscription (crc , testNamespace , subscriptionName , subscriptionHasInstallPlanDifferentChecker ( fetchedInstallPlan . GetName ()) )
1841
1814
require .NoError (GinkgoT (), err )
1842
1815
1843
1816
// Verify installplan created and installed
@@ -1846,7 +1819,7 @@ var _ = Describe("Install Plan", func() {
1846
1819
require .NotEqual (GinkgoT (), fetchedInstallPlan .GetName (), fetchedUpdatedInstallPlan .GetName ())
1847
1820
1848
1821
// Wait for csv to update
1849
- _ , err = awaitCSV (GinkgoT (), crc , testNamespace , mainCSV .GetName (), csvAnyChecker )
1822
+ _ , err = awaitCSV (GinkgoT (), crc , testNamespace , betaCSV .GetName (), csvAnyChecker )
1850
1823
require .NoError (GinkgoT (), err )
1851
1824
1852
1825
// Get the CRD to see if it is updated
0 commit comments