diff --git a/datasource/hcp-packer-image/data.go b/datasource/hcp-packer-image/data.go index d88fdc795dc..6b72366ea1d 100644 --- a/datasource/hcp-packer-image/data.go +++ b/datasource/hcp-packer-image/data.go @@ -36,9 +36,9 @@ type Config struct { // Mutually exclusive with `iteration_id`. // If using several images from a single iteration, you may prefer // sourcing an iteration first, and referencing it for subsequent uses, - // as every `hcp_packer_image` with the channel set will generate a + // as every `hcp-packer-image` with the channel set will generate a // potentially billable HCP Packer request, but if several - // `hcp_packer_image`s use a shared `hcp_packer_iteration` that will + // `hcp-packer-image`s use a shared `hcp-packer-iteration` that will // only generate one potentially billable request. Channel string `mapstructure:"channel" required:"true"` // The ID of the iteration to use when retrieving your image diff --git a/internal/hcp/api/service_build.go b/internal/hcp/api/service_build.go index 3304c2d9e2d..69ce13b2b34 100644 --- a/internal/hcp/api/service_build.go +++ b/internal/hcp/api/service_build.go @@ -2,7 +2,7 @@ package api import ( "context" - "errors" + "fmt" hcpPackerAPI "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/client/packer_service" hcpPackerModels "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2023-01-01/models" @@ -84,7 +84,9 @@ func (c *Client) UpdateBuild( } if resp == nil { - return "", errors.New("not sure why response is nil") + return "", fmt.Errorf( + "something went wrong retrieving the build %s from bucket %s", buildID, bucketName, + ) } return resp.Payload.Build.ID, nil diff --git a/internal/hcp/registry/deprecated_ds_config.go b/internal/hcp/registry/deprecated_ds_config.go index bb47c495da4..20c3639807d 100644 --- a/internal/hcp/registry/deprecated_ds_config.go +++ b/internal/hcp/registry/deprecated_ds_config.go @@ -72,7 +72,7 @@ func withDeprecatedDatasourceConfiguration(vals map[string]cty.Value, ui sdkpack diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid HCP datasources", - Detail: fmt.Sprintf("Failed to decode hcp_packer_iteration datasources: %s", err), + Detail: fmt.Sprintf("Failed to decode hcp-packer-iteration datasources: %s", err), }) return diags } diff --git a/website/content/partials/datasource/hcp-packer-image/Config-required.mdx b/website/content/partials/datasource/hcp-packer-image/Config-required.mdx index cca6bec0984..95abfd1fe85 100644 --- a/website/content/partials/datasource/hcp-packer-image/Config-required.mdx +++ b/website/content/partials/datasource/hcp-packer-image/Config-required.mdx @@ -7,9 +7,9 @@ Mutually exclusive with `iteration_id`. If using several images from a single iteration, you may prefer sourcing an iteration first, and referencing it for subsequent uses, - as every `hcp_packer_image` with the channel set will generate a + as every `hcp-packer-image` with the channel set will generate a potentially billable HCP Packer request, but if several - `hcp_packer_image`s use a shared `hcp_packer_iteration` that will + `hcp-packer-image`s use a shared `hcp-packer-iteration` that will only generate one potentially billable request. - `iteration_id` (string) - The ID of the iteration to use when retrieving your image