Skip to content

Commit fbc6e42

Browse files
author
Jelle Dijkstra
committed
Merged master
2 parents 29ecc13 + 178716c commit fbc6e42

File tree

15 files changed

+354
-1513
lines changed

15 files changed

+354
-1513
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ARG TARGETOS
44
ARG TARGETARCH
55

66
#COPY --from=repos ./smooth-operator /smooth-operator
7-
COPY --from=repos ./ogc-specifications /ogc-specifications
7+
#COPY --from=repos ./ogc-specifications /ogc-specifications
88

99
WORKDIR /workspace
1010
# Copy the Go Modules manifests

cmd/main.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ func init() {
7878
// +kubebuilder:scaffold:scheme
7979
}
8080

81-
// TODO fix linting (cyclop,funlen)
82-
//
83-
//nolint:cyclop,funlen
81+
//nolint:funlen
8482
func main() {
8583
var metricsAddr string
8684
var certDir string
@@ -233,12 +231,6 @@ func main() {
233231
}
234232
}
235233

236-
if os.Getenv("ENABLE_WEBHOOKS") != EnvFalse {
237-
if err = webhookpdoknlv3.SetupWFSWebhookWithManager(mgr); err != nil {
238-
setupLog.Error(err, "unable to create webhook", "webhook", "WFS")
239-
os.Exit(1)
240-
}
241-
}
242234
// +kubebuilder:scaffold:builder
243235

