Skip to content

Commit 0095ddb

Browse files
Apply suggestions from code review
Co-authored-by: Danny Kopping <[email protected]>
1 parent 5fd5c4c commit 0095ddb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/resources/cached_image.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
page_title: "envbuilder_cached_image Resource - envbuilder"
44
subcategory: ""
55
description: |-
6-
The cached image resource can be used to retrieve a cached image produced by envbuilder. Creating this resource will clone the specified Git repository, read a Devcontainer specification or Dockerfile, and check for its presence in the provided cache repo. If any of the layers of the cached image are missing in the provided cache repo, the image will be considered as missing. A cached image in this state will be recreated until found.
6+
A `envbuilder_cached_image` can be used to retrieve a cached image produced by envbuilder. Creating this resource will clone the specified Git repository, read a Devcontainer specification or Dockerfile, and check for its presence in the provided cache repo. If any of the layers of the cached image are missing in the provided cache repo, the image will be considered as missing. A `envbuilder_cached_image` resource in this state will be recreated until a cached image is found in the registry.
77
---
88

99
# envbuilder_cached_image (Resource)

internal/provider/cached_image_resource.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ func (r *CachedImageResource) Delete(ctx context.Context, req resource.DeleteReq
381381
func (r *CachedImageResource) runCacheProbe(ctx context.Context, data CachedImageResourceModel) (v1.Image, error) {
382382
tmpDir, err := os.MkdirTemp(os.TempDir(), "envbuilder-provider-cached-image-data-source")
383383
if err != nil {
384-
return nil, fmt.Errorf("Unable to create temp directory: %s", err.Error())
384+
return nil, fmt.Errorf("unable to create temp directory: %s", err.Error())
385385
}
386386
defer func() {
387387
if err := os.RemoveAll(tmpDir); err != nil {
@@ -408,7 +408,7 @@ func (r *CachedImageResource) runCacheProbe(ctx context.Context, data CachedImag
408408
envbuilderPath := filepath.Join(tmpDir, "envbuilder")
409409
if err := extractEnvbuilderFromImage(ctx, data.BuilderImage.ValueString(), envbuilderPath); err != nil {
410410
tflog.Error(ctx, "failed to fetch envbuilder binary from builder image", map[string]any{"err": err})
411-
return nil, fmt.Errorf("Failed to fetch the envbuilder binary from the builder image: %s", err.Error())
411+
return nil, fmt.Errorf("failed to fetch the envbuilder binary from the builder image: %s", err.Error())
412412
}
413413

414414
workspaceFolder := data.WorkspaceFolder.ValueString()

0 commit comments

Comments
 (0)