From 43546f04ecfa195777eae14a5bc8640a737f08d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Poyraz=20K=C3=BC=C3=A7=C3=BCkarslan?= <83272398+PoyrazK@users.noreply.github.com> Date: Thu, 7 May 2026 20:32:21 +0300 Subject: [PATCH] fix: Set opts.APIKey directly to bypass HOME/env confusion in CI CI environment has HOME set to a temp directory, causing saveConfig and createClient to use different config file paths. Set opts.APIKey directly to bypass this. --- cmd/cloud/rbac_cli_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/cloud/rbac_cli_test.go b/cmd/cloud/rbac_cli_test.go index a4521e975..70e1f1947 100644 --- a/cmd/cloud/rbac_cli_test.go +++ b/cmd/cloud/rbac_cli_test.go @@ -39,8 +39,13 @@ func TestCreateRoleCmd(t *testing.T) { saveConfig(rbacTestAPIKey) oldURL := opts.APIURL + oldKey := opts.APIKey opts.APIURL = server.URL - defer func() { opts.APIURL = oldURL }() + opts.APIKey = rbacTestAPIKey + defer func() { + opts.APIURL = oldURL + opts.APIKey = oldKey + }() _ = createRoleCmd.Flags().Set("description", "read-only") _ = createRoleCmd.Flags().Set("permissions", string(domain.PermissionInstanceRead))