Repository navigation
feat(loadbalancer): add labels - #1827
Open
ibrahimyesilay wants to merge 1 commit into
Open
ibrahimyesilay wants to merge 1 commit into
ibrahimyesilay wants to merge 1 commit into
Conversation
The Network Load Balancer API supports user-defined labels on create and update, but stackit_loadbalancer did not expose them. Add `labels` to the resource and the data source, following stackit_application_load_balancer. An empty label map returned by the API is mapped to null, so a configuration without labels does not produce an inconsistent result. relates to stackitcloud#1825
This branch has not been deployed
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.
Description
relates to #1825
Adds
labelstostackit_loadbalancer(resource and data source). The Network Load Balancer API already accepts labels on create and update (CreateLoadBalancerPayload.Labels,UpdateLoadBalancerPayload.Labels).The schema and validators follow
stackit_application_load_balancer, with two differences:LengthBetween(0, 63)), as documented for the NLB API.null, so a configuration without labels does not end up with{}in state.This is the second part of #1825; the health check options are in #1826. Both PRs touch the same files, so whichever is merged second will need a rebase — happy to do that.
Testing
toCreatePayload,toUpdatePayloadandmapFields, plus a newTest_mapLabels.TestAccLoadBalancerResourceMaxextended with labels (create, data source and update step changing the label value) and run against a STACKIT project: PASS.make fmt,make lint,make test,make generate-docspass locally.labelsfrom an existing load balancer. The update call sends the full load balancer, so omittinglabelsshould clear them, but I did not verify this against the API.Checklist
make fmtexamples/directory)make generate-docs(will be checked by CI)make test(will be checked by CI)make lint(will be checked by CI)