Skip to content

fix(gke-cluster): Respect release channel when selecting GKE version by prefix#5729

Merged
kadupoornima merged 5 commits into
GoogleCloudPlatform:developfrom
kadupoornima:version-bug
Jun 2, 2026
Merged

fix(gke-cluster): Respect release channel when selecting GKE version by prefix#5729
kadupoornima merged 5 commits into
GoogleCloudPlatform:developfrom
kadupoornima:version-bug

Conversation

@kadupoornima

@kadupoornima kadupoornima commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

This PR fixes an issue where the GKE cluster version selection logic was ignoring the specified release channel when a version_prefix was provided.

The Bug:
Previously, if min_master_version was not set, the module relied on the google_container_engine_versions data source and automatically selected latest_master_version. Because this data source queries versions without specifying a channel, it fetched the highest available patch version matching the given prefix across all channels. For example, if a user configured the REGULAR release channel, but the absolute latest matching version was currently only available in RAPID, Terraform would attempt to deploy a version that had not yet rolled out to REGULAR, which could result in an API error during cluster creation.

The Fix:
This PR updates the internal logic for setting the GKE version to factor in the release channel. It replaces the hardcoded latest_master_version fallback with the following conditional logic:

  • If a specific release_channel is configured (i.e., not "UNSPECIFIED"), it now uses the data source's release_channel_latest_version attribute to retrieve the latest version specific to that channel.
  • It only falls back to the generic latest_master_version if the release channel is left as "UNSPECIFIED".

@kadupoornima kadupoornima requested a review from a team as a code owner June 1, 2026 08:26
@kadupoornima kadupoornima added the release-bugfix Added to release notes under the "Bug fixes" heading. label Jun 1, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a bug in how GKE cluster versions are resolved within the scheduler module. By introducing conditional logic for release channels, the module now accurately fetches the appropriate version based on the user's configuration. Additionally, minor formatting improvements were applied to the module's documentation.

Highlights

  • GKE Version Resolution: Updated the GKE master version logic to correctly account for release channels, ensuring the latest version is selected based on the specified channel rather than defaulting to the latest master version.
  • Documentation Cleanup: Standardized Markdown table formatting in the README for improved readability and consistency.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the GKE cluster module to dynamically determine the master version based on the configured release channel when it is not set to 'UNSPECIFIED'. It also formats markdown tables in the module's README. A review comment correctly identifies a potential Terraform evaluation error when performing a direct map lookup on release_channel_latest_version if the key is missing, and suggests using the lookup() function with a fallback to prevent failures.

Comment thread modules/scheduler/gke-cluster/main.tf
@kadupoornima kadupoornima changed the title GKE version bugfix fix(gke-cluster): respect release channel when selecting GKE version by prefix Jun 1, 2026
@kadupoornima kadupoornima changed the title fix(gke-cluster): respect release channel when selecting GKE version by prefix fix(gke-cluster): Respect release channel when selecting GKE version by prefix Jun 1, 2026
@kadupoornima kadupoornima enabled auto-merge (squash) June 1, 2026 09:24
@kadupoornima kadupoornima merged commit d409352 into GoogleCloudPlatform:develop Jun 2, 2026
29 of 74 checks passed
@kadupoornima kadupoornima deleted the version-bug branch June 3, 2026 05:00
mikhailpovolotskiy pushed a commit to mikhailpovolotskiy/cluster-toolkit that referenced this pull request Jun 14, 2026
ksaishree pushed a commit to ksaishree/cluster-toolkit that referenced this pull request Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-bugfix Added to release notes under the "Bug fixes" heading.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants