ori-edge / k8s_gateway

A CoreDNS plugin to resolve all types of external Kubernetes resources
Apache License 2.0
316 stars 65 forks source link

Allow root zone queries and fall through #37

Closed cubic3d closed 3 years ago

cubic3d commented 3 years ago

This PR allows to query the zone root domain and fall through if it doesn't match a resource.

Tests needs to be adjusted after agreement on actual behaviour.

Fixes #35

networkop commented 3 years ago

@cubic3d thanks for the PR, can you add some tests to this ? It'd be easier to see the corner cases.

cubic3d commented 3 years ago

Sure, as soon as time allows ;)

networkop commented 3 years ago

@cubic3d check out this commit https://github.com/ori-edge/k8s_gateway/commit/5966d8d6bfa9dcb6a1093b953dfe27e316f3ac8b I've made some changes to make your PR pass the existing tests. I for some reason couldn't push into this PR so created another branch instead.

So now you just need to add a set of tests to cover the fallthrough behaviour

cubic3d commented 3 years ago

Thank you, strange that you can't push - edits are allowed. I'll get back to it at weekend.

cubic3d commented 3 years ago

I cherry picked your commit from the branch and added some tests, but not sure why you changed the order of https://github.com/ori-edge/k8s_gateway/blob/77867eeef082241095bf6eeb14a58c5a2f94c8cd/gateway.go#L133-L149 which results in inability of responding to gw apex queries if fall through is enabled. I considered it just as a static match, that matches always. So last test currently fails, not sure about fixing the behaviour or test ;)

networkop commented 3 years ago

thanks, will check it out later this week

networkop commented 3 years ago

LGTM. how does it look to you @cubic3d ?

cubic3d commented 3 years ago

LGTM too! Thank you! I'll mark ready