-
Notifications
You must be signed in to change notification settings - Fork 4
Allow setting no limits and requests for Brainstore #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,15 +71,11 @@ spec: | |
| ports: | ||
| - containerPort: {{ .Values.brainstore.reader.service.port }} | ||
| resources: | ||
| requests: | ||
| cpu: {{ .Values.brainstore.reader.resources.requests.cpu | quote }} | ||
| memory: {{ .Values.brainstore.reader.resources.requests.memory | quote }} | ||
| {{- if and (eq .Values.cloud "google") (eq .Values.google.mode "autopilot") .Values.brainstore.reader.volume.size }} | ||
| ephemeral-storage: {{ .Values.brainstore.reader.volume.size | quote }} | ||
| {{- end }} | ||
| limits: | ||
| cpu: {{ .Values.brainstore.reader.resources.limits.cpu | quote }} | ||
| 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 }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This merge expression does not guarantee that Useful? React with 👍 / 👎. |
||
| {{- end }} | ||
| {{- toYaml $resources | nindent 12 }} | ||
| {{- with .Values.brainstore.livenessProbe }} | ||
| livenessProbe: | ||
| {{- toYaml . | nindent 12 }} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mergemutates 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 injectedephemeral-storagerequest can bleed into other components unexpectedly. Wrap the merged maps indeepCopybefore merging to keep template rendering isolated.Useful? React with 👍 / 👎.