From e35da1c8904e20955ddf811db225aae587e30dac Mon Sep 17 00:00:00 2001 From: Max Jonas Werner Date: Wed, 18 May 2022 17:08:50 +0200 Subject: [PATCH] trim prefix from server version It's not part of the `flux check` output. Signed-off-by: Max Jonas Werner --- cmd/flux/check_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/flux/check_test.go b/cmd/flux/check_test.go index abfd8463..50aac200 100644 --- a/cmd/flux/check_test.go +++ b/cmd/flux/check_test.go @@ -22,6 +22,7 @@ package main import ( "context" "encoding/json" + "strings" "testing" "github.com/fluxcd/flux2/internal/utils" @@ -38,7 +39,9 @@ func TestCheckPre(t *testing.T) { t.Fatalf("Error unmarshalling '%s': %v", jsonOutput, err.Error()) } - serverGitVersion := versions["serverVersion"].(map[string]interface{})["gitVersion"].(string) + serverGitVersion := strings.TrimPrefix( + versions["serverVersion"].(map[string]interface{})["gitVersion"].(string), + "v") cmd := cmdTestCase{ args: "check --pre",