Skip to content

Add precondition checks to disallow setting conflicting consumption options#5062

Merged
kadupoornima merged 1 commit intoGoogleCloudPlatform:developfrom
kadupoornima:dash
Jan 8, 2026
Merged

Add precondition checks to disallow setting conflicting consumption options#5062
kadupoornima merged 1 commit intoGoogleCloudPlatform:developfrom
kadupoornima:dash

Conversation

@kadupoornima
Copy link
Contributor

@kadupoornima kadupoornima commented Jan 5, 2026

Problem: The blueprint validator did not prevent a user from configuring a GKE node pool with a few conflicting consumption options. While these combinations are syntactically valid in the blueprint, it results in a badRequest error from the GKE API during terraform apply. This lead to wasted time deploying and debugging, as the failure occurs late in the terraform apply process.

Solution : In this PR, we added precondition checks to prevent conflicting combinations during the blueprint check/generate phase itself for the following:

  • Both spot: true and enable_queued_provisioning: true options cannot be set at the same time.
  • If Spot consumption option is enabled (spot: true), then reservation should not be set.

Tested these changes locally.

@kadupoornima kadupoornima added the release-bugfix Added to release notes under the "Bug fixes" heading. label Jan 5, 2026
@kadupoornima kadupoornima marked this pull request as ready for review January 5, 2026 08:39
@kadupoornima kadupoornima requested review from a team and samskillman as code owners January 5, 2026 08:39
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @kadupoornima, 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 enhances the GKE node pool blueprint by introducing a crucial validation step. It specifically targets a configuration conflict where both spot and queued_provisioning options are enabled, a combination that is syntactically allowed but results in a badRequest error from the GKE API during deployment. By adding this precondition check, the system can now identify and flag this invalid configuration during the blueprint check phase, significantly reducing wasted time and effort spent on failed Terraform applications and subsequent debugging.

Highlights

  • GKE Node Pool Validation: Implemented a new precondition check in the GKE node pool blueprint to prevent the simultaneous use of spot: true and enable_queued_provisioning: true.
  • Error Prevention: This validation prevents badRequest errors that previously occurred during terraform apply when these conflicting options were configured, saving deployment and debugging time.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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 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 counter productive. 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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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.

Copy link
Contributor

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

Choose a reason for hiding this comment

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

Code Review

The pull request successfully introduces a crucial precondition check to prevent conflicting spot and enable_queued_provisioning options in GKE node pools. This validation, performed during the blueprint check/generate phase, will significantly improve the user experience by catching configuration errors early and avoiding badRequest errors during Terraform apply. This is a valuable enhancement for the module's robustness and user-friendliness.

@kadupoornima kadupoornima added the release-improvements Added to release notes under the "Improvements" heading. label Jan 7, 2026
@kadupoornima kadupoornima changed the title Add precondition check to disallow setting conflicting consumption options (spot and queued_provisioning) Add precondition check to disallow setting conflicting consumption options Jan 7, 2026
@kadupoornima kadupoornima changed the title Add precondition check to disallow setting conflicting consumption options Add precondition checks to disallow setting conflicting consumption options Jan 7, 2026
Copy link
Contributor

@SwarnaBharathiMantena SwarnaBharathiMantena left a comment

Choose a reason for hiding this comment

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

LGTM

@kadupoornima kadupoornima merged commit c56d038 into GoogleCloudPlatform:develop Jan 8, 2026
53 of 97 checks passed
@kadupoornima kadupoornima deleted the dash branch January 8, 2026 04:28
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. release-improvements Added to release notes under the "Improvements" heading.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants