mirror of
https://github.com/coder/terraform-provider-envbuilder.git
synced 2025-10-22 06:06:53 +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
internal/provider
|
@ -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