feat: add use_internal_ca_certs option for local_auth_endpoint #1626
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_endpointfor a cluster, users could not opt into using the internally generated CA certificate.Attempting to retrieve the CA certificate through a
data.rancher2_clusterdata source led to a dependency cycle, and only an external CA could be configured directly.Solution
use_internal_ca_certsboolean flag inside thelocal_auth_endpointblock, mutually exclusive withca_certs.use_internal_ca_certsis true during create, update, and read operations.Testing
Engineering Testing
make buildto compile the provider.go test ./rancher2 -run TestExpandClusterV2LocalAuthEndpoint -count=1 -vafter enabling the new flag.make testto confirm all unit tests pass with the new logic.Automated Testing
TestExpandClusterV2LocalAuthEndpointand updated existing tests to assert state preservation ofuse_internal_ca_certs.ca_certsanduse_internal_ca_certs.QA Testing Considerations
use_internal_ca_certson a cluster withlocal_auth_endpointcorrectly pulls internal CA data without requiring explicitca_certs.ca_certsshould behave unchanged, while togglinguse_internal_ca_certsshould swap to internal CA seamlessly.Regressions Considerations
local_auth_endpointfields; verify that state refresh and plan outputs remain stable.use_internal_ca_certswith other cluster CA options.