From 98b1d6b229e8b4b710b301597709e1da066ee1df Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Tue, 14 Nov 2023 11:06:01 -0800 Subject: [PATCH] Always check env when building HCP Client (#673) --- internal/clients/client.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/clients/client.go b/internal/clients/client.go index 809352024..8d588c242 100644 --- a/internal/clients/client.go +++ b/internal/clients/client.go @@ -85,13 +85,11 @@ type ClientConfig struct { // NewClient creates a new Client that is capable of making HCP requests func NewClient(config ClientConfig) (*Client, error) { // Build the HCP Config options - var opts []hcpConfig.HCPConfigOption + opts := []hcpConfig.HCPConfigOption{hcpConfig.FromEnv()} if config.ClientID != "" && config.ClientSecret != "" { opts = append(opts, hcpConfig.WithClientCredentials(config.ClientID, config.ClientSecret)) } else if config.CredentialFile != "" { opts = append(opts, hcpConfig.WithCredentialFilePath(config.CredentialFile)) - } else { - opts = append(opts, hcpConfig.FromEnv()) } // Create the HCP Config