File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -220,6 +220,23 @@ var _ = Describe("WFS Webhook", func() {
220220 Expect (warnings ).To (BeEmpty ())
221221 })
222222
223+ It ("Should deny update url was changed but not added to ingressRouteURLs" , func () {
224+ url , err := smoothoperatormodel .ParseURL ("http://old/changed" )
225+ Expect (err ).ToNot (HaveOccurred ())
226+ oldObj .Spec .IngressRouteURLs = nil
227+ obj .Spec .IngressRouteURLs = []smoothoperatormodel.IngressRouteURL {{URL : oldObj .Spec .Service .URL }}
228+ obj .Spec .Service .URL = smoothoperatormodel.URL {URL : url }
229+ warnings , err := validator .ValidateUpdate (ctx , oldObj , obj )
230+ Expect (err ).To (HaveOccurred ())
231+ Expect (warnings ).To (BeEmpty ())
232+
233+ obj .Spec .IngressRouteURLs = []smoothoperatormodel.IngressRouteURL {{URL : smoothoperatormodel.URL {URL : url }}}
234+ warnings , err = validator .ValidateUpdate (ctx , oldObj , obj )
235+ Expect (err ).To (HaveOccurred ())
236+ Expect (warnings ).To (BeEmpty ())
237+
238+ })
239+
223240 It ("Should deny update if a label was removed" , func () {
224241 for label := range obj .Labels {
225242 delete (obj .Labels , label )
You can’t perform that action at this time.
0 commit comments