Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [TKC-2310] cloud ui url, org id, env id test workflow vars #5703

Merged
merged 3 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cmd/tcl/testworkflow-toolkit/spawn/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.UiUrl,
"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,
Expand Down
3 changes: 3 additions & 0 deletions cmd/testworkflow-toolkit/env/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ type envObjectStorageConfig struct {
type envCloudConfig struct {
Url string `envconfig:"TK_C_URL"`
ApiKey string `envconfig:"TK_C_KEY"`
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"`
TlsInsecure bool `envconfig:"TK_C_TLS_INSECURE" default:"false"`
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/testworkflows/testworkflowexecutor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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],

Expand Down
3 changes: 3 additions & 0 deletions pkg/testworkflows/testworkflowprocessor/stage/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.url}}",
"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}}",
Expand Down
Loading