trim prefix from server version
It's not part of the `flux check` output. Signed-off-by: Max Jonas Werner <mail@makk.es>
This commit is contained in:
@@ -22,6 +22,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/fluxcd/flux2/internal/utils"
|
"github.com/fluxcd/flux2/internal/utils"
|
||||||
@@ -38,7 +39,9 @@ func TestCheckPre(t *testing.T) {
|
|||||||
t.Fatalf("Error unmarshalling '%s': %v", jsonOutput, err.Error())
|
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{
|
cmd := cmdTestCase{
|
||||||
args: "check --pre",
|
args: "check --pre",
|
||||||
|
|||||||
Reference in New Issue
Block a user