Skip to content

Commit

Permalink
[nats helm] call natsbox entrypoint (#883)
Browse files Browse the repository at this point in the history
* [nats helm] call natsbox entrypoint

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

* pass -- for $0

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

---------

Signed-off-by: Caleb Lloyd <caleb@synadia.com>
  • Loading branch information
caleblloyd committed Apr 1, 2024
1 parent 39f2242 commit 1348b19
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion helm/charts/nats/files/nats-box/deployment/container.yaml
Expand Up @@ -22,8 +22,11 @@ command:
fi
{{- end }}
cd "$work_dir"
exec sh -ec "$0"
exec /entrypoint.sh "$@"
- --
args:
- sh
- -ec
- trap true INT TERM; sleep infinity & wait
volumeMounts:
# contexts secret
Expand Down
2 changes: 2 additions & 0 deletions helm/charts/nats/templates/tests/request-reply.yaml
Expand Up @@ -7,6 +7,8 @@ kind: Pod
{{- with .container }}
{{- $_ := set . "merge" (dict
"args" (list
"sh"
"-ec"
"nats reply --echo echo & pid=\"$!\"; sleep 1; nats request echo hi > /tmp/resp; kill \"$pid\"; wait; grep -qF hi /tmp/resp"
)
) }}
Expand Down
5 changes: 4 additions & 1 deletion helm/charts/nats/test/defaults_test.go
Expand Up @@ -284,6 +284,8 @@ func DefaultResources(t *testing.T, test *Test) *Resources {
Containers: []corev1.Container{
{
Args: []string{
"sh",
"-ec",
"trap true INT TERM; sleep infinity & wait",
},
Command: []string{
Expand All @@ -299,8 +301,9 @@ if ! [ -f context.txt ]; then
echo -n "default" > context.txt
fi
cd "$work_dir"
exec sh -ec "$0"
exec /entrypoint.sh "$@"
`,
"--",
},
Image: dd.NatsBoxImage,
Name: "nats-box",
Expand Down

0 comments on commit 1348b19

Please sign in to comment.