@@ -1178,7 +1178,7 @@ var _ = Describe("Snapshot Adapter", Ordered, func() {
11781178 adapter .logger = log
11791179 adapter .snapshot = hasOverRideSnapshot
11801180
1181- // don't update Global Candidate List for a snapshot if it is neither component snapshot nor override snapshot
1181+ // don't update Global Candidate List for a snapshot if it is not override snapshot
11821182 hasOverRideSnapshot .Labels [gitops .SnapshotTypeLabel ] = ""
11831183 hasOverRideSnapshot .Spec .Components = []applicationapiv1alpha1.SnapshotComponent {
11841184 {
@@ -1202,7 +1202,7 @@ var _ = Describe("Snapshot Adapter", Ordered, func() {
12021202 Expect (err ).ShouldNot (HaveOccurred ())
12031203 Expect (result .CancelRequest ).To (BeFalse ())
12041204 Expect (result .RequeueRequest ).To (BeFalse ())
1205- expectedLogEntry := "The Snapshot was neither created for a single component push event nor override type, not updating the global candidate list. "
1205+ expectedLogEntry := "The Snapshot was not override type, will not update the global candidate list"
12061206 Expect (buf .String ()).Should (ContainSubstring (expectedLogEntry ))
12071207
12081208 // update Glocal Candidate List for the component in a override snapshot
@@ -1217,36 +1217,6 @@ var _ = Describe("Snapshot Adapter", Ordered, func() {
12171217 expectedLogEntry = "containerImage cannot be updated to component Global Candidate List due to invalid digest in containerImage"
12181218 Expect (buf .String ()).Should (ContainSubstring (expectedLogEntry ))
12191219 })
1220-
1221- It ("ensures global Component Image and lastPromotedImage updated when push snapshot is created" , func () {
1222- // ensure last promoted image is empty string
1223- hasComp .Status .LastPromotedImage = ""
1224- var buf bytes.Buffer
1225- log := helpers.IntegrationLogger {Logger : buflogr .NewWithBuffer (& buf )}
1226- adapter .logger = log
1227- adapter .snapshot = hasSnapshot
1228- Expect (gitops .IsSnapshotMarkedAsAddedToGlobalCandidateList (hasSnapshot )).To (BeFalse ())
1229- result , err := adapter .EnsureGlobalCandidateImageUpdated ()
1230- Expect (err ).ShouldNot (HaveOccurred ())
1231- Expect (result .CancelRequest ).To (BeFalse ())
1232-
1233- Eventually (func () bool {
1234- err := k8sClient .Get (ctx , types.NamespacedName {
1235- Name : hasSnapshot .Name ,
1236- Namespace : "default" ,
1237- }, hasSnapshot )
1238- return err == nil && gitops .IsSnapshotMarkedAsAddedToGlobalCandidateList (hasSnapshot )
1239- }, time .Second * 10 ).Should (BeTrue ())
1240-
1241- // Check if the adapter function detects that it already promoted the snapshot component
1242- result , err = adapter .EnsureGlobalCandidateImageUpdated ()
1243- Expect (err ).ShouldNot (HaveOccurred ())
1244- Expect (result .CancelRequest ).To (BeFalse ())
1245-
1246- expectedLogEntry := "The Snapshot's component was previously added to the global candidate list, skipping adding it."
1247-
1248- Expect (buf .String ()).Should (ContainSubstring (expectedLogEntry ))
1249- })
12501220 })
12511221
12521222 When ("pull request updates repo with integration test" , func () {
0 commit comments