-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Share settings for sole-tenant node groups. #7059
Conversation
Hello! I am a robot who works on Magic Modules PRs. I've detected that you're a community contributor. @zli82016, 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. |
I wasn't sure what the TF policy is regarding resource validations. For instance, we duplicate some resource validations from the GCE REST API on the gcloud side but not others - please advise how to decide if a resource validation should be duplicated on the TF side. |
Added @c2thorn as the secondary reviewer. |
/gcbrun |
Generally we leave the validation to API side. Service teams can change validation rules sometimes. We only validate things on the Terraform side that are simple and we think are unlikely to change. The cost to fix the validation code in Terraform provider is high. |
@zli82016 please let me know when I'm supposed to take any action here. I'm having trouble interpreting the results of the failed generate-diffs check. I'm getting |
@idyczko , I will check with the team what permission you need. Also, can you check my comments? Especially for the file [mmv1/templates/terraform/examples/node_group_share_settings.tf.erb] This is the doc to add resources, set up environment and run tests, if you need. https://googlecloudplatform.github.io/magic-modules/ |
@idyczko , can you open this page https://pantheon.corp.google.com/cloud-build/builds/e8f13117-bee8-4059-8256-6ba814cb48ad?project=graphite-docker-images&mods=monitoring_api_prod ? The generate-diffs failed because that |
mmv1/templates/terraform/examples/node_group_share_settings.tf.erb
Outdated
Show resolved
Hide resolved
mmv1/templates/terraform/examples/node_group_share_settings.tf.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, 268 insertions(+)) |
Tests analyticsTotal tests: Action takenTriggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed testsTestAccFirebaserulesRelease_BasicRelease|TestAccContainerCluster_withInvalidGatewayApiConfigChannel|TestAccComputeNodeGroup_nodeGroupShareSettingsExample |
Tests passed during RECORDING mode: Tests failed during RECORDING mode: Please fix these to complete your PR |
mmv1/templates/terraform/examples/node_group_share_settings.tf.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, 266 insertions(+)) |
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, 264 insertions(+)) |
Tests analyticsTotal tests: Action takenTriggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed testsTestAccFirebaserulesRelease_BasicRelease|TestAccRegionInstanceGroupManager_stateful|TestAccComputeNodeGroup_nodeGroupShareSettingsExample |
Tests passed during RECORDING mode: Tests failed during RECORDING mode: Please fix these to complete your PR |
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, 260 insertions(+)) |
Tests analyticsTotal tests: Action takenTriggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed testsTestAccFirebaserulesRelease_BasicRelease|TestAccComputeNodeGroup_nodeGroupShareSettingsExample |
Tests passed during RECORDING mode: Tests failed during RECORDING mode: Please fix these to complete your PR |
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, 264 insertions(+)) |
Tests analyticsTotal tests: Action takenTriggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed testsTestAccComputeNodeGroup_nodeGroupShareSettingsExample |
LGTM. Please wait for the review from @c2thorn . |
name: 'projectId' | ||
required: true | ||
description: | | ||
The project id/number should be the same as the key of this project config in the project map. |
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 seems to be implemented correctly in terms of the API, but I cannot understand the design. The project_id
is the only relevant information being passed here, why is it duplicated in both the key and value within a map? Am I missing something? Do you know if the API is setting up to have other values within the projectConfig
nested object?
We rarely deviate from the API, but it seems like a frivolous user experience to have to set the project id twice. We could relatively simply implement custom code to take a list of project id's from the user and supply the API with the map in the correct format. From my perspective, this could prevent user error. More context would help me understand however
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.
To be honest, I cannot defend this decision, but I don't think it's been designed while working on this particular feature. The semantics of sharing node groups across projects was derived from how reservations are shared (take a look at the shareSettings field of the Reservation resource). Is there anything we can do with that at this point?
Also, I've stumbled upon some custom code that seems to be responsible for shareSettings modifications when updating the Reservation resource:
mmv1/templates/terraform/update_encoder/reservation.go.erb
Could you let me know if that is something we need for the NodeGroup resource as well?
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.
We don't need to add update_encoder for shareSettings
in the resource NodeGroup
. The resource NodeGroup has property input: true
. That means that a new resource is created no matter what field has changed (from the code, node_template is an exception).
Waiting for @c2thorn 's opinions.
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.
@idyczko thank you for pointing out the shareSettings
field in Reservation. Considering that we've already gone forward with it there, we may as well keep consistent here.
@zli82016 is correct that a custom update encoder should not be needed since the resource cannot be updated in place at all. If this is no longer true, we can modify this in a separate PR.
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
This PR introduces support for cross-project sharing of Node Groups.
This PR resolves Issue 13281.
If this PR is for Terraform, I acknowledge that I have:
make test
andmake lint
to ensure it passes unit and linter tests.Note on acceptance tests
I ran the acceptance tests locally with my own projects instead of automatically created projects due to some limitations in my organisation.
Release Note Template for Downstream PRs (will be copied)