Skip to content

Simplify topology validation for NAP enabled clusters#5964

Open
Neelabh94 wants to merge 1 commit into
GoogleCloudPlatform:developfrom
Neelabh94:nap-improvements
Open

Simplify topology validation for NAP enabled clusters#5964
Neelabh94 wants to merge 1 commit into
GoogleCloudPlatform:developfrom
Neelabh94:nap-improvements

Conversation

@Neelabh94

@Neelabh94 Neelabh94 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

This pull request updates the validateRequestedTopology function in gke_job_orchestrator.go to include a check for Node Auto-Provisioning (NAP) status, allowing requested topologies that differ from discovered limits when NAP is enabled.

@gemini-code-assist

This comment was marked as outdated.

gemini-code-assist[bot]

This comment was marked as outdated.

@Neelabh94

Copy link
Copy Markdown
Contributor Author

/gemini review

gemini-code-assist[bot]

This comment was marked as outdated.

@Neelabh94

Copy link
Copy Markdown
Contributor Author

/gemini review

gemini-code-assist[bot]

This comment was marked as outdated.

Neelabh94 added a commit to Neelabh94/cluster-toolkit that referenced this pull request Jul 16, 2026
@Neelabh94

Copy link
Copy Markdown
Contributor Author

/gemini review

@Neelabh94 Neelabh94 added the release-bugfix Added to release notes under the "Bug fixes" heading. label Jul 16, 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 updates the validateRequestedTopology function in gke_job_orchestrator.go to include a check for Node Auto-Provisioning (NAP) status, allowing requested topologies that differ from discovered limits when NAP is enabled. The reviewer suggested a refactoring of the validation loop to improve code conciseness and idiomatic flow by returning early upon finding a valid topology, thereby eliminating the need for a boolean flag.

Comment thread pkg/orchestrator/gke/gke_job_orchestrator.go Outdated
@Neelabh94

Copy link
Copy Markdown
Contributor Author

/gemini review

@Neelabh94
Neelabh94 marked this pull request as ready for review July 16, 2026 17:12
@Neelabh94
Neelabh94 requested a review from a team as a code owner July 16, 2026 17:12

@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 refactors the validateRequestedTopology function in gke_job_orchestrator.go to improve flow and support Node Auto-Provisioning (NAP). The logic now prioritizes direct topology validation, followed by a NAP-enabled check, before falling back to containment checks. I have reviewed the provided feedback and recommend sorting the list of valid topologies in the error message to ensure deterministic output, as map iteration order in Go is non-deterministic.

Comment thread pkg/orchestrator/gke/gke_job_orchestrator.go

@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 validateRequestedTopology function in gke_job_orchestrator.go to support Node Auto-Provisioning (NAP) by allowing requested topologies that differ from currently discovered cluster limits. The reviewer suggests an improvement to include an early format validation check for the requested topology string, even when NAP is enabled, to catch malformed inputs before they reach the node pool creation stage.

Comment thread pkg/orchestrator/gke/gke_job_orchestrator.go
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