diff --git a/internal/hcp/api/client.go b/internal/hcp/api/client.go index 78f8ee37c..7d771f6ed 100644 --- a/internal/hcp/api/client.go +++ b/internal/hcp/api/client.go @@ -37,13 +37,6 @@ type Client struct { // Client authentication requires the following environment variables be set HCP_CLIENT_ID and HCP_CLIENT_SECRET. // Upon error a HCPClientError will be returned. func NewClient() (*Client, error) { - if !env.HasHCPCredentials() { - return nil, &ClientError{ - StatusCode: InvalidClientConfig, - Err: fmt.Errorf("the client authentication requires both %s and %s environment variables to be set", env.HCPClientID, env.HCPClientSecret), - } - } - hcpClientCfg := httpclient.Config{ SourceChannel: fmt.Sprintf("packer/%s", version.PackerVersion.FormattedVersion()), } diff --git a/internal/hcp/registry/hcp.go b/internal/hcp/registry/hcp.go index 6204abe08..5b9867b41 100644 --- a/internal/hcp/registry/hcp.go +++ b/internal/hcp/registry/hcp.go @@ -63,17 +63,6 @@ func IsHCPEnabled(cfg packer.Handler) bool { func createConfiguredBucket(templateDir string, opts ...bucketConfigurationOpts) (*Bucket, hcl.Diagnostics) { var diags hcl.Diagnostics - if !env.HasHCPCredentials() { - diags = append(diags, &hcl.Diagnostic{ - Summary: "HCP authentication information required", - Detail: fmt.Sprintf("The client authentication requires both %s and %s environment "+ - "variables to be set for authenticating with HCP.", - env.HCPClientID, - env.HCPClientSecret), - Severity: hcl.DiagError, - }) - } - bucket := NewBucketWithVersion() for _, opt := range opts {