Skip to content

Allow setting no limits and requests for Brainstore#70

Merged
Jeff McCollum (jeffmccollum) merged 1 commit intomainfrom
jeff/remove-required-limits
Mar 20, 2026
Merged

Allow setting no limits and requests for Brainstore#70
Jeff McCollum (jeffmccollum) merged 1 commit intomainfrom
jeff/remove-required-limits

Conversation

@jeffmccollum
Copy link
Contributor

@jeffmccollum Jeff McCollum (jeffmccollum) commented Mar 19, 2026

For Brainstore, pass in resources as is, other than required ones for GKE Autopilot.

@jeffmccollum Jeff McCollum (jeffmccollum) changed the title pass in requests as is for brainstore Allow setting no limits and requests for Brainstore Mar 19, 2026
@jeffmccollum Jeff McCollum (jeffmccollum) marked this pull request as ready for review March 20, 2026 14:43
@jeffmccollum Jeff McCollum (jeffmccollum) merged commit b9b8fda into main Mar 20, 2026
3 checks passed
@jeffmccollum Jeff McCollum (jeffmccollum) deleted the jeff/remove-required-limits branch March 20, 2026 14:46
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f45da2433d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".

memory: {{ .Values.brainstore.reader.resources.limits.memory | quote }}
{{- $resources := .Values.brainstore.reader.resources }}
{{- if and (eq .Values.cloud "google") (eq .Values.google.mode "autopilot") .Values.brainstore.reader.volume.size }}
{{- $resources = merge (dict "requests" (merge $resources.requests (dict "ephemeral-storage" .Values.brainstore.reader.volume.size))) $resources }}

Choose a reason for hiding this comment

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

P2 Badge Deep-copy resources before merge

merge mutates its destination map, and here the destination is $resources.requests, which is a direct reference into .Values. That means rendering this template can mutate chart values in-place; if a deploy uses shared resource maps (for example via YAML anchors or generated values reused across reader/writer/fastreader), the injected ephemeral-storage request can bleed into other components unexpectedly. Wrap the merged maps in deepCopy before merging to keep template rendering isolated.

Useful? React with 👍 / 👎.

memory: {{ .Values.brainstore.reader.resources.limits.memory | quote }}
{{- $resources := .Values.brainstore.reader.resources }}
{{- if and (eq .Values.cloud "google") (eq .Values.google.mode "autopilot") .Values.brainstore.reader.volume.size }}
{{- $resources = merge (dict "requests" (merge $resources.requests (dict "ephemeral-storage" .Values.brainstore.reader.volume.size))) $resources }}

Choose a reason for hiding this comment

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

P2 Badge Enforce autopilot ephemeral-storage with overwrite

This merge expression does not guarantee that volume.size wins: merge gives precedence to the first map, so an existing resources.requests.ephemeral-storage value is kept and the autopilot-required value from volume.size is ignored. In the autopilot branch this can render a pod request that no longer matches the configured volume size, which can lead to scheduling/rejection issues. Use mergeOverwrite (or explicit set) for ephemeral-storage in this path.

Useful? React with 👍 / 👎.

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.

2 participants