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
Added upgrade_settings with validation for SURGE strategy with promoting min_cpu_platform to GA #6815
Conversation
…ing min_cpu_platform
Oops! It looks like you're using an unknown release-note type in your changelog entries:
Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md. |
Hello! I am a robot who works on Magic Modules PRs. I've detected that you're a community contributor. @slevenick, 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. |
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, 365 insertions(+), 7 deletions(-)) |
Tests analyticsTotal tests: Action takenTriggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed testsTestAccBillingSubaccount_renameOnDestroy|TestAccFirebaserulesRelease_BasicRelease|TestAccContainerCluster_autoprovisioningDefaultsManagement|TestAccContainerCluster_nodeAutoprovisioningDefaultsShieldedInstance|TestAccContainerCluster_nodeAutoprovisioningDefaultsImageType|TestAccContainerCluster_nodeAutoprovisioningDefaultsDiskType|TestAccContainerCluster_nodeAutoprovisioningDefaultsBootDiskKmsKey|TestAccContainerCluster_nodeAutoprovisioningDefaultsDiskSizeGb|TestAccContainerCluster_nodeAutoprovisioningDefaults|TestAccContainerCluster_nodeAutoprovisioning |
Tests passed during RECORDING mode: All tests passed |
}) | ||
} | ||
|
||
func TestAccContainerCluster_autoprovisioningDefaultsUpgradeSettings(t *testing.T) { |
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.
Can we also add another acceptance test that verifies the creation/update of blue_green
upgrade? Current tests only test the Surge
upgrade.
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.
Done
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
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, 408 insertions(+), 7 deletions(-)) |
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|TestAccContainerClusterCustomServiceAccount_withAutopilot|TestAccContainerCluster_autoprovisioningDefaultsUpgradeSettings |
"max_surge": { | ||
Type: schema.TypeInt, | ||
Optional: true, | ||
Description: `The maximum number of nodes that can be created beyond the current size of the node pool during the upgrade process.`, | ||
}, | ||
"max_unavailable": { | ||
Type: schema.TypeInt, | ||
Optional: true, | ||
Description: `The maximum number of nodes that can be simultaneously unavailable during the upgrade process.`, | ||
}, |
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.
Looks like we remove the computed
from these two field. I wonder if the API will return values for these two fields if we don't explicitly specify them for surge upgrade?
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.
The max_surge and max_unavailable values in this case have been verified to be only necessary for the SURGE. The strategy from SURGE to BLUE GREEN cannot be updated if we leave this attrs in its computed state since d.GetOk will utilise its last stetted value if its values are not present in the current tf file. As a result, even though we didn't include it in the tf file, it will assume that we have provided its (max_surge/max_unavailable) value and initiate the validation.
The ideal scenario would be to enable us to switch from an SURGE strategy to a BLUE GREEN strategy by removing the SURGE attrs (max surge and max unavailable) and adding the BLUE GREEN settings.
In a different instance, API returned zero values and set them into a state file for the blue_green_settings(which not having computed:True) and resulted in an indication that changes needed to be updated in the subsequent apply even though there were no changes in the TF file. I have added computed:True for it in the next commit.
max_surge and max_unavailable, however, are of the Int type. Due to this, it will consider computed to be zero and set its value to 0 if we don't supply computed as True.
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, 413 insertions(+), 7 deletions(-)) |
Tests analyticsTotal tests: Action takenTriggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed testsTestAccLoggingBucketConfigProject_cmekSettings|TestAccFirebaserulesRelease_BasicRelease |
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 in general!
GA test running: https://ci-oss.hashicorp.engineering/buildConfiguration/GoogleCloud_ProviderGoogleCloudMmUpstream/356190
Will approve it after the tests pass
OauthScopes: convertStringArr(config["oauth_scopes"].([]interface{})), | ||
ServiceAccount: config["service_account"].(string), | ||
DiskSizeGb: int64(config["disk_size"].(int)), | ||
DiskType: config["disk_type"].(string), | ||
ImageType: config["image_type"].(string), | ||
BootDiskKmsKey: config["boot_disk_kms_key"].(string), | ||
Management: expandManagement(config["management"]), | ||
UpgradeSettings: expandUpgradeSettings(config["upgrade_settings"]), |
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.
Only nit: spacing is a bit off here.
} | ||
|
||
return fmt.Sprintf(` | ||
resource "google_container_cluster" "with_autoprovisioning_upgrade_settings" { |
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.
nit: spacing: we use spaces instead of tabs for resource config.
|
||
func testAccContainerCluster_autoprovisioningDefaultsUpgradeSettingsWithBlueGreenStrategy(clusterName string, duration, strategy string) string { | ||
return fmt.Sprintf(` | ||
resource "google_container_cluster" "with_autoprovisioning_upgrade_settings" { |
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.
nit: spacing
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, 413 insertions(+), 7 deletions(-)) |
Tests analyticsTotal tests: Action takenTriggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed testsTestAccLoggingBucketConfigProject_cmekSettings|TestAccDataFusionInstance_dataFusionInstanceZoneExample|TestAccDataFusionInstance_dataFusionInstanceEventExample|TestAccDataFusionInstance_dataFusionInstanceFullExample|TestAccVertexAIIndex_updated|TestAccVertexAIIndex_vertexAiIndexStreamingExample|TestAccVertexAIIndex_vertexAiIndexExample|TestAccDataFusionInstanceIamPolicyGenerated|TestAccDataFusionInstanceIamMemberGenerated|TestAccDataFusionInstanceIamBindingGenerated |
Tests passed during RECORDING mode: All tests passed |
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.
Apologize for the delay on reviewing this. LGTM! Would you mind rebasing it? Should be good to go after.
…odules into gke_b_189224778
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, 413 insertions(+), 7 deletions(-)) |
Tests analyticsTotal tests: Action takenTriggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed testsTestAccLoggingBucketConfigProject_cmekSettings|TestAccFirebaserulesRelease_BasicRelease|TestAccContainerNodePool_withUpgradeSettings |
/gcbrun |
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! Thanks! GA tests passed: https://ci-oss.hashicorp.engineering/buildConfiguration/GoogleCloud_ProviderGoogleCloudMmUpstream/357900
Will merge after the rerun succeed!
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, 413 insertions(+), 7 deletions(-)) |
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|TestAccLoggingBucketConfigProject_cmekSettings |
part of hashicorp/terraform-provider-google#9180
If this PR is for Terraform, I acknowledge that I have:
make test
andmake lint
to ensure it passes unit and linter tests.Release Note Template for Downstream PRs (will be copied)