Skip to content

Conversation

@anson627
Copy link
Collaborator

This pull request updates the way the GKE cluster name is generated in the Terraform configuration to ensure it fits within GCP's naming constraints and is more predictable.

Resource naming improvement:

  • Changed the name attribute of the google_container_cluster.gke resource to use trimright(substr(..., 0, 40), "-") instead of a regex-based approach, ensuring the cluster name is always at most 40 characters and does not end with a hyphen.…tructure

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates the GKE cluster name generation logic to use a simpler substring and trim approach instead of regex-based extraction, ensuring cluster names stay within GCP's 40-character limit and don't end with hyphens.

  • Replaced regex-based run_id extraction with full run_id usage and length truncation
  • Applied trimright to remove trailing hyphens after substring truncation

@anson627 anson627 force-pushed the fix-gke-cluster-name branch from d245d8f to b5d418f Compare December 26, 2025 22:59
@anson627 anson627 force-pushed the fix-gke-cluster-name branch from b5d418f to 4278a14 Compare December 26, 2025 23:10
@anson627 anson627 merged commit 38f7897 into main Jan 7, 2026
4 checks passed
@anson627 anson627 deleted the fix-gke-cluster-name branch January 7, 2026 18:26
xgugeng pushed a commit that referenced this pull request Jan 8, 2026
#989)

This pull request updates the way the GKE cluster name is generated in
the Terraform configuration to ensure it fits within GCP's naming
constraints and is more predictable.

Resource naming improvement:

* Changed the `name` attribute of the `google_container_cluster.gke`
resource to use `trimright(substr(..., 0, 40), "-")` instead of a
regex-based approach, ensuring the cluster name is always at most 40
characters and does not end with a hyphen.…tructure
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.

3 participants