Skip to content
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

container: fix in-place updates for node_config.containerd_config #12135

Conversation

wyardley
Copy link
Contributor

@wyardley wyardley commented Oct 25, 2024

It appears that in-place updates were never implemented for node_config.containerd_config, when contained within either google_container_cluster or google_container_node_pool

Fixes hashicorp/terraform-provider-google#19056
Related to hashicorp/terraform-provider-google#19225 (already closed / fixed)

The actual implementation is pretty simple, and is basically copy / paste from other fields.

The adjustments to existing tests are a little trickier to parse out.

Basically, the existing tests for both google_container_cluster and google_container_node_pool mostly covered node_config_defaults (maybe because that's the only one updates worked for), and didn't cover updates in node_config. In at least one case, the same test was used for all of node_config_defaults, node_pool.node_config, and node_config, and I've mostly preserved that, just adjusting the order. Note that in at least one case, that will likely require recreating the entire cluster and / or its node-pools; I've moved that test (named node_pool {} block in google_container_cluster) to be the last test, and attempted to add some comments.

Another approach would be to split out the tests of node_config_defaults, node_pool.node_config, and node_config.

Release Note Template for Downstream PRs (will be copied)

container: fixed in-place updates for `node_config.containerd_config` in `google_container_cluster` and `google_container_node_pool`

@github-actions github-actions bot requested a review from SirGitsalot October 25, 2024 18:17
Copy link

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

@SirGitsalot, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@modular-magician modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Oct 25, 2024
@wyardley
Copy link
Contributor Author

Some more context on this in @roaks3's comment here

@@ -4862,13 +4886,12 @@ resource "google_container_node_pool" "np" {
oauth_scopes = [
"https://www.googleapis.com/auth/cloud-platform",
]
machine_type = "n1-standard-8"
Copy link
Contributor Author

@wyardley wyardley Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pulling all these out because a) was seeing a lot of stockout issues with n1, b) n1 is super old, c) n1 isn't needed in any of these for a reason, and d) didn't want to trigger updates or recreation where not needed.

I imagine it probably would be good to (separately) adjust to the n1 stuff in these tests to e2 or n2/n3? There are some comments about e2 not working with pd-ssd, but afaict, it works fine now

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we've got other ticking time bombs like this scattered throughout our tests. The challenge is that APIs require that we specify a machine type/disk type/Linux distro version/etc. and it's often the case that the best we can do is use the latest available to give us the maximum useful lifetime for the test and then fix it when it inevitably breaks in a few years.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SirGitsalot some of the comments imply it's because e2 (which I think is the default?) is required for certain tests (SSD is one example given). I think in some cases, those limitations have changed and / or the code was just copy / pasted.

Taking it out here seemed to work in my test, but happy to adjust it to a different explicit type if needed.

It appears that in-place updates were never implemented for
`node_config.containerd_config`, when contained within
either `google_container_cluster` or `google_container_node_pool`

Fixes hashicorp/terraform-provider-google#19056
Related to hashicorp/terraform-provider-google#19225

Signed-off-by: William Yardley <[email protected]>
@wyardley wyardley force-pushed the wyardley/19056/nodeconfig_containerd_config_updates branch from 828ed7c to f5ce37d Compare October 26, 2024 02:08
Copy link

@SirGitsalot This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

@modular-magician modular-magician added service/container and removed awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests labels Oct 30, 2024
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 3 files changed, 277 insertions(+), 122 deletions(-))
google-beta provider: Diff ( 3 files changed, 277 insertions(+), 122 deletions(-))

Copy link
Member

@SirGitsalot SirGitsalot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I've kicked off the tests and will approve and merge once they're done.

@@ -4862,13 +4886,12 @@ resource "google_container_node_pool" "np" {
oauth_scopes = [
"https://www.googleapis.com/auth/cloud-platform",
]
machine_type = "n1-standard-8"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we've got other ticking time bombs like this scattered throughout our tests. The challenge is that APIs require that we specify a machine type/disk type/Linux distro version/etc. and it's often the case that the best we can do is use the latest available to give us the maximum useful lifetime for the test and then fix it when it inevitably breaks in a few years.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 215
Passed tests: 201
Skipped tests: 13
Affected tests: 1

Click here to see the affected service packages
  • container

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccContainerNodePool_privateRegistry

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccContainerNodePool_privateRegistry [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

@SirGitsalot SirGitsalot merged commit 07118df into GoogleCloudPlatform:main Oct 30, 2024
12 checks passed
niharika-98 pushed a commit to niharika-98/magic-modules that referenced this pull request Nov 1, 2024
BBBmau pushed a commit to BBBmau/magic-modules that referenced this pull request Nov 5, 2024
akshat-jindal-nit pushed a commit to akshat-jindal-nit/magic-modules that referenced this pull request Nov 18, 2024
amanMahendroo pushed a commit to amanMahendroo/magic-modules that referenced this pull request Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

containerd_config in resource google_container_cluster is not working
3 participants