Skip to content

Commit b7de593

Browse files
author
Jelle Dijkstra
committed
Merge branch 'master' into jd/fixes
2 parents 3f517d7 + f61819c commit b7de593

File tree

17 files changed

+26
-875
lines changed

17 files changed

+26
-875
lines changed

api/v2beta1/wfs_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
3333

3434
// +kubebuilder:object:root=true
35-
// +kubebuilder:subresource:status
35+
// +kubebuilder:skipversion
3636

3737
// WFS is the Schema for the wfs API.
3838
type WFS struct {

api/v2beta1/wms_conversion.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ package v2beta1
2727
import (
2828
"errors"
2929
"log"
30+
"slices"
3031
"strconv"
3132
"strings"
3233

@@ -153,6 +154,16 @@ func (src *WMS) ToV3(target *pdoknlv3.WMS) error {
153154
Keys: cm.Keys,
154155
})
155156
}
157+
158+
if len(src.Spec.Service.StylingAssets.ConfigMapRefs) == 1 {
159+
for _, layer := range src.Spec.Service.Layers {
160+
for _, style := range layer.Styles {
161+
if style.Visualization != nil && !slices.Contains(src.Spec.Service.StylingAssets.ConfigMapRefs[0].Keys, *style.Visualization) {
162+
src.Spec.Service.StylingAssets.ConfigMapRefs[0].Keys = append(src.Spec.Service.StylingAssets.ConfigMapRefs[0].Keys, *style.Visualization)
163+
}
164+
}
165+
}
166+
}
156167
}
157168

158169
dst.Spec.Service = service

api/v2beta1/wms_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
3434

3535
// +kubebuilder:object:root=true
36-
// +kubebuilder:subresource:status
36+
// +kubebuilder:skipversion
3737

3838
// WMS is the Schema for the wms API.
3939
type WMS struct {

cmd/main.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ import (
4646
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
4747
"sigs.k8s.io/controller-runtime/pkg/webhook"
4848

49-
pdoknlv2beta1 "github.com/pdok/mapserver-operator/api/v2beta1"
5049
pdoknlv3 "github.com/pdok/mapserver-operator/api/v3"
5150
"github.com/pdok/mapserver-operator/internal/controller"
5251
webhookpdoknlv3 "github.com/pdok/mapserver-operator/internal/webhook/v3"
@@ -76,7 +75,6 @@ func init() {
7675
utilruntime.Must(traefikiov1alpha1.AddToScheme(scheme))
7776
utilruntime.Must(smoothoperatorv1.AddToScheme(scheme))
7877
utilruntime.Must(pdoknlv3.AddToScheme(scheme))
79-
utilruntime.Must(pdoknlv2beta1.AddToScheme(scheme))
8078
// +kubebuilder:scaffold:scheme
8179
}
8280

config/crd/bases/pdok.nl_wfs.yaml

Lines changed: 0 additions & 399 deletions
Large diffs are not rendered by default.

config/crd/bases/pdok.nl_wms.yaml

Lines changed: 0 additions & 455 deletions
Large diffs are not rendered by default.

config/crd/kustomization.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ resources:
66
- bases/pdok.nl_wfs.yaml
77
# +kubebuilder:scaffold:crdkustomizeresource
88

9-
patches:
9+
# patches:
1010
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
1111
# patches here are for enabling the conversion webhook for each CRD
12-
- path: patches/webhook_in_wfs.yaml
13-
- path: patches/webhook_in_wms.yaml
12+
# - path: patches/webhook_in_wfs.yaml
13+
# - path: patches/webhook_in_wms.yaml
1414
# +kubebuilder:scaffold:crdkustomizewebhookpatch
1515

1616
# [WEBHOOK] To enable webhook, uncomment the following section

internal/controller/mapfilegenerator/mapper.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import (
77

88
"github.com/pdok/mapserver-operator/internal/controller/constants"
99

10-
"github.com/pdok/mapserver-operator/api/v2beta1"
11-
1210
pdoknlv3 "github.com/pdok/mapserver-operator/api/v3"
1311
"github.com/pdok/mapserver-operator/internal/controller/mapperutils"
1412
smoothoperatorv1 "github.com/pdok/smooth-operator/api/v1"
@@ -152,11 +150,9 @@ func MapWMSToMapfileGeneratorInput(wms *pdoknlv3.WMS, ownerInfo *smoothoperatorv
152150
maxSize = strconv.Itoa(int(*service.MaxSize))
153151
}
154152

155-
var metadataID string
153+
metadataID := ""
156154
if service.Inspire != nil {
157155
metadataID = service.Inspire.ServiceMetadataURL.CSW.MetadataIdentifier
158-
} else {
159-
metadataID = wms.ObjectMeta.Annotations[v2beta1.ServiceMetatdataIdentifierAnnotation]
160156
}
161157

162158
var fonts *string

internal/controller/mapfilegenerator/test_data/expected/wms_group_and_toplayer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@
604604
"service_accessconstraints": "https://creativecommons.org/publicdomain/zero/1.0/deed.nl",
605605
"service_extent": "-25000 250000 280000 860000",
606606
"service_keywords": "Kadaster,Kadastrale percelen,Kadastrale grens,Kadastrale kaart,Bebouwing,Nummeraanduidingreeks,Openbare ruimte naam,Perceel,Grens,Kwaliteit,Kwaliteitslabels,HVD,Geospatiale data",
607-
"service_metadata_id": "97cf6a64-9cfc-4ce6-9741-2db44fd27fca",
607+
"service_metadata_id": "",
608608
"service_namespace_prefix": "kadastralekaart",
609609
"service_namespace_uri": "http://kadastralekaart.geonovum.nl",
610610
"service_onlineresource": "https://service.pdok.nl",

internal/controller/mapfilegenerator/test_data/expected/wms_postgis.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"service_accessconstraints": "https://creativecommons.org/publicdomain/zero/1.0/deed.nl",
8181
"service_extent": "-7000 289000 300000 629000",
8282
"service_keywords": "Basisregistratie Topografie,BRT,terugmeldingen,TOP10NL,TOP25,TOP50,TOP100,TOP250,in onderzoek register,verbeter de kaart,verbeterdekaart",
83-
"service_metadata_id": "fa069f74-9837-4d63-b2ac-b337b5de86b1",
83+
"service_metadata_id": "",
8484
"service_namespace_prefix": "terugmeldingen",
8585
"service_namespace_uri": "http://terugmeldingen.geonovum.nl",
8686
"service_onlineresource": "https://service.pdok.nl",

0 commit comments

Comments
 (0)