From f766c5214c44f8794691a2f1bad84bdb9e60fbef Mon Sep 17 00:00:00 2001 From: Vladislav Sukhin Date: Tue, 30 Jul 2024 16:03:01 +0300 Subject: [PATCH 1/3] fix: cloud ui url, org id, env id vars Signed-off-by: Vladislav Sukhin --- cmd/tcl/testworkflow-toolkit/spawn/utils.go | 3 +++ cmd/testworkflow-toolkit/env/config.go | 3 +++ pkg/testworkflows/testworkflowexecutor/executor.go | 3 +++ pkg/testworkflows/testworkflowprocessor/stage/container.go | 3 +++ 4 files changed, 12 insertions(+) diff --git a/cmd/tcl/testworkflow-toolkit/spawn/utils.go b/cmd/tcl/testworkflow-toolkit/spawn/utils.go index 92d4812f4ed..0a3a13983ba 100644 --- a/cmd/tcl/testworkflow-toolkit/spawn/utils.go +++ b/cmd/tcl/testworkflow-toolkit/spawn/utils.go @@ -286,6 +286,9 @@ func CreateBaseMachine() expressions.Machine { "cloud.api.tlsInsecure": strconv.FormatBool(env.Config().Cloud.TlsInsecure), "cloud.api.skipVerify": strconv.FormatBool(env.Config().Cloud.SkipVerify), "cloud.api.url": env.Config().Cloud.Url, + "cloud.ui.url": env.Config().Cloud.UiUri, + "cloud.api.orgId": env.Config().Cloud.OrgId, + "cloud.api.envId": env.Config().Cloud.EnvId, "dashboard.url": env.Config().System.DashboardUrl, "api.url": env.Config().System.ApiUrl, diff --git a/cmd/testworkflow-toolkit/env/config.go b/cmd/testworkflow-toolkit/env/config.go index 23862f9d799..b86a381f68c 100644 --- a/cmd/testworkflow-toolkit/env/config.go +++ b/cmd/testworkflow-toolkit/env/config.go @@ -30,6 +30,9 @@ type envObjectStorageConfig struct { type envCloudConfig struct { Url string `envconfig:"TK_C_URL"` ApiKey string `envconfig:"TK_C_KEY"` + UiUri string `envconfig:"TK_C_UI_URI"` + OrgId string `envconfig:"TK_C_ORG_ID"` + EnvId string `envconfig:"TK_C_ENV_ID"` SkipVerify bool `envconfig:"TK_C_SKIP_VERIFY" default:"false"` TlsInsecure bool `envconfig:"TK_C_TLS_INSECURE" default:"false"` } diff --git a/pkg/testworkflows/testworkflowexecutor/executor.go b/pkg/testworkflows/testworkflowexecutor/executor.go index fbfadebc7fe..637e7a69680 100644 --- a/pkg/testworkflows/testworkflowexecutor/executor.go +++ b/pkg/testworkflows/testworkflowexecutor/executor.go @@ -411,6 +411,9 @@ func (e *executor) Execute(ctx context.Context, workflow testworkflowsv1.TestWor "cloud.api.tlsInsecure": common.GetOr(os.Getenv("TESTKUBE_PRO_TLS_INSECURE"), os.Getenv("TESTKUBE_CLOUD_TLS_INSECURE"), "false"), "cloud.api.skipVerify": common.GetOr(os.Getenv("TESTKUBE_PRO_SKIP_VERIFY"), os.Getenv("TESTKUBE_CLOUD_SKIP_VERIFY"), "false"), "cloud.api.url": common.GetOr(os.Getenv("TESTKUBE_PRO_URL"), os.Getenv("TESTKUBE_CLOUD_URL")), + "cloud.ui.url": common.GetOr(os.Getenv("TESTKUBE_PRO_UI_URL"), os.Getenv("TESTKUBE_CLOUD_UI_URL")), + "cloud.api.orgId": common.GetOr(os.Getenv("TESTKUBE_PRO_ORG_ID"), os.Getenv("TESTKUBE_CLOUD_ORG_ID")), + "cloud.api.envId": common.GetOr(os.Getenv("TESTKUBE_PRO_ENV_ID"), os.Getenv("TESTKUBE_CLOUD_ENV_ID")), "serviceaccount.default": e.serviceAccountNames[namespace], diff --git a/pkg/testworkflows/testworkflowprocessor/stage/container.go b/pkg/testworkflows/testworkflowprocessor/stage/container.go index 81a4752b9c1..d39969d8d82 100644 --- a/pkg/testworkflows/testworkflowprocessor/stage/container.go +++ b/pkg/testworkflows/testworkflowprocessor/stage/container.go @@ -451,6 +451,9 @@ func (c *container) EnableToolkit(ref string) Container { "TK_C_KEY": "{{internal.cloud.api.key}}", "TK_C_TLS_INSECURE": "{{internal.cloud.api.tlsInsecure}}", "TK_C_SKIP_VERIFY": "{{internal.cloud.api.skipVerify}}", + "TK_C_UI_URL": "{{internal.cloud.ui.uri}}", + "TK_C_ORG_ID": "{{internal.cloud.api.orgId}}", + "TK_C_ENV_ID": "{{internal.cloud.api.envId}}", "TK_OS_ENDPOINT": "{{internal.storage.url}}", "TK_OS_ACCESSKEY": "{{internal.storage.accessKey}}", "TK_OS_SECRETKEY": "{{internal.storage.secretKey}}", From ef405ac9ff7d5ceab93b7d6a0fe5b91fb972f398 Mon Sep 17 00:00:00 2001 From: Vladislav Sukhin Date: Tue, 30 Jul 2024 19:39:34 +0300 Subject: [PATCH 2/3] fix: rename var Signed-off-by: Vladislav Sukhin --- cmd/tcl/testworkflow-toolkit/spawn/utils.go | 2 +- cmd/testworkflow-toolkit/env/config.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/tcl/testworkflow-toolkit/spawn/utils.go b/cmd/tcl/testworkflow-toolkit/spawn/utils.go index 0a3a13983ba..dd8dbfd86c5 100644 --- a/cmd/tcl/testworkflow-toolkit/spawn/utils.go +++ b/cmd/tcl/testworkflow-toolkit/spawn/utils.go @@ -286,7 +286,7 @@ func CreateBaseMachine() expressions.Machine { "cloud.api.tlsInsecure": strconv.FormatBool(env.Config().Cloud.TlsInsecure), "cloud.api.skipVerify": strconv.FormatBool(env.Config().Cloud.SkipVerify), "cloud.api.url": env.Config().Cloud.Url, - "cloud.ui.url": env.Config().Cloud.UiUri, + "cloud.ui.url": env.Config().Cloud.UiUrl, "cloud.api.orgId": env.Config().Cloud.OrgId, "cloud.api.envId": env.Config().Cloud.EnvId, diff --git a/cmd/testworkflow-toolkit/env/config.go b/cmd/testworkflow-toolkit/env/config.go index b86a381f68c..02bdff02e42 100644 --- a/cmd/testworkflow-toolkit/env/config.go +++ b/cmd/testworkflow-toolkit/env/config.go @@ -30,7 +30,7 @@ type envObjectStorageConfig struct { type envCloudConfig struct { Url string `envconfig:"TK_C_URL"` ApiKey string `envconfig:"TK_C_KEY"` - UiUri string `envconfig:"TK_C_UI_URI"` + UiUrl string `envconfig:"TK_C_UI_URL"` OrgId string `envconfig:"TK_C_ORG_ID"` EnvId string `envconfig:"TK_C_ENV_ID"` SkipVerify bool `envconfig:"TK_C_SKIP_VERIFY" default:"false"` From 25ab771c55d0a4e0557f48c0f5d07a6e73bc49dc Mon Sep 17 00:00:00 2001 From: Vladislav Sukhin Date: Tue, 30 Jul 2024 19:42:07 +0300 Subject: [PATCH 3/3] fix: rename var Signed-off-by: Vladislav Sukhin --- pkg/testworkflows/testworkflowprocessor/stage/container.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/testworkflows/testworkflowprocessor/stage/container.go b/pkg/testworkflows/testworkflowprocessor/stage/container.go index d39969d8d82..8c5d6c3946c 100644 --- a/pkg/testworkflows/testworkflowprocessor/stage/container.go +++ b/pkg/testworkflows/testworkflowprocessor/stage/container.go @@ -451,7 +451,7 @@ func (c *container) EnableToolkit(ref string) Container { "TK_C_KEY": "{{internal.cloud.api.key}}", "TK_C_TLS_INSECURE": "{{internal.cloud.api.tlsInsecure}}", "TK_C_SKIP_VERIFY": "{{internal.cloud.api.skipVerify}}", - "TK_C_UI_URL": "{{internal.cloud.ui.uri}}", + "TK_C_UI_URL": "{{internal.cloud.ui.url}}", "TK_C_ORG_ID": "{{internal.cloud.api.orgId}}", "TK_C_ENV_ID": "{{internal.cloud.api.envId}}", "TK_OS_ENDPOINT": "{{internal.storage.url}}",