@@ -49,6 +49,7 @@ const (
4949// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
5050
5151// WMSSpec defines the desired state of WMS.
52+ // +kubebuilder:validation:XValidation:rule="!has(self.ingressRouteUrls) || self.ingressRouteUrls.exists_one(x, x.url == self.service.url)",messageExpression="'ingressRouteUrls should include service.url '+self.service.url"
5253type WMSSpec struct {
5354 // Optional lifecycle settings
5455 Lifecycle * smoothoperatormodel.Lifecycle `json:"lifecycle,omitempty"`
@@ -69,6 +70,10 @@ type WMSSpec struct {
6970 // Custom healthcheck options
7071 HealthCheck * HealthCheckWMS `json:"healthCheck,omitempty"`
7172
73+ // Optional list of URLs where the service can be reached
74+ // By default only the spec.service.url is used
75+ IngressRouteURLs smoothoperatormodel.IngressRouteURLs `json:"ingressRouteUrls,omitempty"`
76+
7277 // Service specification
7378 Service WMSService `json:"service"`
7479}
@@ -669,3 +674,11 @@ func (wms *WMS) ReadinessQueryString() (string, string, error) {
669674
670675 return fmt .Sprintf ("SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=%s&CRS=EPSG:28992&WIDTH=100&HEIGHT=100&LAYERS=%s&STYLES=&FORMAT=image/png" , wms .HealthCheckBBox (), firstDataLayerName ), "image/png" , nil
671676}
677+
678+ func (wms * WMS ) IngressRouteURLs () smoothoperatormodel.IngressRouteURLs {
679+ if len (wms .Spec .IngressRouteURLs ) == 0 {
680+ return smoothoperatormodel.IngressRouteURLs {{URL : wms .Spec .Service .URL }}
681+ }
682+
683+ return wms .Spec .IngressRouteURLs
684+ }
0 commit comments