-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat(google_container_cluster): support enable k8s beta apis #8355
feat(google_container_cluster): support enable k8s beta apis #8355
Conversation
Hello! I am a robot who works on Magic Modules PRs. I've detected that you're a community contributor. @melinath, a repository maintainer, has been assigned to assist you and help review your changes. ❓ First time contributing? Click here for more detailsYour assigned reviewer will help review your code by:
You can help make sure that review is quick by running local tests and ensuring they're passing in between each push you make to your PR's branch. Also, try to leave a comment with each push you make, as pushes generally don't generate emails. If your reviewer doesn't get back to you within a week after your most recent change, please feel free to leave a comment on the issue asking them to take a look! In the absence of a dedicated review dashboard most maintainers manage their pending reviews through email, and those will sometimes get lost in their inbox. |
mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb
Outdated
Show resolved
Hide resolved
dd0f508
to
d0d6802
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.
marking reviewed pending the switch to using a datasource
mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb
Outdated
Show resolved
Hide resolved
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 3 files changed, 163 insertions(+)) |
Tests analyticsTotal tests: Action takenFound 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccContainerAwsNodePool_BetaBasicHandWritten|TestAccContainerCluster_withEnableKubernetesBetaAPIs|TestAccComputeFirewallPolicyRule_multipleRules |
Rerun these tests in REPLAYING mode to catch issues
|
d0d6802
to
a3ef8ad
Compare
a3ef8ad
to
f5b8311
Compare
this feature is available from 1.27 and currently we can enable API, |
@coolkp hm, not being able to disable them is a little weird. Is there any beta API that we could rely on existing for testing, or should we just expect this test to break occasionally when APIs are removed? |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 4 files changed, 153 insertions(+)) |
@melinath reason why we don't allow disabling is because of lack of controller capability to cleanup any k8s objects created by the api . We ultimately must sync this with k8s upstream open api spec. but beta apis cannot be removed for minimum of 3 versions so we have around a year to do that. in this case we can rely on this api for next 3 versions. I did consider having a allowlisted mock api for test purposes, but this is a front facing feature. |
@coolkp would this be the case for all k8s beta APIs, or just this one? Basically the reason I'm asking is because we need to figure out what the Terraform UX should be for users who remove an API from this field. There are basically two options:
|
Tests analyticsTotal tests: Action takenFound 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccContainerCluster_withEnableKubernetesBetaAPIs|TestAccContainerAwsNodePool_BetaBasicHandWritten|TestAccComputeFirewallPolicyRule_multipleRules |
Rerun these tests in REPLAYING mode to catch issues
|
ideally i prefer validation to prevent field from being removed but option 1 is ok too show the api call validation error |
Generally we prefer not to handle this kind of validation in case the API behavior changes - let's leave it as an error for now. |
location = "us-central1-a" | ||
|
||
min_master_version = data.google_container_engine_versions.uscentral1a.release_channel_latest_version["STABLE"] | ||
# TODO: Migrate to supported Beta APIs when available |
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'm not sure I understand the action to be taken from this - could you add more information to the comment? And/or we could discuss in this thread.
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.
Added more context.
mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb
Show resolved
Hide resolved
f313ab7
to
d3b424e
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.
This is looking really good! A couple small requests related to tests.
PreCheck: func() { acctest.AccTestPreCheck(t) }, | ||
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), | ||
CheckDestroy: testAccCheckContainerClusterDestroyProducer(t), | ||
Steps: []resource.TestStep{ |
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.
If possible, we should add a second step here that adds a second enabled API to exercise the Update code. If that isn't possible because there is only one beta API, we should add a new test that creates a cluster without any enabled APIs and then enables this beta API in a separate test step.
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.
Unfortunately, there is only one beta API available at this time. Added a new test case to create a GKE cluster and enable the beta API.
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.
Thanks @toVersus yeah we don't have any other APIs for enabling
mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb
Show resolved
Hide resolved
f12421f
to
715c029
Compare
Signed-off-by: toVersus <[email protected]> * use TypeSet to avoid the re-ordering being treated as a diff * add custom diff to recreate cluster when removing enabled apis * add unit and integration tests
715c029
to
3ed46bb
Compare
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 4 files changed, 338 insertions(+)) |
Tests analyticsTotal tests: Action takenFound 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccProjectIamPolicy_invalidMembers|TestAccContainerAwsNodePool_BetaBasicHandWritten|TestAccContainerCluster_withEnableKubernetesBetaAPIsOnExistingCluster|TestAccContainerCluster_withEnableKubernetesBetaAPIs |
Rerun these tests in REPLAYING mode to catch issues
|
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 modulo this one docs change. Thanks for your work on this!
mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown
Outdated
Show resolved
Hide resolved
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.
Merging based on passing tests on the previous commit - the new commit is only a docs change.
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-)) |
Tests analyticsTotal tests: Action takenFound 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccContainerAwsNodePool_BetaBasicHandWritten|TestAccVPCAccessConnector_vpcAccessConnectorExample |
Rerun these tests in REPLAYING mode to catch issues
|
…loudPlatform#8355) * feat(google_container_cluster): support enable k8s beta apis Signed-off-by: toVersus <[email protected]> * use TypeSet to avoid the re-ordering being treated as a diff * add custom diff to recreate cluster when removing enabled apis * add unit and integration tests * fix: use contains instead of sets intersection * Update mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown --------- Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
…loudPlatform#8355) * feat(google_container_cluster): support enable k8s beta apis Signed-off-by: toVersus <[email protected]> * use TypeSet to avoid the re-ordering being treated as a diff * add custom diff to recreate cluster when removing enabled apis * add unit and integration tests * fix: use contains instead of sets intersection * Update mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown --------- Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
…loudPlatform#8355) * feat(google_container_cluster): support enable k8s beta apis Signed-off-by: toVersus <[email protected]> * use TypeSet to avoid the re-ordering being treated as a diff * add custom diff to recreate cluster when removing enabled apis * add unit and integration tests * fix: use contains instead of sets intersection * Update mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown --------- Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
Fixes: hashicorp/terraform-provider-google#15174
This PR added support for enabling beta APIs for the google_container_cluster resource. This allows users to select which beta resources they wish to use. Once activated, they cannot be deactivated. See Configure beta APIs and corresponding REST API doc.
If this PR is for Terraform, I acknowledge that I have:
make test
andmake lint
in the generated providers to ensure it passes unit and linter tests.Release Note Template for Downstream PRs (will be copied)