@@ -822,20 +822,24 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
822
822
local , err := Local (c )
823
823
Expect (err ).NotTo (HaveOccurred (), "cannot determine if test running locally or on CI: %s" , err )
824
824
825
+ By ("Create an image based catalog source from public Quay image using a unique tag as identifier" )
825
826
var registryURL string
826
827
var registryAuth string
827
828
if local {
829
+ By ("Creating a local registry to use" )
828
830
registryURL , err = createDockerRegistry (c , generatedNamespace .GetName ())
829
831
Expect (err ).NotTo (HaveOccurred (), "error creating container registry: %s" , err )
830
832
defer deleteDockerRegistry (c , generatedNamespace .GetName ())
831
833
832
- // ensure registry pod is ready before attempting port-forwarding
834
+ By ( " ensure registry pod with local URL " + registryURL + " is ready before attempting port-forwarding" )
833
835
_ = awaitPod (GinkgoT (), c , generatedNamespace .GetName (), registryName , podReady )
834
836
837
+ By ("By port-forwarding to the registry" )
835
838
err = registryPortForward (generatedNamespace .GetName ())
836
839
Expect (err ).NotTo (HaveOccurred (), "port-forwarding local registry: %s" , err )
837
840
} else {
838
841
registryURL = fmt .Sprintf ("%s/%s" , openshiftregistryFQDN , generatedNamespace .GetName ())
842
+ By ("Using the OpenShift registry at " + registryURL )
839
843
registryAuth , err = openshiftRegistryAuth (c , generatedNamespace .GetName ())
840
844
Expect (err ).NotTo (HaveOccurred (), "error getting openshift registry authentication: %s" , err )
841
845
}
@@ -844,33 +848,35 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
844
848
// the tag is generated randomly and appended to the end of the testImage
845
849
testImage := fmt .Sprint ("docker://" , registryURL , "/catsrc-update" , ":" )
846
850
tag := genName ("x" )
851
+ By ("Generating a target test image name " + testImage + " with tag " + tag )
847
852
848
- // 1. copy old catalog image into test-specific tag in internal docker registry
849
- // create skopeo pod to actually do the work of copying (on openshift) or exec out to local skopeo
853
+ By ("copying old catalog image into test-specific tag in internal docker registry" )
850
854
if local {
855
+ By ("executing out to a local skopeo client" )
851
856
_ , err := skopeoLocalCopy (testImage , tag , catsrcImage , "old" )
852
857
Expect (err ).NotTo (HaveOccurred (), "error copying old registry file: %s" , err )
853
858
} else {
859
+ By ("creating a skopoeo Pod to do the copying" )
854
860
skopeoArgs := skopeoCopyCmd (testImage , tag , catsrcImage , "old" , registryAuth )
855
861
err = createSkopeoPod (c , skopeoArgs , generatedNamespace .GetName ())
856
862
Expect (err ).NotTo (HaveOccurred (), "error creating skopeo pod: %s" , err )
857
863
858
- // wait for skopeo pod to exit successfully
864
+ By ( "waiting for the skopeo pod to exit successfully" )
859
865
awaitPod (GinkgoT (), c , generatedNamespace .GetName (), skopeo , func (pod * corev1.Pod ) bool {
860
866
return pod .Status .Phase == corev1 .PodSucceeded
861
867
})
862
868
869
+ By ("removing the skopeo pod" )
863
870
err = deleteSkopeoPod (c , generatedNamespace .GetName ())
864
871
Expect (err ).NotTo (HaveOccurred (), "error deleting skopeo pod: %s" , err )
865
872
}
866
873
867
- // 2. setup catalog source
868
-
874
+ By ("setting catalog source" )
869
875
sourceName := genName ("catalog-" )
870
876
packageName := "busybox"
871
877
channelName := "alpha"
872
878
873
- // Create gRPC CatalogSource using an external registry image and poll interval
879
+ By ( " Create gRPC CatalogSource using an external registry image and poll interval" )
874
880
var image string
875
881
image = testImage [9 :] // strip off docker://
876
882
image = fmt .Sprint (image , tag )
@@ -909,26 +915,31 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
909
915
}()
910
916
911
917
// wait for new catalog source pod to be created
912
- // Wait for a new registry pod to be created
918
+ By ( " Wait for a new registry pod to be created" )
913
919
selector := labels .SelectorFromSet (map [string ]string {"olm.catalogSource" : source .GetName ()})
914
920
singlePod := podCount (1 )
915
921
registryPods , err := awaitPods (GinkgoT (), c , source .GetNamespace (), selector .String (), singlePod )
916
922
Expect (err ).ToNot (HaveOccurred (), "error awaiting registry pod" )
917
923
Expect (registryPods ).ShouldNot (BeNil (), "nil registry pods" )
918
924
Expect (registryPods .Items ).To (HaveLen (1 ), "unexpected number of registry pods found" )
919
925
920
- // Create a Subscription for package
926
+ By ( " Create a Subscription for package" )
921
927
subscriptionName := genName ("sub-" )
922
928
cleanupSubscription := createSubscriptionForCatalog (crc , source .GetNamespace (), subscriptionName , source .GetName (), packageName , channelName , "" , v1alpha1 .ApprovalAutomatic )
923
929
defer cleanupSubscription ()
924
930
925
- // Wait for the Subscription to succeed
931
+ By ( " Wait for the Subscription to succeed" )
926
932
subscription , err := fetchSubscription (crc , generatedNamespace .GetName (), subscriptionName , subscriptionStateAtLatestChecker ())
927
933
Expect (err ).ShouldNot (HaveOccurred ())
928
934
Expect (subscription ).ShouldNot (BeNil ())
929
935
936
+ << << << < Updated upstream
930
937
// Wait for csv to succeed
931
938
_ , err = fetchCSV (crc , subscription .GetNamespace (), subscription .Status .CurrentCSV , csvSucceededChecker )
939
+ == == == =
940
+ By ("Wait for csv to succeed" )
941
+ _ , err = fetchCSV (crc , subscription .Status .CurrentCSV , subscription .GetNamespace (), csvSucceededChecker )
942
+ >> >> >> > Stashed changes
932
943
Expect (err ).ShouldNot (HaveOccurred ())
933
944
934
945
registryCheckFunc := func (podList * corev1.PodList ) bool {
@@ -937,29 +948,30 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
937
948
}
938
949
return podList .Items [0 ].Status .ContainerStatuses [0 ].ImageID != ""
939
950
}
940
- // get old catalog source pod
951
+ By ( " get old catalog source pod" )
941
952
registryPod , err := awaitPods (GinkgoT (), c , source .GetNamespace (), selector .String (), registryCheckFunc )
942
- // 3. Update image on registry via skopeo: this should trigger a newly updated version of the catalog source pod
943
- // to be deployed after some time
944
- // Make another skopeo pod to do the work of copying the image
953
+ By ("Updateing image on registry to trigger a newly updated version of the catalog source pod to be deployed after some time" )
945
954
if local {
955
+ By ("executing out to a local skopeo client" )
946
956
_ , err := skopeoLocalCopy (testImage , tag , catsrcImage , "new" )
947
957
Expect (err ).NotTo (HaveOccurred (), "error copying new registry file: %s" , err )
948
958
} else {
959
+ By ("creating a skopoeo Pod to do the copying" )
949
960
skopeoArgs := skopeoCopyCmd (testImage , tag , catsrcImage , "new" , registryAuth )
950
961
err = createSkopeoPod (c , skopeoArgs , generatedNamespace .GetName ())
951
962
Expect (err ).NotTo (HaveOccurred (), "error creating skopeo pod: %s" , err )
952
963
953
- // wait for skopeo pod to exit successfully
964
+ By ( "waiting for the skopeo pod to exit successfully" )
954
965
awaitPod (GinkgoT (), c , generatedNamespace .GetName (), skopeo , func (pod * corev1.Pod ) bool {
955
966
return pod .Status .Phase == corev1 .PodSucceeded
956
967
})
957
968
969
+ By ("removing the skopeo pod" )
958
970
err = deleteSkopeoPod (c , generatedNamespace .GetName ())
959
971
Expect (err ).NotTo (HaveOccurred (), "error deleting skopeo pod: %s" , err )
960
972
}
961
973
962
- // update catalog source with annotation (to kick resync)
974
+ By ( " update catalog source with annotation (to kick resync)" )
963
975
Eventually (func () error {
964
976
source , err = crc .OperatorsV1alpha1 ().CatalogSources (source .GetNamespace ()).Get (context .Background (), source .GetName (), metav1.GetOptions {})
965
977
if err != nil {
@@ -972,9 +984,7 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
972
984
return err
973
985
}).Should (Succeed ())
974
986
975
- time .Sleep (11 * time .Second )
976
-
977
- // ensure new registry pod container image is as we expect
987
+ By ("ensure new registry pod container image is as we expect" )
978
988
podCheckFunc := func (podList * corev1.PodList ) bool {
979
989
ctx .Ctx ().Logf ("pod list length %d\n " , len (podList .Items ))
980
990
for _ , pod := range podList .Items {
@@ -988,7 +998,7 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
988
998
return true
989
999
}
990
1000
}
991
- // update catalog source with annotation (to kick resync)
1001
+ By ( " update catalog source with annotation (to kick resync)" )
992
1002
Eventually (func () error {
993
1003
source , err = crc .OperatorsV1alpha1 ().CatalogSources (source .GetNamespace ()).Get (context .Background (), source .GetName (), metav1.GetOptions {})
994
1004
if err != nil {
@@ -1006,13 +1016,13 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
1006
1016
1007
1017
return false
1008
1018
}
1009
- // await new catalog source and ensure old one was deleted
1019
+ By ( " await new catalog source and ensure old one was deleted" )
1010
1020
registryPods , err = awaitPodsWithInterval (GinkgoT (), c , source .GetNamespace (), selector .String (), 30 * time .Second , 10 * time .Minute , podCheckFunc )
1011
1021
Expect (err ).ShouldNot (HaveOccurred (), "error awaiting registry pod" )
1012
1022
Expect (registryPods ).ShouldNot (BeNil (), "nil registry pods" )
1013
1023
Expect (registryPods .Items ).To (HaveLen (1 ), "unexpected number of registry pods found" )
1014
1024
1015
- // update catalog source with annotation (to kick resync)
1025
+ By ( " update catalog source with annotation (to kick resync)" )
1016
1026
Eventually (func () error {
1017
1027
source , err = crc .OperatorsV1alpha1 ().CatalogSources (source .GetNamespace ()).Get (context .Background (), source .GetName (), metav1.GetOptions {})
1018
1028
if err != nil {
@@ -1027,16 +1037,21 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
1027
1037
subChecker := func (sub * v1alpha1.Subscription ) bool {
1028
1038
return sub .Status .InstalledCSV == "busybox.v2.0.0"
1029
1039
}
1030
- // Wait for the Subscription to succeed
1040
+ By ( " Wait for the Subscription to succeed" )
1031
1041
subscription , err = fetchSubscription (crc , generatedNamespace .GetName (), subscriptionName , subChecker )
1032
1042
Expect (err ).ShouldNot (HaveOccurred ())
1033
1043
Expect (subscription ).ShouldNot (BeNil ())
1034
1044
1045
+ << << << < Updated upstream
1035
1046
// Wait for csv to succeed
1036
1047
csv , err := fetchCSV (crc , subscription .GetNamespace (), subscription .Status .CurrentCSV , csvSucceededChecker )
1048
+ == == == =
1049
+ By ("Wait for csv to succeed" )
1050
+ csv , err := fetchCSV (crc , subscription .Status .CurrentCSV , subscription .GetNamespace (), csvSucceededChecker )
1051
+ >> >> >> > Stashed changes
1037
1052
Expect (err ).ShouldNot (HaveOccurred ())
1038
1053
1039
- // check version of running csv to ensure the latest version (0.9.2) was installed onto the cluster
1054
+ By ( " check version of running csv to ensure the latest version (0.9.2) was installed onto the cluster" )
1040
1055
v := csv .Spec .Version
1041
1056
busyboxVersion := semver.Version {
1042
1057
Major : 2 ,
0 commit comments