mirror of
https://github.com/coder/terraform-provider-envbuilder.git
synced 2025-09-22 16:47:15 +00:00
chore: set TF_LOG=debug, always pull :latest envbuilder image (#14)
This commit is contained in:
parent
88ad94f356
commit
24b93e754d
2 changed files with 6 additions and 2 deletions
1
.github/workflows/test.yml
vendored
1
.github/workflows/test.yml
vendored
|
@ -85,5 +85,6 @@ jobs:
|
|||
- run: make test-registry
|
||||
- env:
|
||||
TF_ACC: "1"
|
||||
TF_LOG: "debug"
|
||||
run: go test -v -cover ./internal/provider/
|
||||
timeout-minutes: 10
|
||||
|
|
|
@ -151,12 +151,15 @@ func ensureImage(ctx context.Context, t testing.TB, cli *client.Client, ref stri
|
|||
images, err := cli.ImageList(ctx, image.ListOptions{})
|
||||
require.NoError(t, err, "list images")
|
||||
for _, img := range images {
|
||||
if slices.Contains(img.RepoTags, ref) {
|
||||
if strings.HasSuffix(ref, ":latest") {
|
||||
t.Logf("always pull latest")
|
||||
break
|
||||
} else if slices.Contains(img.RepoTags, ref) {
|
||||
t.Logf("image %q found locally, not pulling", ref)
|
||||
return
|
||||
}
|
||||
}
|
||||
t.Logf("image %s not found locally, attempting to pull", ref)
|
||||
t.Logf("attempting to pull image %q", ref)
|
||||
resp, err := cli.ImagePull(ctx, ref, image.PullOptions{})
|
||||
require.NoError(t, err)
|
||||
_, err = io.ReadAll(resp)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue