[8.0.0] container: extend google_container_node_pool name_prefix max length to 31 - #12
Closed
c2thorn wants to merge 1 commit into
Closed
[8.0.0] container: extend google_container_node_pool name_prefix max length to 31#12c2thorn wants to merge 1 commit into
c2thorn wants to merge 1 commit into
Conversation
…length to 31 Fixes hashicorp/terraform-provider-google#8261 by using ReducedPrefixedUniqueId for name_prefix > 14 characters.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
expandNodePoolinresource_container_node_pool.go.tmplto usetpgresource.ReducedPrefixedUniqueId(p)(appending 9 characters) instead ofid.PrefixedUniqueId(p)(appending 26 characters) whenlen(name_prefix) > 14.ValidateFuncto"name_prefix"inschemaNodePoolcapping maximum prefix length at 31 characters (31 + 9 = 40).TestAccContainerNodePool_namePrefix_longto verify thatname_prefixvalues longer than 14 characters provision successfully.container_node_pool.html.markdownresource documentation and the v8.0.0 Upgrade Guide (version_8_upgrade.html.markdown).Why
Fixes hashicorp/terraform-provider-google#8261. Previously, any
name_prefixlonger than 14 characters combined with the standard 26-character UUID suffix exceeded GKE's 40-character limit forNodePool.name, failing at apply time with HTTP 400. Following the precedent of compute instance templates (PR GoogleCloudPlatform#11448), switching to the 9-character shortened suffix for prefixes> 14extends the maximum allowedname_prefixlength from 14 to 31 characters.Verification
TestAccContainerNodePool_namePrefix_long(len = 18) against live GKE API; PASSED (HTTP 200 OK, generated name length 27<= 40).TestAccContainerNodePool_namePrefix(len = 6) withRELEASE_DIFF=true; PASSED with 0 plan diffs (No changes), confirming zero drift or recreation when upgrading existing7.xresources to8.0.0.