Skip to content

Commit

Permalink
Merge branch 'main' into vsukhin/feature/test-workflow-running-context
Browse files Browse the repository at this point in the history
  • Loading branch information
vsukhin committed Oct 24, 2024
2 parents b768027 + c08b9f8 commit 993a133
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
12 changes: 12 additions & 0 deletions cmd/kubectl-testkube/commands/common/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"os"
"runtime"
"strconv"

"github.com/spf13/cobra"
Expand All @@ -15,6 +16,8 @@ import (
"github.com/kubeshop/testkube/pkg/cloudlogin"
)

const UserAgentCLI = "Testkube-CLI"

// GetClient returns api client
func GetClient(cmd *cobra.Command) (client.Client, string, error) {
clientType := cmd.Flag("client").Value.String()
Expand All @@ -35,6 +38,11 @@ func GetClient(cmd *cobra.Command) (client.Client, string, error) {
return nil, "", fmt.Errorf("parsing flag value %w", err)
}

if headers == nil {
headers = make(map[string]string)
}
headers["User-Agent"] = userAgent()

options := client.Options{
Namespace: namespace,
ApiUri: apiURI,
Expand Down Expand Up @@ -116,3 +124,7 @@ func GetClient(cmd *cobra.Command) (client.Client, string, error) {

return c, namespace, nil
}

func userAgent() string {
return fmt.Sprintf("%s/%s (%s; %s) Go/%s", UserAgentCLI, Version, runtime.GOOS, runtime.GOARCH, runtime.Version())
}
6 changes: 2 additions & 4 deletions test/suites/test-workflows/junit-workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
apiVersion: testworkflows.testkube.io/v1
kind: TestWorkflow
metadata:
name: curl-workflow-suite
name: junit-workflow-suite
labels:
core-tests: workflows-suite
spec:
steps:
- execute:
parallelism: 2
workflows:
- name: curl-workflow-smoke
- name: curl-workflow-smoke-matrix

- name: junit5-workflow-smoke

0 comments on commit 993a133

Please sign in to comment.