@@ -138,6 +138,45 @@ var _ = Describe("Ingress Controller", func() {
138138 return true
139139 }, timeout , interval ).Should (BeTrue (), "Timed out waiting for success" )
140140
141+ // Update path and use annotation
142+ By ("Expecting path to update successfully" )
143+ Eventually (func () error {
144+ // Get existing ingress object
145+ f := & networkingv1.Ingress {}
146+ err := k8sClient .Get (context .Background (), ingressKey , f )
147+ if err != nil {
148+ return err
149+ }
150+
151+ newPath := "new-path"
152+ // Update annotations with new path
153+ f .Annotations ["testing.domain.tld/path" ] = newPath
154+ err = k8sClient .Update (context .Background (), f )
155+ if err != nil {
156+ return err
157+ }
158+ u := & networkingv1.Ingress {}
159+ err = k8sClient .Get (context .Background (), ingressKey , u )
160+ if err != nil {
161+ return err
162+ }
163+ Expect (u .Annotations ["testing.domain.tld/path" ]).To (Equal ("new-path" ), "Path annotation should be updated" )
164+
165+ apiCheckKeyNewPath := types.NamespacedName {
166+ Name : fmt .Sprintf ("%s-%s-%s" , "test-ingress" , "foobar" , newPath ),
167+ Namespace : "default" ,
168+ }
169+ // Expect API Check to be updated
170+ f2 := & checklyv1alpha1.ApiCheck {}
171+ err = k8sClient .Get (context .Background (), apiCheckKeyNewPath , f2 )
172+ if err != nil {
173+ return err
174+ }
175+ Expect (f2 .Spec .Endpoint ).To (Equal (fmt .Sprintf ("https://%s/%s" , testHost , newPath )), "Endpoint should be updated" )
176+
177+ return nil
178+ }, timeout , interval ).Should (Succeed (), "Timeout waiting for update" )
179+
141180 // Set enabled false
142181 By ("Expecting enabled false to remove ApiCheck" )
143182 Eventually (func () error {
0 commit comments