feat: end to end testing with local provider implementation #5933
+1,225
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does it do ?
This pull request implements end to end testing by using a new custom local provider that saves records in memory. The idea behind this is that the new local provider, configured as a webhook, will create records in memory based on the usual Kubernetes resources. The same code exposes a minimal implementation of a DNS server. We can then query directly this minimal DNS server to verify that external DNS did its job. This idea allows us to implement end-to-end testing without having to issue certificates or creating real domains. The script can be launched with a bash script, and are wrapped in GitHub actions to be executed on GitHub.
Motivation
We have custom end-to-end testing infrastructure since almost the beginning of this project that I've been maintaining myself. That infrastructure has relied on an AWS account, and a private zone. Unfortunately, due to security requirements, I cannot make that infrastructure available to the bigger project, and that meant that I was always the bottleneck to run end to end tests. The motivation behind this work is to stop using that infrastructure and relying only on kind and local tests.
#5601
More
I went through a lot of ideas also using the /etc/hosts file which is not possible for a number of reasons in Kubernetes and other possible alternatives. This is what I landed to and the code is probably not perfect. I would love anyway for feedback and I will keep this and as draft until I will have received this feedback.