244236
if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {

config/crd/bases/pdok.nl_wfses.yaml

Lines changed: 0 additions & 431 deletions
This file was deleted.

config/crd/bases/pdok.nl_wmses.yaml

Lines changed: 0 additions & 491 deletions
This file was deleted.

config/crd/update_openapi.go

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ func main() {
1818
updateWMSV3Layers(crdDir)
1919
}
2020

21-
// TODO fix linting (funlen)
22-
//
23-
//nolint:funlen
2421
func updateWMSV3Layers(crdDir string) {
2522
path := filepath.Join(crdDir, "pdok.nl_wms.yaml")
2623

@@ -38,44 +35,7 @@ func updateWMSV3Layers(crdDir string) {
3835
versions := make([]v1.CustomResourceDefinitionVersion, 0)
3936
for _, version := range crd.Spec.Versions {
4037
if version.Name == "v3" {
41-
schema := version.Schema.OpenAPIV3Schema
42-
spec := schema.Properties["spec"]
43-
service := spec.Properties["service"]
44-
layer := service.Properties["layer"]
45-
46-
// Level 3
47-
layerSpecLevel3 := layer.DeepCopy()
48-
layerSpecLevel3.Required = append(layerSpecLevel3.Required, "name")
49-
delete(layerSpecLevel3.Properties, "layers")
50-
xvals := v1.ValidationRules{}
51-
for _, xval := range layerSpecLevel3.XValidations {
52-
if !strings.Contains(xval.Rule, "self.layers") {
53-
xvals = append(xvals, xval)
54-
}
55-
}
56-
layerSpecLevel3.XValidations = xvals
57-
58-
// Level 2
59-
layerSpecLevel2 := layer.DeepCopy()
60-
layerSpecLevel2.Required = append(layerSpecLevel2.Required, "name")
61-
layerSpecLevel2.Properties["layers"] = v1.JSONSchemaProps{
62-
Type: "array",
63-
Description: "[OpenAPI spec injected by mapserver-operator/cmd/update_openapi.go]",
64-
Items: &v1.JSONSchemaPropsOrArray{Schema: layerSpecLevel3},
65-
}
66-
67-
layer.Properties["layers"] = v1.JSONSchemaProps{
68-
Type: "array",
69-
Description: "[OpenAPI spec injected by mapserver-operator/cmd/update_openapi.go]",
70-
Items: &v1.JSONSchemaPropsOrArray{Schema: layerSpecLevel2},
71-
}
72-
73-
service.Properties["layer"] = layer
74-
spec.Properties["service"] = service
75-
schema.Properties["spec"] = spec
76-
version.Schema = &v1.CustomResourceValidation{
77-
OpenAPIV3Schema: schema,
78-
}
38+
updateLayersV3(&version)
7939

8040
versions = append(versions, version)
8141
} else {
@@ -100,3 +60,44 @@ func updateWMSV3Layers(crdDir string) {
10060
enc.SetIndent(2)
10161
_ = enc.Encode(rawData)
10262
}
63+
64+
func updateLayersV3(version *v1.CustomResourceDefinitionVersion) {
65+
schema := version.Schema.OpenAPIV3Schema
66+
spec := schema.Properties["spec"]
67+
service := spec.Properties["service"]
68+
layer := service.Properties["layer"]
69+
70+
// Level 3
71+
layerSpecLevel3 := layer.DeepCopy()
72+
layerSpecLevel3.Required = append(layerSpecLevel3.Required, "name")
73+
delete(layerSpecLevel3.Properties, "layers")
74+
xvals := v1.ValidationRules{}
75+
for _, xval := range layerSpecLevel3.XValidations {
76+
if !strings.Contains(xval.Rule, "self.layers") {
77+
xvals = append(xvals, xval)
78+
}
79+
}
80+
layerSpecLevel3.XValidations = xvals
81+
82+
// Level 2
83+
layerSpecLevel2 := layer.DeepCopy()
84+
layerSpecLevel2.Required = append(layerSpecLevel2.Required, "name")
85+
layerSpecLevel2.Properties["layers"] = v1.JSONSchemaProps{
86+
Type: "array",
87+
Description: "[OpenAPI spec injected by mapserver-operator/cmd/update_openapi.go]",
88+
Items: &v1.JSONSchemaPropsOrArray{Schema: layerSpecLevel3},
89+
}
90+
91+
layer.Properties["layers"] = v1.JSONSchemaProps{
92+
Type: "array",
93+
Description: "[OpenAPI spec injected by mapserver-operator/cmd/update_openapi.go]",
94+
Items: &v1.JSONSchemaPropsOrArray{Schema: layerSpecLevel2},
95+
}
96+
97+
service.Properties["layer"] = layer
98+
spec.Properties["service"] = service
99+
schema.Properties["spec"] = spec
100+
version.Schema = &v1.CustomResourceValidation{
101+
OpenAPIV3Schema: schema,
102+
}
103+
}

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/onsi/gomega v1.36.2
1313
github.com/pdok/featureinfo-generator v1.4.0-beta1
1414
github.com/pdok/ogc-capabilities-generator v1.0.0-beta7
15-
github.com/pdok/ogc-specifications v1.0.0-beta7
15+
github.com/pdok/ogc-specifications v1.0.0-beta9
1616
github.com/pdok/smooth-operator v0.1.1
1717
github.com/peterbourgon/ff v1.7.1
1818
github.com/stretchr/testify v1.10.0
@@ -24,8 +24,6 @@ require (
2424
sigs.k8s.io/yaml v1.4.0
2525
)
2626

27-
replace github.com/pdok/ogc-specifications => ../ogc-specifications
28-
2927
replace github.com/abbot/go-http-auth => github.com/abbot/go-http-auth v0.4.0 // for github.com/traefik/traefik/v3
3028

3129
require (

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ github.com/pdok/featureinfo-generator v1.4.0-beta1 h1:ZZO5OtK7yW5ozXFrl1OaxKl0MK
153153
github.com/pdok/featureinfo-generator v1.4.0-beta1/go.mod h1:02Ryu7ZRkeha8SCfS6VYWCdKYZh0llskrfFgp6xRCjk=
154154
github.com/pdok/ogc-capabilities-generator v1.0.0-beta7 h1:w0dP2RQX0KEEovrq57NCM1w+Hlizg9mQlgdRBEqKX2g=
155155
github.com/pdok/ogc-capabilities-generator v1.0.0-beta7/go.mod h1:slk89sAgmWU5NCIKwGyciQWnm0RHmwhJYQ431E2CwSk=
156-
github.com/pdok/ogc-specifications v1.0.0-beta7 h1:AFSO8iCYbD1MrjOS2q+PGp2PmSqAH+O7cuA7JeePCXE=
157-
github.com/pdok/ogc-specifications v1.0.0-beta7/go.mod h1:YDngwkwrWOfc5MYnEYseiv97K1Y9bZXlVzwi/8EaIl8=
156+
github.com/pdok/ogc-specifications v1.0.0-beta9 h1:VrdggKg4d2tSway/deztAfZTviXKX0AftfUuZTXx5j8=
157+
github.com/pdok/ogc-specifications v1.0.0-beta9/go.mod h1:YDngwkwrWOfc5MYnEYseiv97K1Y9bZXlVzwi/8EaIl8=
158158
github.com/pdok/smooth-operator v0.1.1 h1:rmsup4HmzJsxt4ZT9GWfj498dKLRfDhyuILeEkjju/A=
159159
github.com/pdok/smooth-operator v0.1.1/go.mod h1:przwM7mBGmNPqabyhImKVZ15WL4zbqLqH4ExbuWKhWE=
160160
github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys=

internal/controller/capabilitiesgenerator/bbox.go renamed to internal/controller/capabilitiesgenerator/default_bboxes.go

File renamed without changes.

0 commit comments

Comments
 (0)