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

Do not force send insecure_kubelet_readonly_port_enabled during creation #11688

Merged
merged 6 commits into from
Sep 19, 2024

Conversation

shuyama1
Copy link
Member

@shuyama1 shuyama1 commented Sep 12, 2024

potentially fixes hashicorp/terraform-provider-google#19428

Release Note Template for Downstream PRs (will be copied)

container: fixed a bug where specifying `node_pool_defaults.node_config_defaults` with `enable_autopilot = true` will cause `google_container_cluster` resource creation failure

@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 ( 2 files changed, 2 deletions(-))
google-beta provider: Diff ( 2 files changed, 2 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 208
Passed tests: 192
Skipped tests: 13
Affected tests: 3

Click here to see the affected service packages
  • container

Action taken

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

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccContainerCluster_withLoggingVariantUpdates[Debug log]
TestAccContainerCluster_withNodePoolDefaults[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccContainerCluster_withInsecureKubeletReadonlyPortEnabledDefaultsUpdates[Error message] [Debug log]

$\textcolor{red}{\textsf{Errors occurred during RECORDING mode. Please fix them to complete your PR.}}$

View the build log or the debug log for each test

@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 ( 1 file changed, 1 deletion(-))
google-beta provider: Diff ( 1 file changed, 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 208
Passed tests: 195
Skipped tests: 13
Affected tests: 0

Click here to see the affected service packages
  • container

$\textcolor{green}{\textsf{All tests passed!}}$

View the build log

@shuyama1 shuyama1 changed the title Do not force send insecure_kubelet_readonly_port_enabled Do not force send insecure_kubelet_readonly_port_enabled during creation Sep 12, 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 ( 2 files changed, 865 insertions(+), 791 deletions(-))
google-beta provider: Diff ( 2 files changed, 939 insertions(+), 879 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 0
Passed tests: 0
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • container
#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccContainerCluster_withAutopilot_withNodePoolDefaults
    $\textcolor{red}{\textsf{Errors occurred during REPLAYING mode. Please fix them to complete your PR.}}$

View the build log

@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 ( 2 files changed, 45 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 2 files changed, 45 insertions(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 0
Passed tests: 0
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • container
#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccContainerCluster_withAutopilot_withNodePoolDefaults
    $\textcolor{red}{\textsf{Errors occurred during REPLAYING mode. Please fix them to complete your PR.}}$

View the build log

@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 ( 2 files changed, 45 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 2 files changed, 45 insertions(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 209
Passed tests: 195
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
  • TestAccContainerCluster_withAutopilot_withNodePoolDefaults

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccContainerCluster_withAutopilot_withNodePoolDefaults[Error message] [Debug log]

$\textcolor{red}{\textsf{Errors occurred during RECORDING mode. Please fix them to complete your PR.}}$

View the build log or the debug log for each test

@shuyama1
Copy link
Member Author

/gcbrun

@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 ( 2 files changed, 45 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 2 files changed, 45 insertions(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 210
Passed tests: 196
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
  • TestAccContainerCluster_withAutopilot_withNodePoolDefaults

Get to know how VCR tests work

@wyardley
Copy link
Contributor

@shuyama1 sorry if I introduced the issue described in hashicorp/terraform-provider-google#19428 in #11272 or #11573... from what I remember, forcesendfields may have been needed in some situation, (which might explain the failing test?), so maybe some additional code changes will be needed to make this work vs. just removing it outright? Could be wrong, though.

Maybe the setting can just be disallowed or ignored when the cluster is an autopilot cluster?

Side note: I think the release note is not fully filled out above, unless that's something that will get updated later?

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccContainerCluster_withAutopilot_withNodePoolDefaults[Error message] [Debug log]

$\textcolor{red}{\textsf{Errors occurred during RECORDING mode. Please fix them to complete your PR.}}$

View the build log or the debug log for each test

@shuyama1
Copy link
Member Author

@shuyama1 sorry if I introduced the issue described in hashicorp/terraform-provider-google#19428 in #11272 or #11573... from what I remember, forcesendfields may have been needed in some situation, (which might explain the failing test?), so maybe some additional code changes will be needed to make this work vs. just removing it outright? Could be wrong, though.

Maybe the setting can just be disallowed or ignored when the cluster is an autopilot cluster?

@wyardley Hey, thanks for working on these feature implementations! GKE cluster resource may have some edge cases that that're a bit tricky to spot in advance - this seems like one. I'm testing locally o determine if forcesendfields is necessary here - removing it from the creation seems to resolve the issue described in the ticket. The test failure in this PR is due to a permadiff caused by another field. I'm investigating the cause of it and working on a fix as well.

  ~ node_pool_defaults {
      ~ node_config_defaults {
            # (2 unchanged attributes hidden)

          - gcfs_config {
              - enabled = true -> null
            }
        }
    }

Side note: I think the release note is not fully filled out above, unless that's something that will get updated later?

Thanks for catching it! Yes, I was planning to update it before merging the PR

@wyardley
Copy link
Contributor

wyardley commented Sep 16, 2024

I'm investigating the cause of it and working on a fix as well.

@shuyama1: #11717 (which you're also assigned to review) should fix it, I believe

@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 ( 2 files changed, 46 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 2 files changed, 46 insertions(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 210
Passed tests: 196
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
  • TestAccContainerCluster_withAutopilot_withNodePoolDefaults

Get to know how VCR tests work

@wyardley
Copy link
Contributor

@shuyama1 it's possible it should also be removed in

ForceSendFields: []string{"InsecureKubeletReadonlyPortEnabled"},
as well, if the tests pass.

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccContainerCluster_withAutopilot_withNodePoolDefaults[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$

View the build log or the debug log for each test

@shuyama1
Copy link
Member Author

@shuyama1 it's possible it should also be removed in

ForceSendFields: []string{"InsecureKubeletReadonlyPortEnabled"},

as well, if the tests pass.

Hey @wyardley Yes, I believe that removing the forced send of InsecureKubeletReadonlyPortEnabled should resolve the issue listed in the description of this PR. Additionally, your PR #11717 should address the premadiff discovered in the test failure for this PR. Thank you for your work on the fix!

@wyardley
Copy link
Contributor

Additionally, your PR #11717 should address the premadiff discovered in the test failure for this PR. Thank you for your work on the fix!

Thanks! Please also be aware of #11697

Hopefully, these 3 can all go out together in 6.4.0 or 6.5.0; hopefully they can get squeezed in

@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 ( 2 files changed, 45 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 2 files changed, 45 insertions(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 211
Passed tests: 198
Skipped tests: 13
Affected tests: 0

Click here to see the affected service packages
  • container

$\textcolor{green}{\textsf{All tests passed!}}$

View the build log

@shuyama1 shuyama1 requested review from a team and ScottSuarez and removed request for a team September 17, 2024 22:12
@wyardley
Copy link
Contributor

Yes, I believe that removing the forced send of InsecureKubeletReadonlyPortEnabled should resolve the issue listed in the description of this PR

Oh, I get it now, this is for node_config_defaults.node_kubelet_config only. node_config.kubelet_config is the one I was thinking was originally getting updated here 🤦

kConfig.ForceSendFields = append(kConfig.ForceSendFields, "InsecureKubeletReadonlyPortEnabled")

@ScottSuarez
Copy link
Contributor

@shuyama1, wouldn't this not allow the field to be unset? I notice that this field is marked as Computed in the schema?

https://github.com/shuyama1/magic-modules/blob/e48cdbdb59cf71edfd96fe0e4ada0dc413dc2157/mmv1/third_party/terraform/services/container/node_config.go.erb#L87

@shuyama1
Copy link
Member Author

@shuyama1, wouldn't this not allow the field to be unset? I notice that this field is marked as Computed in the schema?

shuyama1/magic-modules@e48cdbd/mmv1/third_party/terraform/services/container/node_config.go.erb#L87

I've only removed it from the ForceSendFields in create but not update, so I think it should be fine, but I can test it locally to confirm

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.

node_pool_defaults.node_config_defaults.node_kubelet_config with GKE Autopilot clusters.
4 participants