Skip to content

fix(slurm): robustly convert enable_oslogin boolean to metadata string#5351

Merged
kvenkatachala333 merged 1 commit into
GoogleCloudPlatform:developfrom
kvenkatachala333:oslogin
Mar 16, 2026
Merged

fix(slurm): robustly convert enable_oslogin boolean to metadata string#5351
kvenkatachala333 merged 1 commit into
GoogleCloudPlatform:developfrom
kvenkatachala333:oslogin

Conversation

@kvenkatachala333

Copy link
Copy Markdown
Member

Problem

When disabling OS Login with enable_oslogin: false in a Slurm blueprint, the mapping into custom metadata on provisioned nodes was defaulting or evaluated back to "TRUE".
The internal Slurm mapping was using the Terraform upper() function on a boolean variable (enable-oslogin = upper(var.enable_oslogin)). This implicit conversion often falls back on previous casing or fails, causing it to remain "TRUE".

Solution

Changed upper(var.enable_oslogin) to an explicit ternary conditional:
enable-oslogin = var.enable_oslogin ? "TRUE" : "FALSE"
This ensures that any boolean value (true/false) evaluated from your blueprint is explicitly and reliably translated into the expected "TRUE" or "FALSE" metadata format required by Compute Engine.

@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 resolves a critical bug in the Slurm blueprint's OS Login configuration. Previously, attempts to disable OS Login through the blueprint would often fail, resulting in OS Login remaining enabled on provisioned nodes due to an unreliable boolean-to-string conversion. The implemented fix ensures that the enable_oslogin setting is accurately and explicitly translated into the required Compute Engine metadata format, providing reliable control over OS Login status.

Highlights

  • OS Login Metadata Conversion Fix: Corrected an issue where the enable_oslogin boolean variable was not robustly converted to a string for Slurm blueprint metadata, leading to false values incorrectly defaulting to "TRUE".
Changelog
  • community/modules/internal/slurm-gcp/instance_template/main.tf
    • Updated the enable-oslogin metadata assignment to use an explicit ternary conditional for boolean conversion.
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.

@kvenkatachala333 kvenkatachala333 added the release-chore To not include into release notes label Mar 12, 2026

@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 modifies the conversion of the enable_oslogin boolean variable to a string for instance metadata. The implementation is changed from upper(var.enable_oslogin) to var.enable_oslogin ? "TRUE" : "FALSE" to ensure a reliable conversion. After reviewing the changes, I have no specific comments or suggestions for improvement.

@kvenkatachala333 kvenkatachala333 marked this pull request as ready for review March 16, 2026 21:02
@kvenkatachala333 kvenkatachala333 requested review from a team and samskillman as code owners March 16, 2026 21:02
@kvenkatachala333 kvenkatachala333 merged commit 71695be into GoogleCloudPlatform:develop Mar 16, 2026
15 of 79 checks passed
@kvenkatachala333 kvenkatachala333 deleted the oslogin branch March 16, 2026 21:03
Neelabh94 pushed a commit to Neelabh94/cluster-toolkit that referenced this pull request Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-chore To not include into release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants