@@ -812,6 +812,154 @@ func TestRegistryProviderList(t *testing.T) {
812
812
},
813
813
}},
814
814
},
815
+ {
816
+ name : "TwoCatalogs/SameNamespace/DuplicatePackages/PackagesFound" ,
817
+ globalNS : "ns" ,
818
+ registryClients : []* registryClient {
819
+ newTestRegistryClient (t , withRegistryServiceStatus (catalogSource ("cool-operators" , "ns" ), "grpc" , "cool-operators" , "ns" , port , metav1 .NewTime (time .Now ()))),
820
+ newTestRegistryClient (t , withRegistryServiceStatus (catalogSource ("cool-operators-2" , "ns" ), "grpc" , "cool-operators-2" , "ns" , port , metav1 .NewTime (time .Now ()))),
821
+ },
822
+ requestNamespace : "ns" ,
823
+ expectedErr : "" ,
824
+ expected : & operators.PackageManifestList {Items : []operators.PackageManifest {
825
+ {
826
+ ObjectMeta : metav1.ObjectMeta {
827
+ Name : "prometheus" ,
828
+ Namespace : "ns" ,
829
+ Labels : labels.Set {
830
+ "catalog" : "cool-operators" ,
831
+ "catalog-namespace" : "ns" ,
832
+ "provider" : "Red Hat" ,
833
+ "provider-url" : "" ,
834
+ "operatorframework.io/arch.amd64" : "supported" ,
835
+ "operatorframework.io/os.linux" : "supported" ,
836
+ },
837
+ },
838
+ Status : operators.PackageManifestStatus {
839
+ CatalogSource : "cool-operators" ,
840
+ CatalogSourceNamespace : "ns" ,
841
+ PackageName : "prometheus" ,
842
+ Provider : operators.AppLink {
843
+ Name : "Red Hat" ,
844
+ },
845
+ DefaultChannel : "preview" ,
846
+ Channels : []operators.PackageChannel {
847
+ {
848
+ Name : "preview" ,
849
+ CurrentCSV : "prometheusoperator.0.22.2" ,
850
+ CurrentCSVDesc : func () operators.CSVDescription {
851
+ csv := operatorsv1alpha1.ClusterServiceVersion {}
852
+ require .NoError (t , json .Unmarshal ([]byte (prometheusCSVJSON ), & csv ))
853
+ return operators .CreateCSVDescription (& csv )
854
+ }(),
855
+ },
856
+ },
857
+ },
858
+ },
859
+ {
860
+ ObjectMeta : metav1.ObjectMeta {
861
+ Name : "etcd" ,
862
+ Namespace : "ns" ,
863
+ Labels : labels.Set {
864
+ "catalog" : "cool-operators" ,
865
+ "catalog-namespace" : "ns" ,
866
+ "provider" : "CoreOS, Inc" ,
867
+ "provider-url" : "" ,
868
+ "operatorframework.io/arch.amd64" : "supported" ,
869
+ "operatorframework.io/os.linux" : "supported" ,
870
+ },
871
+ },
872
+ Status : operators.PackageManifestStatus {
873
+ CatalogSource : "cool-operators" ,
874
+ CatalogSourceNamespace : "ns" ,
875
+ PackageName : "etcd" ,
876
+ Provider : operators.AppLink {
877
+ Name : "CoreOS, Inc" ,
878
+ },
879
+ DefaultChannel : "alpha" ,
880
+ Channels : []operators.PackageChannel {
881
+ {
882
+ Name : "alpha" ,
883
+ CurrentCSV : "etcdoperator.v0.9.2" ,
884
+ CurrentCSVDesc : func () operators.CSVDescription {
885
+ csv := operatorsv1alpha1.ClusterServiceVersion {}
886
+ require .NoError (t , json .Unmarshal ([]byte (etcdCSVJSON ), & csv ))
887
+ return operators .CreateCSVDescription (& csv )
888
+ }(),
889
+ },
890
+ },
891
+ },
892
+ },
893
+ {
894
+ ObjectMeta : metav1.ObjectMeta {
895
+ Name : "prometheus" ,
896
+ Namespace : "ns" ,
897
+ Labels : labels.Set {
898
+ "catalog" : "cool-operators-2" ,
899
+ "catalog-namespace" : "ns" ,
900
+ "provider" : "Red Hat" ,
901
+ "provider-url" : "" ,
902
+ "operatorframework.io/arch.amd64" : "supported" ,
903
+ "operatorframework.io/os.linux" : "supported" ,
904
+ },
905
+ },
906
+ Status : operators.PackageManifestStatus {
907
+ CatalogSource : "cool-operators-2" ,
908
+ CatalogSourceNamespace : "ns" ,
909
+ PackageName : "prometheus" ,
910
+ Provider : operators.AppLink {
911
+ Name : "Red Hat" ,
912
+ },
913
+ DefaultChannel : "preview" ,
914
+ Channels : []operators.PackageChannel {
915
+ {
916
+ Name : "preview" ,
917
+ CurrentCSV : "prometheusoperator.0.22.2" ,
918
+ CurrentCSVDesc : func () operators.CSVDescription {
919
+ csv := operatorsv1alpha1.ClusterServiceVersion {}
920
+ require .NoError (t , json .Unmarshal ([]byte (prometheusCSVJSON ), & csv ))
921
+ return operators .CreateCSVDescription (& csv )
922
+ }(),
923
+ },
924
+ },
925
+ },
926
+ },
927
+ {
928
+ ObjectMeta : metav1.ObjectMeta {
929
+ Name : "etcd" ,
930
+ Namespace : "ns" ,
931
+ Labels : labels.Set {
932
+ "catalog" : "cool-operators-2" ,
933
+ "catalog-namespace" : "ns" ,
934
+ "provider" : "CoreOS, Inc" ,
935
+ "provider-url" : "" ,
936
+ "operatorframework.io/arch.amd64" : "supported" ,
937
+ "operatorframework.io/os.linux" : "supported" ,
938
+ },
939
+ },
940
+ Status : operators.PackageManifestStatus {
941
+ CatalogSource : "cool-operators-2" ,
942
+ CatalogSourceNamespace : "ns" ,
943
+ PackageName : "etcd" ,
944
+ Provider : operators.AppLink {
945
+ Name : "CoreOS, Inc" ,
946
+ },
947
+ DefaultChannel : "alpha" ,
948
+ Channels : []operators.PackageChannel {
949
+ {
950
+ Name : "alpha" ,
951
+ CurrentCSV : "etcdoperator.v0.9.2" ,
952
+ CurrentCSVDesc : func () operators.CSVDescription {
953
+ csv := operatorsv1alpha1.ClusterServiceVersion {}
954
+ require .NoError (t , json .Unmarshal ([]byte (etcdCSVJSON ), & csv ))
955
+ return operators .CreateCSVDescription (& csv )
956
+ }(),
957
+ },
958
+ },
959
+ },
960
+ },
961
+ }},
962
+ },
815
963
{
816
964
name : "OneCatalog/ManyPackages/OneMissingBundle/Elided" ,
817
965
globalNS : "ns" ,
0 commit comments