Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/google/go-cmp v0.7.0
github.com/onsi/ginkgo/v2 v2.22.1
github.com/onsi/gomega v1.36.2
github.com/pdok/atom-generator v0.6.3
github.com/pdok/atom-generator v0.6.4
github.com/pdok/smooth-operator v0.1.1
github.com/peterbourgon/ff v1.7.1
github.com/pkg/errors v0.9.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8=
github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY=
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/pdok/atom-generator v0.6.3 h1:wg491zQAokf6ePr1HcfVpF3mhMG2WroFPFpu14cX6Y0=
github.com/pdok/atom-generator v0.6.3/go.mod h1:IlPwti5ocXDTjB4xmz0ZpHCOW/suuW5gQMfjfwPX6uM=
github.com/pdok/atom-generator v0.6.4 h1:UpTTSKskdWLnxTAhSNOlz8dF2tBousD97V03kWzCV2k=
github.com/pdok/atom-generator v0.6.4/go.mod h1:IlPwti5ocXDTjB4xmz0ZpHCOW/suuW5gQMfjfwPX6uM=
github.com/pdok/smooth-operator v0.1.1 h1:rmsup4HmzJsxt4ZT9GWfj498dKLRfDhyuILeEkjju/A=
github.com/pdok/smooth-operator v0.1.1/go.mod h1:przwM7mBGmNPqabyhImKVZ15WL4zbqLqH4ExbuWKhWE=
github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys=
Expand Down
21 changes: 9 additions & 12 deletions internal/controller/ingressroute.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,10 @@ func (r *AtomReconciler) mutateIngressRoute(atom *pdoknlv3.Atom, ingressRoute *t
},
Middlewares: []traefikiov1alpha1.MiddlewareRef{
{
Name: atom.Name + headersSuffix,
Namespace: atom.GetNamespace(),
Name: atom.Name + headersSuffix,
},
{
Name: atom.Name + stripPrefixSuffix,
Namespace: atom.GetNamespace(),
Name: atom.Name + stripPrefixSuffix,
},
},
},
Expand Down Expand Up @@ -90,8 +88,7 @@ func (r *AtomReconciler) mutateIngressRoute(atom *pdoknlv3.Atom, ingressRoute *t
},
Middlewares: []traefikiov1alpha1.MiddlewareRef{
{
Name: atom.Name + headersSuffix,
Namespace: atom.GetNamespace(),
Name: atom.Name + headersSuffix,
},
},
}
Expand All @@ -100,8 +97,7 @@ func (r *AtomReconciler) mutateIngressRoute(atom *pdoknlv3.Atom, ingressRoute *t
// Set additional Azure storage middleware per download link
for _, group := range getDownloadLinkGroups(atom.GetDownloadLinks()) {
middlewareRef := traefikiov1alpha1.MiddlewareRef{
Name: atom.Name + downloadsSuffix + strconv.Itoa(*group.index),
Namespace: atom.GetNamespace(),
Name: atom.Name + downloadsSuffix + strconv.Itoa(*group.index),
}
downloadMiddlewares = append(downloadMiddlewares, middlewareRef)
}
Expand All @@ -114,6 +110,9 @@ func (r *AtomReconciler) mutateIngressRoute(atom *pdoknlv3.Atom, ingressRoute *t

ingressRoute.Spec.Routes = append(ingressRoute.Spec.Routes, azureStorageRule)

// Add finalizers
ingressRoute.Finalizers = []string{"uptime.pdok.nl/finalizer"}

if err := smoothutil.EnsureSetGVK(r.Client, ingressRoute, ingressRoute); err != nil {
return err
}
Expand Down Expand Up @@ -145,12 +144,10 @@ func getDefaultRule(atom *pdoknlv3.Atom, matchRule string) traefikiov1alpha1.Rou
},
Middlewares: []traefikiov1alpha1.MiddlewareRef{
{
Name: atom.Name + headersSuffix,
Namespace: atom.GetNamespace(),
Name: atom.Name + headersSuffix,
},
{
Name: atom.Name + stripPrefixSuffix,
Namespace: atom.GetNamespace(),
Name: atom.Name + stripPrefixSuffix,
},
},
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: maximum-atom-generator-mg8kmkb7c8
name: maximum-atom-generator-f9tftfg7bh
namespace: default
labels:
test: test
Expand Down Expand Up @@ -30,21 +30,17 @@ data:
subtitle: service-subtitle
link:
- href: https://test.com/path/index.xml
data: null
rel: self
type: application/atom+xml
title: service-title
- href: https://test.com/csw?uuid=00000000-0000-0000-0000-000000000000
data: null
rel: describedby
type: application/xml
- href: https://test.com/html/00000000-0000-0000-0000-000000000000
data: null
rel: related
type: text/html
title: NGR pagina voor deze download service
- href: https://test.com/open/00000000-0000-0000-0000-000000000000.xml
data: null
rel: search
type: application/opensearchdescription+xml
title: Open Search document voor INSPIRE Download service PDOK
Expand All @@ -58,11 +54,9 @@ data:
summary: feed-1-subtitle
link:
- href: https://test.com/csw?uuid=00000000-0000-0000-0000-000000000001
data: null
rel: describedby
type: application/xml
- href: https://test.com/path/feed-1.xml
data: null
rel: alternate
type: application/atom+xml
title: feed-1-title
Expand All @@ -79,11 +73,9 @@ data:
summary: feed-2-subtitle
link:
- href: https://test.com/csw?uuid=00000000-0000-0000-0000-000000000003
data: null
rel: describedby
type: application/xml
- href: https://test.com/path/feed-2.xml
data: null
rel: alternate
type: application/atom+xml
title: feed-2-title
Expand All @@ -104,24 +96,19 @@ data:
subtitle: feed-1-subtitle
link:
- href: https://test.com/path/feed-1.xml
data: null
rel: self
- href: https://test.com/path/index.xml
data: null
rel: up
type: application/atom+xml
title: Top Atom Download Service Feed
- href: https://test.com/csw?uuid=00000000-0000-0000-0000-000000000001
data: null
rel: describedby
type: application/xml
- href: https://test.com/html/00000000-0000-0000-0000-000000000001
data: null
rel: related
type: text/html
title: NGR pagina voor deze dataset
- href: https://test.com/encodingrule.pdf
data: null
rel: encodingRule
type: application/pdf
hreflang: en
Expand Down Expand Up @@ -176,19 +163,15 @@ data:
subtitle: feed-2-subtitle
link:
- href: https://test.com/path/feed-2.xml
data: null
rel: self
- href: https://test.com/path/index.xml
data: null
rel: up
type: application/atom+xml
title: Top Atom Download Service Feed
- href: https://test.com/csw?uuid=00000000-0000-0000-0000-000000000003
data: null
rel: describedby
type: application/xml
- href: https://test.com/html/00000000-0000-0000-0000-000000000003
data: null
rel: related
type: text/html
title: NGR pagina voor deze dataset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ metadata:
uid: ""
blockOwnerDeletion: true
controller: true
finalizers:
- uptime.pdok.nl/finalizer
spec:
routes:
- kind: Rule
Expand All @@ -28,9 +30,7 @@ spec:
port: 80
middlewares:
- name: maximum-atom-headers
namespace: default
- name: maximum-atom-prefixstrip
namespace: default
- kind: Rule
match: (Host(`localhost`) || Host(`test.com`)) && Path(`/path/feed-1.xml`)
services:
Expand All @@ -39,9 +39,7 @@ spec:
port: 80
middlewares:
- name: maximum-atom-headers
namespace: default
- name: maximum-atom-prefixstrip
namespace: default
- kind: Rule
match: (Host(`localhost`) || Host(`test.com`)) && Path(`/path/feed-2.xml`)
services:
Expand All @@ -50,9 +48,7 @@ spec:
port: 80
middlewares:
- name: maximum-atom-headers
namespace: default
- name: maximum-atom-prefixstrip
namespace: default
- kind: Rule
match: (Host(`localhost`) || Host(`test.com`)) && PathPrefix(`/path/downloads/`)
services:
Expand All @@ -62,10 +58,6 @@ spec:
passHostHeader: false
middlewares:
- name: maximum-atom-headers
namespace: default
- name: maximum-atom-downloads-0
namespace: default
- name: maximum-atom-downloads-1
namespace: default
- name: maximum-atom-downloads-2
namespace: default
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: minimal-atom-generator-tmk22c7fm9
name: minimal-atom-generator-fd8bdfdkh6
namespace: default
labels:
test: test
Expand Down Expand Up @@ -30,7 +30,6 @@ data:
subtitle: service-subtitle
link:
- href: https://test.com/path/index.xml
data: null
rel: self
type: application/atom+xml
title: service-title
Expand All @@ -44,7 +43,6 @@ data:
summary: feed-subtitle
link:
- href: https://test.com/path/feed.xml
data: null
rel: alternate
type: application/atom+xml
title: feed-title
Expand All @@ -63,10 +61,8 @@ data:
subtitle: feed-subtitle
link:
- href: https://test.com/path/feed.xml
data: null
rel: self
- href: https://test.com/path/index.xml
data: null
rel: up
type: application/atom+xml
title: Top Atom Download Service Feed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ metadata:
uid: ""
blockOwnerDeletion: true
controller: true
finalizers:
- uptime.pdok.nl/finalizer
spec:
routes:
- kind: Rule
Expand All @@ -28,9 +30,7 @@ spec:
port: 80
middlewares:
- name: minimal-atom-headers
namespace: default
- name: minimal-atom-prefixstrip
namespace: default
- kind: Rule
match: (Host(`localhost`) || Host(`test.com`)) && Path(`/path/feed.xml`)
services:
Expand All @@ -39,9 +39,7 @@ spec:
port: 80
middlewares:
- name: minimal-atom-headers
namespace: default
- name: minimal-atom-prefixstrip
namespace: default
- kind: Rule
match: (Host(`localhost`) || Host(`test.com`)) && PathPrefix(`/path/downloads/`)
services:
Expand All @@ -51,6 +49,4 @@ spec:
passHostHeader: false
middlewares:
- name: minimal-atom-headers
namespace: default
- name: minimal-atom-downloads-0
namespace: default
Loading