diff --git a/internal/provider/config/config.go b/internal/provider/config/config.go index d6498b53..7ca1177a 100644 --- a/internal/provider/config/config.go +++ b/internal/provider/config/config.go @@ -28,7 +28,7 @@ func getEnv(key, fallback string) string { } func InitializeConfig() { - Host = getEnv("UXI_HOST", UXIDefaultHost) - ClientID = os.Getenv("GREENLAKE_UXI_CLIENT_ID") - ClientSecret = os.Getenv("GREENLAKE_UXI_CLIENT_SECRET") + Host = getEnv("HPEUXI_HOST_OVERRIDE", UXIDefaultHost) + ClientID = os.Getenv("HPEUXI_CLIENT_ID") + ClientSecret = os.Getenv("HPEUXI_CLIENT_SECRET") } diff --git a/internal/provider/provider.go b/internal/provider/provider.go index ffa82667..913722cf 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -65,13 +65,13 @@ func (p *hpeuxiConfigurationProvider) Schema( "client_id": schema.StringAttribute{ Description: "The Client ID as obtained from HPE GreenLake API client credentials. " + "It is recommended that this configuration is left blank and the Client ID " + - "is exported as the `GREENLAKE_UXI_CLIENT_ID` environment variable instead.", + "is exported as the `HPEUXI_CLIENT_ID` environment variable instead.", Optional: true, }, "client_secret": schema.StringAttribute{ Description: "The Client Secret as obtained from HPE GreenLake API client credentials. " + "It is recommended that this configuration is left blank and the Client Secret " + - "is exported as the `GREENLAKE_UXI_CLIENT_SECRET` environment variable instead.", + "is exported as the `HPEUXI_CLIENT_SECRET` environment variable instead.", Optional: true, Sensitive: true, }, @@ -113,7 +113,7 @@ func (p *hpeuxiConfigurationProvider) Configure( path.Root("client_id"), "Missing Client ID", "The provider cannot initialize as there is a missing or empty value for the Client ID. "+ - "Set the client_id value in the provider configuration or use the GREENLAKE_UXI_CLIENT_ID "+ + "Set the client_id value in the provider configuration or use the HPEUXI_CLIENT_ID "+ "environment variable (recommended). If either is already set, ensure the value is not empty.", ) } @@ -123,7 +123,7 @@ func (p *hpeuxiConfigurationProvider) Configure( path.Root("client_secret"), "Missing Client Secret", "The provider cannot initialize as there is a missing or empty value for the Client Secret. "+ - "Set the client_secret value in the provider configuration or use the GREENLAKE_UXI_CLIENT_SECRET "+ + "Set the client_secret value in the provider configuration or use the HPEUXI_CLIENT_SECRET "+ "environment variable (recommended). If either is already set, ensure the value is not empty.", ) } diff --git a/test/live/resources/agent_test.go b/test/live/resources/agent_test.go index 87cb2cfa..8674423a 100644 --- a/test/live/resources/agent_test.go +++ b/test/live/resources/agent_test.go @@ -24,7 +24,7 @@ func TestAgentResource(t *testing.T) { // we provision an agent here so that we have something to delete later on agentID, err := util.ProvisionAgent{ CustomerID: config.CustomerID, - ProvisionToken: os.Getenv("hpeuxi_PROVISION_TOKEN"), + ProvisionToken: os.Getenv("HPEUXI_PROVISION_TOKEN"), DeviceSerial: config.AgentCreateSerial, DeviceGatewayHost: config.DeviceGatewayHost, }.Provision() diff --git a/test/mocked/datasources/main_test.go b/test/mocked/datasources/main_test.go index cc943d80..6be859c7 100644 --- a/test/mocked/datasources/main_test.go +++ b/test/mocked/datasources/main_test.go @@ -12,11 +12,11 @@ import ( ) func TestMain(m *testing.M) { - os.Setenv("UXI_HOST", util.MockDomain) + os.Setenv("HPEUXI_HOST_OVERRIDE", util.MockDomain) exitCode := m.Run() - os.Unsetenv("UXI_HOST") + os.Unsetenv("HPEUXI_HOST_OVERRIDE") os.Exit(exitCode) } diff --git a/test/mocked/resources/main_test.go b/test/mocked/resources/main_test.go index 048916c4..a276e20c 100644 --- a/test/mocked/resources/main_test.go +++ b/test/mocked/resources/main_test.go @@ -12,10 +12,10 @@ import ( ) func TestMain(m *testing.M) { - os.Setenv("UXI_HOST", util.MockDomain) + os.Setenv("HPEUXI_HOST_OVERRIDE", util.MockDomain) exitCode := m.Run() - os.Unsetenv("UXI_HOST") + os.Unsetenv("HPEUXI_HOST_OVERRIDE") os.Exit(exitCode) }