From 902692f7341e3af2113785da6c98f8db05ee468b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Ramon=20Ma=C3=B1es?= Date: Fri, 23 Jun 2023 14:03:08 +0200 Subject: [PATCH] feat: generate tmp-ids concat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jose Ramon MaƱes --- deployment/overlays/robusta-torch-1/kustomization.yaml | 2 +- pkg/k8s/commands.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deployment/overlays/robusta-torch-1/kustomization.yaml b/deployment/overlays/robusta-torch-1/kustomization.yaml index 8beaa79..8d1e93d 100644 --- a/deployment/overlays/robusta-torch-1/kustomization.yaml +++ b/deployment/overlays/robusta-torch-1/kustomization.yaml @@ -8,7 +8,7 @@ resources: images: - name: ghcr.io/jrmanes/torch - newTag: aa51c18 + newTag: 9ffb274 configMapGenerator: - name: config diff --git a/pkg/k8s/commands.go b/pkg/k8s/commands.go index 5fe8f1f..984fe27 100644 --- a/pkg/k8s/commands.go +++ b/pkg/k8s/commands.go @@ -61,9 +61,9 @@ else --output-document - \ http://localhost:26658 > /tmp/tmp-id) -Addr=$(echo $(cat /tmp/tmp-id) | jq -r '.result.Addrs[0]') +ADDR=$(echo $(cat /tmp/tmp-id) | grep -o '"Addrs":\s*\["[^"]*"' tmp-id | sed 's/"Addrs":\s*\["\([^"]*\)".*/\1/') ID=$(echo $(cat /tmp/tmp-id) | jq -r '.result.ID') -output="$Addr/$ID" +output="$ADDR/$ID" echo -n "${output}" >> "%[1]s" cat "%[1]s"