@@ -167,6 +167,7 @@ var _ = Describe("WMS Controller", func() {
167167 return nil
168168 }, "10s" , "1s" ).Should (Not (HaveOccurred ()))
169169 })
170+
170171 It ("Should successfully reconcile after a change in an owned resource" , func () {
171172 controllerReconciler := getWMSReconciler ()
172173
@@ -204,6 +205,7 @@ var _ = Describe("WMS Controller", func() {
204205 Expect (* deployment .Spec .RevisionHistoryLimit ).To (BeEquivalentTo (originalRevisionHistoryLimit ))
205206 }, "10s" , "1s" ).Should (BeTrue ())
206207 })
208+
207209 It ("Should create correct deployment manifest." , func () {
208210 controllerReconciler := getWMSReconciler ()
209211 reconcilerImages := getReconcilerImages (controllerReconciler )
@@ -342,7 +344,8 @@ var _ = Describe("WMS Controller", func() {
342344 By ("Cleanup the specific resource instance WMS" )
343345 Expect (k8sClient .Delete (ctx , wmsResource )).To (Succeed ())
344346
345- sampleWms , err := getUniqueWMSSample (9999 )
347+ sampleWms , err := getUniqueWMSSample (counter )
348+ counter ++
346349 typeNamespacedNameWms .Name = sampleWms .Name
347350 Expect (err ).NotTo (HaveOccurred ())
348351 sampleWms .Spec .Options .PrefetchData = smoothoperatorutils .Pointer (false )
@@ -358,6 +361,33 @@ var _ = Describe("WMS Controller", func() {
358361 Expect (err ).To (HaveOccurred ())
359362 })
360363
364+ It ("Should not mount a ogc web service proxy configmap if options.DisableWebserviceProxy is true." , func () {
365+ wmsResource := & pdoknlv3.WMS {}
366+ wmsResource .Namespace = namespace
367+ wmsResource .Name = typeNamespacedNameWms .Name
368+ err := k8sClient .Get (ctx , typeNamespacedNameWms , wmsResource )
369+ Expect (client .IgnoreNotFound (err )).NotTo (HaveOccurred ())
370+
371+ By ("Cleanup the specific resource instance WMS" )
372+ Expect (k8sClient .Delete (ctx , wmsResource )).To (Succeed ())
373+
374+ sampleWms , err := getUniqueWMSSample (counter )
375+ counter ++
376+ typeNamespacedNameWms .Name = sampleWms .Name
377+ Expect (err ).NotTo (HaveOccurred ())
378+ sampleWms .Spec .Options .DisableWebserviceProxy = smoothoperatorutils .Pointer (true )
379+ Expect (k8sClient .Create (ctx , sampleWms .DeepCopy ())).To (Succeed ())
380+ Expect (k8sClient .Get (ctx , typeNamespacedNameWms , wms )).To (Succeed ())
381+
382+ controllerReconciler := getWMSReconciler ()
383+
384+ By ("Reconciling the WMS and checking the configMap" )
385+ reconcileWMS (controllerReconciler , wms , typeNamespacedNameWms )
386+
387+ _ , err = getHashedConfigMapNameFromClient (ctx , wms , mapserver .ConfigMapOgcWebserviceProxyVolumeName )
388+ Expect (err ).To (HaveOccurred ())
389+ })
390+
361391 It ("Should create correct configMap manifest." , func () {
362392 controllerReconciler := getWMSReconciler ()
363393
0 commit comments