feat: add use_internal_ca_certs option for local_auth_endpoint #1626
+197
−40
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.
Issue
Resolves #1299
Problem
When enabling the
local_auth_endpoint
for a cluster, users could not opt into using the internally generated CA certificate.Attempting to retrieve the CA certificate through a
data.rancher2_cluster
data source led to a dependency cycle, and only an external CA could be configured directly.Solution
use_internal_ca_certs
boolean flag inside thelocal_auth_endpoint
block, mutually exclusive withca_certs
.use_internal_ca_certs
is true during create, update, and read operations.Testing
Engineering Testing
make build
to compile the provider.go test ./rancher2 -run TestExpandClusterV2LocalAuthEndpoint -count=1 -v
after enabling the new flag.make test
to confirm all unit tests pass with the new logic.Automated Testing
TestExpandClusterV2LocalAuthEndpoint
and updated existing tests to assert state preservation ofuse_internal_ca_certs
.ca_certs
anduse_internal_ca_certs
.QA Testing Considerations
use_internal_ca_certs
on a cluster withlocal_auth_endpoint
correctly pulls internal CA data without requiring explicitca_certs
.ca_certs
should behave unchanged, while togglinguse_internal_ca_certs
should swap to internal CA seamlessly.Regressions Considerations
local_auth_endpoint
fields; verify that state refresh and plan outputs remain stable.use_internal_ca_certs
with other cluster CA options.