From 4d63636eb0dd75e73425f6253e304b887b705737 Mon Sep 17 00:00:00 2001 From: Kirandeep-Singh-Khehra <107160937+Kirandeep-Singh-Khehra@users.noreply.github.com> Date: Tue, 2 Jan 2024 22:56:50 +0530 Subject: [PATCH] Nats-bitnami fix (#408) * Nats-bitnami temporary fix Signed-off-by: nrupen * Updated coverage to disable GOSUMDB Signed-off-by: nrupen * Fixed bitnami + ib + shellcheck Signed-off-by: nrupen * Fixed Nats-Official Signed-off-by: nrupen * Fixed official Signed-off-by: nrupen --------- Signed-off-by: nrupen Co-authored-by: nrupen --- community_images/nats/bitnami/coverage.sh | 9 +++------ community_images/nats/ironbank/coverage.sh | 9 +++------ community_images/nats/official/coverage.sh | 9 +++++---- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/community_images/nats/bitnami/coverage.sh b/community_images/nats/bitnami/coverage.sh index 87a1e2553b..d7c28147d9 100755 --- a/community_images/nats/bitnami/coverage.sh +++ b/community_images/nats/bitnami/coverage.sh @@ -9,8 +9,6 @@ function test_nats() { local NAMESPACE=$1 local HELM_RELEASE=$2 - NATS_SERVER=${HELM_RELEASE}.${NAMESPACE}.svc.cluster.local - NATS_USER=$(kubectl get secret --namespace "${NAMESPACE}" "${HELM_RELEASE}" -o jsonpath='{.data.*}' | base64 -d | grep -m 1 user | awk '{print $2}' | tr -d '"') NATS_PASS=$(kubectl get secret --namespace "${NAMESPACE}" "${HELM_RELEASE}" -o jsonpath='{.data.*}' | base64 -d | grep -m 1 password | awk '{print $2}' | tr -d '"') echo -e "Client credentials:\n\tUser: $NATS_USER\n\tPassword: $NATS_PASS" @@ -24,10 +22,9 @@ function test_nats() { set -e set -x GO111MODULE=off go get github.com/nats-io/nats.go - go env -w GOPROXY=http://${NATS_SERVER}:8222,direct - go install golang.org/x/crypto/blake2b@v0.14.0 - go mod tidy - cd \"\$GOPATH\"/src/github.com/nats-io/nats.go/examples/nats-pub && go install && cd || exit + go env -w GOPROXY=direct + go env -w GOSUMDB=off + cd \"\$GOPATH\"/src/github.com/nats-io/nats.go/examples/nats-pub && go get golang.org/x/crypto/blake2b@v0.14.0 && go install && cd || exit cd \"\$GOPATH\"/src/github.com/nats-io/nats.go/examples/nats-echo && go install && cd || exit nats-echo -s nats://$NATS_USER:$NATS_PASS@${HELM_RELEASE}.${NAMESPACE}.svc.cluster.local:4222 SomeSubject & nats-pub -s nats://$NATS_USER:$NATS_PASS@${HELM_RELEASE}.${NAMESPACE}.svc.cluster.local:4222 -reply Hi SomeSubject 'Hi everyone'" > "$SCRIPTPATH"/commands.sh diff --git a/community_images/nats/ironbank/coverage.sh b/community_images/nats/ironbank/coverage.sh index efc428791e..83fcc410ff 100644 --- a/community_images/nats/ironbank/coverage.sh +++ b/community_images/nats/ironbank/coverage.sh @@ -27,15 +27,12 @@ function test_nats() { set -x set -e GO111MODULE=off go get github.com/nats-io/nats.go - go env -w GOPROXY=http://${NATS_SERVER}:8222,direct - go install golang.org/x/crypto/blake2b@v0.14.0 - go mod tidy - cd \"\$GOPATH\"/src/github.com/nats-io/nats.go/examples/nats-pub && go install && cd || exit + go env -w GOPROXY=direct + go env -w GOSUMDB=off + cd \"\$GOPATH\"/src/github.com/nats-io/nats.go/examples/nats-pub && go get golang.org/x/crypto/blake2b@v0.14.0 && go install && cd || exit cd \"\$GOPATH\"/src/github.com/nats-io/nats.go/examples/nats-echo && go install && cd || exit nats-echo -s nats://$NATS_USER:$NATS_PASS@${NATS_SERVER}:4222 SomeSubject & nats-pub -s nats://$NATS_USER:$NATS_PASS@${NATS_SERVER}:4222 -reply Hi SomeSubject 'Hi everyone'" > "$SCRIPTPATH"/commands.sh - # nats-echo -s nats://$NATS_USER:$NATS_PASS@${RELEASE_NAME}.${NAMESPACE}.svc.cluster.local:4222 SomeSubject & - # nats-pub -s nats://$NATS_USER:$NATS_PASS@${RELEASE_NAME}.${NAMESPACE}.svc.cluster.local:4222 -reply Hi SomeSubject 'Hi everyone'" > "$SCRIPTPATH"/commands.sh chmod +x "$SCRIPTPATH"/commands.sh POD_NAME="nats-release-client" diff --git a/community_images/nats/official/coverage.sh b/community_images/nats/official/coverage.sh index 39b684f8ec..cf1a2ece3c 100644 --- a/community_images/nats/official/coverage.sh +++ b/community_images/nats/official/coverage.sh @@ -21,11 +21,12 @@ function test_nats() { # wait for nats client to come up kubectl wait pods nats-release-client -n "${NAMESPACE}" --for=condition=ready --timeout=10m echo "#!/bin/bash + set -x + set -e GO111MODULE=off go get github.com/nats-io/nats.go - go env -w GOPROXY=http://${NATS_SERVER}:8222,direct - go install golang.org/x/crypto/blake2b@v0.14.0 - go mod tidy - cd \"\$GOPATH\"/src/github.com/nats-io/nats.go/examples/nats-pub && go install && cd || exit + go env -w GOPROXY=direct + go env -w GOSUMDB=off + cd \"\$GOPATH\"/src/github.com/nats-io/nats.go/examples/nats-pub && go get golang.org/x/crypto/blake2b@v0.14.0 && go install && cd || exit cd \"\$GOPATH\"/src/github.com/nats-io/nats.go/examples/nats-echo && go install && cd || exit nats-echo -s nats://$NATS_USER:$NATS_PASS@${HELM_RELEASE}.${NAMESPACE}.svc.cluster.local:4222 SomeSubject & nats-pub -s nats://$NATS_USER:$NATS_PASS@${HELM_RELEASE}.${NAMESPACE}.svc.cluster.local:4222 -reply Hi SomeSubject 'Hi everyone'" > "$SCRIPTPATH"/commands.sh