Skip to content

Commit

Permalink
[nats helm 1.x] remove break statement (#715)
Browse files Browse the repository at this point in the history
* [nats helm 1.x] remove break statement

Signed-off-by: Caleb Lloyd <caleb@synadia.com>

* jsonpatch fix

Signed-off-by: Caleb Lloyd <caleb@synadia.com>

---------

Signed-off-by: Caleb Lloyd <caleb@synadia.com>
  • Loading branch information
caleblloyd authored and Caleb Lloyd committed Aug 1, 2023
1 parent 31222e6 commit f698ba9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion helm/charts/nats/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ keywords:
- nats
- messaging
- cncf
version: 1.0.0-beta.1
version: 1.0.0-beta.2
home: http://github.com/nats-io/k8s
maintainers:
- email: info@nats.io
Expand Down
5 changes: 3 additions & 2 deletions helm/charts/nats/files/stateful-set/reloader-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ volumeMounts:
- name: pid
mountPath: /var/run/nats
{{- range $mnt := .natsVolumeMounts }}
{{- $found := false }}
{{- range $.Values.reloader.natsVolumeMountPrefixes }}
{{- if (hasPrefix . $mnt.mountPath) }}
{{- if and (not $found) (hasPrefix . $mnt.mountPath) }}
{{- $found = true }}
- {{ toYaml $mnt | nindent 2}}
{{- break }}
{{- end }}
{{- end }}
{{- end }}
10 changes: 6 additions & 4 deletions helm/charts/nats/templates/_jsonpatch.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ output: JSON encoded map with 1 key:
*/}}
{{- define "jsonpatch" -}}
{{- $params := fromJson (toJson .) -}}
{{- $patches := $params.patch -}}
{{- $docContainer := pick $params "doc" -}}

{{- range $patch := $params.patch -}}
{{- range $patch := $patches -}}
{{- if not (hasKey $patch "op") -}}
{{- fail "patch is missing op key" -}}
{{- end -}}
Expand All @@ -33,9 +35,9 @@ output: JSON encoded map with 1 key:
{{- $reSlice := list -}}

{{- range $opPathKey := $opPathKeys -}}
{{- $obj := $params -}}
{{- $obj := $docContainer -}}
{{- if and (eq $patch.op "copy") (eq $opPathKey "from") -}}
{{- $obj := fromJson (toJson $params) -}}
{{- $obj = (fromJson (toJson $docContainer)) -}}
{{- end -}}
{{- $key := "doc" -}}
{{- $lastMap := dict "root" $obj -}}
Expand Down Expand Up @@ -213,5 +215,5 @@ output: JSON encoded map with 1 key:
{{- end -}}

{{- end -}}
{{- toJson (dict "doc" $params.doc) -}}
{{- toJson $docContainer -}}
{{- end -}}

0 comments on commit f698ba9

Please sign in to comment.