-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for machine_selector_files #1225
Conversation
0741412
to
1ac9ecb
Compare
1ac9ecb
to
af0638d
Compare
af0638d
to
174f813
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm long as all the tests pass
174f813
to
b5df6c5
Compare
"machine_selector_files": { | ||
Type: schema.TypeList, | ||
Optional: true, | ||
Computed: true, | ||
Description: "Cluster V2 machine selector files", | ||
Elem: &schema.Resource{ | ||
Schema: clusterV2RKEConfigMachineSelectorFilesFields(), | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we are adding new fields do we need to add them for both schema and v0 schema, ain't we only supposed to add breaking changes and its migration logic?
Honestly Idk but it doesn't seems right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a grey area in this repo. I agree that, technically, we should not modify the old v0 schema, but in practice, I have seen multiple PRs that make changes to it. (example1 example2 ).
This makes me think that it is expected, or our practice, to add new optional fields to both the v0 and v1 schema.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe if we modify a field, we only change the type in the new v1 (or vx) schema and add migration logic so the TF provider knows what to do on upgrade of the provider. Correct, new fields should be added to all schema versions.
Issue:
#1194
Problem
machine_selector_files
can be used, combined with themachine_selector_config
, to achieve the goal of configuring the API audit logging on REK2/K3s clusters.The support for setting
machine_selector_files
is missing on the TF side.Solution
This PR adds support for the
machine_selector_files
filed on the Cluster_v2 resource.Testing
Engineering Testing
Manual Testing
Below are the TF files I used for testing the new fields
Details
Automated Testing
The existing tests are updated.
QA Testing Considerations
machine_selector_files
machine_selector_files
Regressions Considerations
Cluster provisioning or upgrading fails