Skip to content

Commit d9f72c9

Browse files
author
Jelle Dijkstra
committed
WMS/WFS generics
1 parent ffef8b2 commit d9f72c9

32 files changed

+518
-325
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
**Build and push your image to the location specified by `IMG`:**
1717

1818
```sh
19-
make docker-build docker-push IMG=<some-registry>/configmap_files-operator:tag
19+
make docker-build docker-push IMG=<some-registry>/mapserver-operator:tag
2020
```
2121

2222
**NOTE:** This image ought to be published in the personal registry you specified.
@@ -32,7 +32,7 @@ make install
3232
**Deploy the Manager to the cluster with the image specified by `IMG`:**
3333

3434
```sh
35-
make deploy IMG=<some-registry>/configmap_files-operator:tag
35+
make deploy IMG=<some-registry>/mapserver-operator:tag
3636
```
3737

3838
> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin
@@ -75,7 +75,7 @@ Following the options to release and provide this solution to the users.
7575
1. Build the installer for the image built and published in the registry:
7676

7777
```sh
78-
make build-installer IMG=<some-registry>/configmap_files-operator:tag
78+
make build-installer IMG=<some-registry>/mapserver-operator:tag
7979
```
8080

8181
**NOTE:** The makefile target mentioned above generates an 'install.yaml'
@@ -89,7 +89,7 @@ Users can just run 'kubectl apply -f <URL for YAML BUNDLE>' to install
8989
the project, i.e.:
9090

9191
```sh
92-
kubectl apply -f https://raw.githubusercontent.com/<org>/configmap_files-operator/<tag or branch>/dist/install.yaml
92+
kubectl apply -f https://raw.githubusercontent.com/<org>/mapserver-operator/<tag or branch>/dist/install.yaml
9393
```
9494

9595
### By providing a Helm Chart

api/v2beta1/wms_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ type StylingAssets struct {
109109
BlobKeys []string `json:"blobKeys,omitempty"`
110110
}
111111

112-
// ConfigMapRef contains all the config map name and all keys in that configmap_files that are relevant
112+
// ConfigMapRef contains all the config map name and all keys in that mapserver that are relevant
113113
// the Keys can be empty, so that the v1 WMS can convert to the v2beta1 WMS
114114
type ConfigMapRef struct {
115115
Name string `json:"name"`

api/v3/shared_types.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,33 @@
11
package v3
22

33
import (
4+
autoscalingv2 "k8s.io/api/autoscaling/v2"
45
corev1 "k8s.io/api/core/v1"
6+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
57
"net/url"
68
"strings"
79
)
810

911
var host string
1012

13+
type ServiceType string
14+
15+
const (
16+
ServiceTypeWMS ServiceType = "WMS"
17+
ServiceTypeWFS ServiceType = "WFS"
18+
)
19+
20+
type WMSWFS interface {
21+
*WFS | *WMS
22+
metav1.Object
23+
24+
Mapfile() *Mapfile
25+
PodSpecPatch() *corev1.PodSpec
26+
HorizontalPodAutoscalerPatch() *autoscalingv2.HorizontalPodAutoscalerSpec
27+
Type() ServiceType
28+
Options() *Options
29+
}
30+
1131
type Mapfile struct {
1232
ConfigMapKeyRef corev1.ConfigMapKeySelector `json:"configMapKeyRef"`
1333
}

api/v3/wfs_types.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,23 @@ func (wfs *WFS) HasPostgisData() bool {
126126
}
127127
return false
128128
}
129+
130+
func (wfs *WFS) Mapfile() *Mapfile {
131+
return wfs.Spec.Service.Mapfile
132+
}
133+
134+
func (wfs *WFS) Type() ServiceType {
135+
return ServiceTypeWFS
136+
}
137+
138+
func (wfs *WFS) PodSpecPatch() *corev1.PodSpec {
139+
return wfs.Spec.PodSpecPatch
140+
}
141+
142+
func (wfs *WFS) HorizontalPodAutoscalerPatch() *autoscalingv2.HorizontalPodAutoscalerSpec {
143+
return wfs.Spec.HorizontalPodAutoscalerPatch
144+
}
145+
146+
func (wfs *WFS) Options() *Options {
147+
return wfs.Spec.Options
148+
}

api/v3/wms_types.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,3 +233,23 @@ func (wms *WMS) GetAuthority() *Authority {
233233

234234
return nil
235235
}
236+
237+
func (wms *WMS) Mapfile() *Mapfile {
238+
return wms.Spec.Service.Mapfile
239+
}
240+
241+
func (wms *WMS) Type() ServiceType {
242+
return ServiceTypeWMS
243+
}
244+
245+
func (wms *WMS) PodSpecPatch() *corev1.PodSpec {
246+
return wms.Spec.PodSpecPatch
247+
}
248+
249+
func (wms *WMS) HorizontalPodAutoscalerPatch() *autoscalingv2.HorizontalPodAutoscalerSpec {
250+
return wms.Spec.HorizontalPodAutoscalerPatch
251+
}
252+
253+
func (wms *WMS) Options() *Options {
254+
return wms.Spec.Options
255+
}

cmd/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func main() {
9595
flag.StringVar(&metricsCertKey, "metrics-cert-key", "tls.key", "The name of the metrics server key file.")
9696
flag.BoolVar(&enableHTTP2, "enable-http2", false,
9797
"If set, HTTP/2 will be enabled for the metrics and webhook servers")
98-
flag.StringVar(&host, "baseurl", "", "The host which is used in the configmap_files service.")
98+
flag.StringVar(&host, "baseurl", "", "The host which is used in the mapserver service.")
9999
flag.StringVar(&multitoolImage, "multitool-image", defaultMultitoolImage, "The image to use in the blob download init-container.")
100100
flag.StringVar(&mapfileGeneratorImage, "mapfile-generator-image", defaultMapfileGeneratorImage, "The image to use in the mapfile generator init-container.")
101101
flag.StringVar(&capabilitiesGeneratorImage, "capabilities-generator-image", defaultCapabilitiesGeneratorImage, "The image to use in the capabilities generator init-container.")

config/crd/bases/pdok.nl_wms.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ spec:
383383
configMapRefs:
384384
items:
385385
description: |-
386-
ConfigMapRef contains all the config map name and all keys in that configmap_files that are relevant
386+
ConfigMapRef contains all the config map name and all keys in that mapserver that are relevant
387387
the Keys can be empty, so that the v1 WMS can convert to the v2beta1 WMS
388388
properties:
389389
keys:

config/default/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace: services
66
# "wordpress" becomes "alices-wordpress".
77
# Note that it should also match with the prefix (text before '-') of the namespace
88
# field above.
9-
namePrefix: configmap_files-operator-
9+
namePrefix: mapserver-operator-
1010

1111
# Labels to add to all resources and selectors.
1212
#labels:

config/manager/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
44
kind: Kustomization
55
images:
66
- name: controller
7-
newName: local-registry:5000/configmap_files-operator
7+
newName: local-registry:5000/mapserver-operator
88
newTag: v3.0.10

config/prometheus/monitor.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ spec:
2424
selector:
2525
matchLabels:
2626
control-plane: controller-manager
27-
app.kubernetes.io/name: configmap_files-operator
27+
app.kubernetes.io/name: mapserver-operator

0 commit comments

Comments
 (0)