k8s
k8s copied to clipboard
nats-box: wrong usage returns exit 0 with kubectl exec
For example:
$ kubectl run -i --rm --tty nats-box --image=synadia/nats-box:0.3.0 --restart=Never
nats-box:~# nats-pub -s asdf foo bar
nats: no servers available for connection
$ echo $?
1
But after deploying with Helm and entering the container, it does not exit 1
$ helm install my-nats nats/nats
$ kubectl exec -it my-nats-box -n default -- /bin/sh
$ nats-pub -s asdf hello world
$ echo $?
0
NATS_URL should be using nats.name template here in case of using nameOverride
https://github.com/nats-io/k8s/blob/master/helm/charts/nats/templates/nats-box.yaml#L30
Closing due to age of issue; if experiencing in current versions please open a new issue.