fix: etcd extra args not passed to etcd #248
Merged
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 this PR does / why we need it:
Extra arguments passed to
etcd
are defined inrke2AgentConfig
which is embedded inrke2ServerConfig
. The issue occurs when we generate control plane configuration and populate these two structures, here:rke2ServerConfig
is initialized first andetcd
extra values are successfully passed but thenrke2AgentConfig
is generated and embedded intorke2ServerConfig
which empties the original value ofEtcdArgs
.By moving these
etcd
configuration fields fromrke2AgentConfig
torke2ServerConfig
we can avoid these being overridden without having to apply changes to the existing logic.Which issue(s) this PR fixes:
Fixes #234
Special notes for your reviewer:
While reproducing the bug, creating a
RKE2ControlPlane
with extra arguments foretcd
resulted in an incorrect configuration, as validated from one of the control plane nodes:This aligns with the findings in
GenerateInitControlPlaneConfig
, where the extra arguments are correctly passed torke2ServerConfig
but then deleted after initializingrke2AgentConfig
.After moving the fields to
rke2ServerConfig
, the final RKE2 configuration matches the expected result:Checklist: