refactor: use a spec model for annotation extraction - #1329
Draft
lukasmetzner wants to merge 2 commits into
Draft
Conversation
Introduce internal/lbspec, which resolves a Service and the cluster-wide configuration into a Spec describing the desired state, and which builds the API opts from it. - An invalid annotation now fails the whole reconcilement instead of only the step that happened to read it. A typo in an HTTP annotation therefore also stops node targets from being updated. - The remaining 5 hclbServiceOptsBuilder op label values disappear from hcloud_ccm_operations_total, and resolveCertificates is added. - Certificates are resolved once per Service rather than once per port, and on the reconcile context instead of a detached 5s timeout. - An empty name annotation no longer tries to rename the Load Balancer to the empty string, and an empty hostname annotation no longer publishes an empty hostname as the ingress address. - private-ipv4 is parsed, so the private network address is compared as an address rather than as the literal annotation text.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## split/core-a-typed-annotations #1329 +/- ##
==================================================================
- Coverage 70.11% 69.07% -1.05%
==================================================================
Files 29 32 +3
Lines 2794 2658 -136
==================================================================
- Hits 1959 1836 -123
- Misses 643 658 +15
+ Partials 192 164 -28
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Introduce
internal/lbspec, which resolves a Service and the cluster-wideconfiguration into a Spec describing the desired state, and which builds the
API opts from it.
step that happened to read it. A typo in an HTTP annotation therefore also
stops node targets from being updated.
hcloud_ccm_operations_total, andresolveCertificatesis added.on the reconcile context instead of a detached 5s timeout.
empty string, and an empty hostname annotation no longer publishes an empty
hostname as the ingress address.
private-ipv4is parsed, so the private network address is compared as anaddress rather than as the literal annotation text.