Skip to content

[8.0.0] container: extend google_container_node_pool name_prefix max length to 31 - #12

Closed
c2thorn wants to merge 1 commit into
FEATURE-BRANCH-major-release-8.0.0from
fix-issue-8261-8.0.0
Closed

[8.0.0] container: extend google_container_node_pool name_prefix max length to 31#12
c2thorn wants to merge 1 commit into
FEATURE-BRANCH-major-release-8.0.0from
fix-issue-8261-8.0.0

Conversation

@c2thorn

@c2thorn c2thorn commented Jul 30, 2026

Copy link
Copy Markdown
Owner

What changed

  • Updates expandNodePool in resource_container_node_pool.go.tmpl to use tpgresource.ReducedPrefixedUniqueId(p) (appending 9 characters) instead of id.PrefixedUniqueId(p) (appending 26 characters) when len(name_prefix) > 14.
  • Adds a ValidateFunc to "name_prefix" in schemaNodePool capping maximum prefix length at 31 characters (31 + 9 = 40).
  • Adds TestAccContainerNodePool_namePrefix_long to verify that name_prefix values longer than 14 characters provision successfully.
  • Updates container_node_pool.html.markdown resource documentation and the v8.0.0 Upgrade Guide (version_8_upgrade.html.markdown).

Why

Fixes hashicorp/terraform-provider-google#8261. Previously, any name_prefix longer than 14 characters combined with the standard 26-character UUID suffix exceeded GKE's 40-character limit for NodePool.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 > 14 extends the maximum allowed name_prefix length from 14 to 31 characters.

Verification

  • Feature Acceptance Test: Executed TestAccContainerNodePool_namePrefix_long (len = 18) against live GKE API; PASSED (HTTP 200 OK, generated name length 27 <= 40).
  • Version Upgrade Safety: Executed TestAccContainerNodePool_namePrefix (len = 6) with RELEASE_DIFF=true; PASSED with 0 plan diffs (No changes), confirming zero drift or recreation when upgrading existing 7.x resources to 8.0.0.

…length to 31

Fixes hashicorp/terraform-provider-google#8261 by using ReducedPrefixedUniqueId for name_prefix > 14 characters.
@c2thorn c2thorn closed this Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant