Fix GKE ignore_node_count_changes flag and stale IGM cache#18397
Fix GKE ignore_node_count_changes flag and stale IGM cache#18397c2thorn wants to merge 1 commit into
Conversation
|
Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 08fb586: Diff reportYour PR generated the following diffs in downstream repositories:
Test reportAnalytics
Affected Service Packages
Step 1: Replaying Mode Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
View the replaying VCR build log Step 2: Recording Mode
Caution Issues requiring attention before PR completion 🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details. Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer. View the recording VCR build log or the debug logs folder for detailed results. |
Fixes hashicorp/terraform-provider-google#27946
Fixes hashicorp/terraform-provider-google#27966
This PR fixes 3 bugs or test failures introduced by PR #17968 for the GKE
ignore_node_count_changesflag. PR #17968 successfully reduced reduced plan-time API calls by via the new flag, but was rushed as a high priority issue and missed a few things.1: Flattener Bug
PR #17968 failed to persist the flag's state in
google_container_cluster.node_pool.ignore_node_count_changesdespite working correctly ingoogle_container_node_pool.ignore_node_count_changes.To address this, this PR adds the missing
ignore_node_count_changesfield mapping togoogle_container_cluster'sflattenNodePool.2: Test Failure TestAccContainerCluster_regionalWithNodePool
PR #17968 added the new flag to
TestAccContainerCluster_regionalWithNodePool. The test was dismissed as flaky in VCR since it failed withHowever it actually failed in non-VCR runs with
The
flattenNodePoolfix from Bug #1 resolves this immediate diff, but exposes a new diff on the import step. Virtual fields are not loaded on import and are usually fixed byImportStateVerifyIgnore. This doesn't work forignore_node_count_changesbecause if the acceptance test config setsignore_node_count_changesto true, but the import step sets it to the defaultfalse, the node counts are not ignored andmanaged_instance_group_urlsis populated, resulting in a new import diff formanaged_instance_group_urls.This means for import steps where
ignore_node_count_changesis true, bothignore_node_count_changesandmanaged_instance_group_urlsshould be ignored on the import step.3: Test Failure TestAccContainerNodePool_ignoreNodeCountChanges
TestAccContainerNodePool_ignoreNodeCountChangesfails outside of VCR tests because of caching. Stale GCE instance group manager counts were served from the provider cache after config updates, causingTo fix this, this PR invalidates the IGM cache during count resizing or anytime
ignore_node_count_changesis active, in order to make sure stale node counts do not persist after they are ignored by the flag. The cache is a provider-only client-side cache, and it makes sense to empty in these scenarios because once counts have been updated or ignored, the cached values are no longer guaranteed to reflect actual API values.Release Note Template for Downstream PRs (will be copied)
See Write release notes for guidance.