@@ -234,7 +234,7 @@ var _ = Describe("WMS Controller", func() {
234234 /**
235235 Container tests
236236 */
237- containerMapserver := deployment .Spec .Template .Spec .Containers [0 ]
237+ containerMapserver := deployment .Spec .Template .Spec .Containers [1 ]
238238 Expect (containerMapserver .Name ).Should (Equal ("mapserver" ))
239239 Expect (containerMapserver .Ports [0 ].ContainerPort ).Should (Equal (int32 (80 )))
240240 Expect (containerMapserver .Image ).Should (Equal (reconcilerImages .MapserverImage ))
@@ -260,7 +260,7 @@ var _ = Describe("WMS Controller", func() {
260260 Expect (containerMapserver .StartupProbe .PeriodSeconds ).Should (Equal (int32 (10 )))
261261 Expect (containerMapserver .StartupProbe .TimeoutSeconds ).Should (Equal (int32 (10 )))
262262
263- containerOgcWebserviceProxy := deployment .Spec .Template .Spec .Containers [1 ]
263+ containerOgcWebserviceProxy := deployment .Spec .Template .Spec .Containers [2 ]
264264 Expect (containerOgcWebserviceProxy .Name ).Should (Equal ("ogc-webservice-proxy" ))
265265 ogcWebserviceProxyCommands := []string {"/ogc-webservice-proxy" , "-h=http://127.0.0.1/" , "-t=wms" , "-s=/input/service-config.yaml" , "-v" , "-r" , "-d=15" }
266266 Expect (containerOgcWebserviceProxy .Command ).Should (Equal (ogcWebserviceProxyCommands ))
@@ -286,7 +286,7 @@ var _ = Describe("WMS Controller", func() {
286286 {Name : "data" , MountPath : "/var/www" },
287287 {Name : mapserver .ConfigMapBlobDownloadVolumeName , MountPath : "/srv/scripts" , ReadOnly : true },
288288 }
289- envFrom := []v1 .EnvFromSource {
289+ envFrom := []corev1 .EnvFromSource {
290290 utils .NewEnvFromSource (utils .EnvFromSourceTypeConfigMap , "blobs-testtest" ),
291291 utils .NewEnvFromSource (utils .EnvFromSourceTypeSecret , "blobs-testtest" ),
292292 }
@@ -347,7 +347,7 @@ var _ = Describe("WMS Controller", func() {
347347 Expect (legendGeneratorContainer .VolumeMounts ).Should (Equal (volumeMounts ))
348348
349349 env = []corev1.EnvVar {
350- {Name : "MS_MAPFILE" , Value : "service.map" , ValueFrom : nil },
350+ {Name : "MS_MAPFILE" , Value : "/srv/data/config/mapfile/ service.map" , ValueFrom : nil },
351351 }
352352 Expect (legendGeneratorContainer .Env ).Should (Equal (env ))
353353
@@ -463,7 +463,7 @@ var _ = Describe("WMS Controller", func() {
463463 By ("Reconciling the WMS and checking the configMap" )
464464 reconcileWMS (controllerReconciler , wms , typeNamespacedNameWms )
465465 deployment := & appsv1.Deployment {}
466- err = k8sClient .Get (ctx , types.NamespacedName {Namespace : namespace , Name : getBareDeployment (wms , MapserverName ).GetName ()}, deployment )
466+ err = k8sClient .Get (ctx , types.NamespacedName {Namespace : namespace , Name : getBareDeployment (wms ).GetName ()}, deployment )
467467 Expect (err ).NotTo (HaveOccurred ())
468468 blobDownloadContainer , err := getInitContainer ("blob-download" , deployment )
469469 Expect (blobDownloadContainer .Name ).To (BeEquivalentTo ("blob-download" ))
@@ -496,10 +496,10 @@ var _ = Describe("WMS Controller", func() {
496496 By ("Reconciling the WMS and checking the configMap" )
497497 reconcileWMS (controllerReconciler , wms , typeNamespacedNameWms )
498498 deployment := & appsv1.Deployment {}
499- err = k8sClient .Get (ctx , types.NamespacedName {Namespace : namespace , Name : getBareDeployment (wms , MapserverName ).GetName ()}, deployment )
499+ err = k8sClient .Get (ctx , types.NamespacedName {Namespace : namespace , Name : getBareDeployment (wms ).GetName ()}, deployment )
500500 Expect (err ).NotTo (HaveOccurred ())
501501
502- containerOgcWebserviceProxy := deployment .Spec .Template .Spec .Containers [1 ]
502+ containerOgcWebserviceProxy := deployment .Spec .Template .Spec .Containers [2 ]
503503 Expect (containerOgcWebserviceProxy .Name ).Should (Equal ("ogc-webservice-proxy" ))
504504 ogcWebserviceProxyCommands := []string {"/ogc-webservice-proxy" , "-h=http://127.0.0.1/" , "-t=wms" , "-s=/input/service-config.yaml" , "-r" , "-d=15" }
505505 Expect (containerOgcWebserviceProxy .Command ).Should (Equal (ogcWebserviceProxyCommands ))
@@ -748,7 +748,7 @@ var _ = Describe("WMS Controller", func() {
748748 }, "10s" , "1s" ).Should (BeTrue ())
749749
750750 Expect (autoscaler .GetName ()).To (Equal (wms .GetName () + "-wms-mapserver" ))
751- Expect (autoscaler .Spec .ScaleTargetRef ).To (Equal (v2 .CrossVersionObjectReference {
751+ Expect (autoscaler .Spec .ScaleTargetRef ).To (Equal (autoscalingv2 .CrossVersionObjectReference {
752752 Kind : "Deployment" ,
753753 Name : wms .GetName () + "-wms-mapserver" ,
754754 }))
@@ -817,7 +817,7 @@ var _ = Describe("WMS Controller", func() {
817817 }, "10s" , "1s" ).Should (BeTrue ())
818818
819819 Expect (service .GetName ()).To (Equal (wms .GetName () + "-wms-mapserver" ))
820- Expect (service .Spec .Ports ).To (Equal ([]v1 .ServicePort {
820+ Expect (service .Spec .Ports ).To (Equal ([]corev1 .ServicePort {
821821 {
822822 Name : "mapserver" ,
823823 Port : 80 ,
@@ -918,7 +918,7 @@ var _ = Describe("WMS Controller", func() {
918918 By ("Reconciling the WMS and checking the configMap" )
919919 reconcileWMS (controllerReconciler , wms , typeNamespacedNameWms )
920920 deployment := & appsv1.Deployment {}
921- err = k8sClient .Get (ctx , types.NamespacedName {Namespace : namespace , Name : getBareDeployment (wms , MapserverName ).GetName ()}, deployment )
921+ err = k8sClient .Get (ctx , types.NamespacedName {Namespace : namespace , Name : getBareDeployment (wms ).GetName ()}, deployment )
922922 Expect (err ).NotTo (HaveOccurred ())
923923
924924 volumeMounts := []corev1.VolumeMount {
@@ -932,7 +932,7 @@ var _ = Describe("WMS Controller", func() {
932932 Expect (legendGeneratorContainer .VolumeMounts ).Should (Equal (volumeMounts ))
933933
934934 env := []corev1.EnvVar {
935- {Name : "MS_MAPFILE" , Value : "mapfile.map" , ValueFrom : nil },
935+ {Name : "MS_MAPFILE" , Value : "/srv/data/config/mapfile/ mapfile.map" , ValueFrom : nil },
936936 }
937937 Expect (legendGeneratorContainer .Env ).Should (Equal (env ))
938938 envContainer := []corev1.EnvVar {
@@ -948,15 +948,15 @@ var _ = Describe("WMS Controller", func() {
948948 ValueFrom : & corev1.EnvVarSource {
949949 SecretKeyRef : & corev1.SecretKeySelector {
950950 LocalObjectReference : corev1.LocalObjectReference {
951- Name : blobsSecretName ,
951+ Name : "blobs-testtest" ,
952952 },
953953 Key : "AZURE_STORAGE_CONNECTION_STRING" ,
954954 },
955955 },
956956 },
957- {Name : "MS_MAPFILE" , Value : "mapfile.map" , ValueFrom : nil },
957+ {Name : "MS_MAPFILE" , Value : "/srv/data/config/mapfile/ mapfile.map" , ValueFrom : nil },
958958 }
959- Expect (deployment .Spec .Template .Spec .Containers [0 ].Env ).Should (Equal (envContainer ))
959+ Expect (deployment .Spec .Template .Spec .Containers [1 ].Env ).Should (Equal (envContainer ))
960960 })
961961 })
962962})
0 commit comments