From e24579827e91e0109adbf8754830c73ef068d2ff Mon Sep 17 00:00:00 2001 From: Armin Schlegel Date: Thu, 8 Dec 2022 08:11:47 +0100 Subject: [PATCH] fix: added preStop hook for nats-leafnode-sidecar --- cue/traits/edge-network-participant-trait.cue | 9 ++++++++- .../vela-caps/traits/edge-network-participant-trait.yaml | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cue/traits/edge-network-participant-trait.cue b/cue/traits/edge-network-participant-trait.cue index ef48473..0ac74b9 100644 --- a/cue/traits/edge-network-participant-trait.cue +++ b/cue/traits/edge-network-participant-trait.cue @@ -98,7 +98,7 @@ template: { }, { "name": "nats-leafnode-sidecar", - "image": "ghcr.io/edgefarm/nats-leafnode-client:pr-28", + "image": "ghcr.io/edgefarm/nats-leafnode-client:0.2.0-beta.2", "command": ["/bin/sh", "-c", "env && echo $REMOTE && /client --remote $REMOTE --natsuri nats://172.17.0.1:4222 --creds /creds --component "+context.name], "env": [ { @@ -112,6 +112,13 @@ template: { } } ], + "lifecycle": { + "preStop": { + "exec": { + "command": ["/bin/sh", "-c", "kill -SIGUSR1 1"] + } + } + }, "volumeMounts": [ { "name": "creds", diff --git a/manifests/vela-caps/traits/edge-network-participant-trait.yaml b/manifests/vela-caps/traits/edge-network-participant-trait.yaml index df9c5fa..fe55557 100644 --- a/manifests/vela-caps/traits/edge-network-participant-trait.yaml +++ b/manifests/vela-caps/traits/edge-network-participant-trait.yaml @@ -89,7 +89,7 @@ spec: }, { name: "nats-leafnode-sidecar" - image: "ghcr.io/edgefarm/nats-leafnode-client:pr-28" + image: "ghcr.io/edgefarm/nats-leafnode-client:0.2.0-beta.2" command: ["/bin/sh", "-c", "env && echo $REMOTE && /client --remote $REMOTE --natsuri nats://172.17.0.1:4222 --creds /creds --component " + context.name] env: [ { @@ -101,6 +101,7 @@ spec: } }, ] + lifecycle: preStop: exec: command: ["/bin/sh", "-c", "kill -SIGUSR1 1"] volumeMounts: [ { name: "creds"