Skip to content

Commit 6137223

Browse files
authored
update kaniko to latest main to keep in sync with envbuilder (#47)
1 parent 482a446 commit 6137223

File tree

3 files changed

+42
-8
lines changed

3 files changed

+42
-8
lines changed

go.mod

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ module github.com/coder/terraform-provider-envbuilder
33
go 1.22.4
44

55
// We use our own Kaniko fork.
6-
replace github.com/GoogleContainerTools/kaniko => github.com/coder/kaniko v0.0.0-20240807142221-ffc5e60fca41
6+
replace github.com/GoogleContainerTools/kaniko => github.com/coder/kaniko v0.0.0-20240830141327-f307586e3dca
77

88
// Required to import codersdk due to gvisor dependency.
99
replace tailscale.com => github.com/coder/tailscale v1.1.1-0.20240702054557-aa558fbe5374
1010

1111
require (
1212
github.com/GoogleContainerTools/kaniko v1.9.2
1313
github.com/coder/envbuilder v1.0.0-rc.0.0.20240830145058-fb7e689f39ed
14+
github.com/coder/serpent v0.7.0
1415
github.com/docker/docker v26.1.5+incompatible
1516
github.com/gliderlabs/ssh v0.3.7
1617
github.com/go-git/go-billy/v5 v5.5.0
@@ -22,6 +23,7 @@ require (
2223
github.com/hashicorp/terraform-plugin-go v0.23.0
2324
github.com/hashicorp/terraform-plugin-log v0.9.0
2425
github.com/hashicorp/terraform-plugin-testing v1.10.0
26+
github.com/spf13/pflag v1.0.5
2527
github.com/stretchr/testify v1.9.0
2628
)
2729

@@ -96,7 +98,6 @@ require (
9698
github.com/coder/pretty v0.0.0-20230908205945-e89ba86370e0 // indirect
9799
github.com/coder/quartz v0.1.0 // indirect
98100
github.com/coder/retry v1.5.1 // indirect
99-
github.com/coder/serpent v0.7.0 // indirect
100101
github.com/coder/terraform-provider-coder v0.23.0 // indirect
101102
github.com/containerd/cgroups v1.1.0 // indirect
102103
github.com/containerd/cgroups/v3 v3.0.2 // indirect
@@ -185,7 +186,6 @@ require (
185186
github.com/jmespath/go-jmespath v0.4.0 // indirect
186187
github.com/josharian/native v1.1.1-0.20230202152459-5c7d0dd6ab86 // indirect
187188
github.com/jsimonetti/rtnetlink v1.3.5 // indirect
188-
github.com/karrick/godirwalk v1.16.1 // indirect
189189
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
190190
github.com/kevinburke/ssh_config v1.2.0 // indirect
191191
github.com/klauspost/compress v1.17.9 // indirect
@@ -255,7 +255,6 @@ require (
255255
github.com/spaolacci/murmur3 v1.1.0 // indirect
256256
github.com/spf13/afero v1.11.0 // indirect
257257
github.com/spf13/cast v1.6.0 // indirect
258-
github.com/spf13/pflag v1.0.5 // indirect
259258
github.com/tailscale/certstore v0.1.1-0.20220316223106-78d6e1c49d8d // indirect
260259
github.com/tailscale/golang-x-crypto v0.0.0-20230713185742-f0b76a10a08e // indirect
261260
github.com/tailscale/goupnp v1.0.1-0.20210804011211-c64d0f06ea05 // indirect
@@ -264,6 +263,7 @@ require (
264263
github.com/tailscale/wireguard-go v0.0.0-20231121184858-cc193a0b3272 // indirect
265264
github.com/tcnksm/go-httpstat v0.2.0 // indirect
266265
github.com/tinylib/msgp v1.1.8 // indirect
266+
github.com/twpayne/go-vfs/v5 v5.0.4 // indirect
267267
github.com/u-root/uio v0.0.0-20240209044354-b3d14b93376a // indirect
268268
github.com/valyala/fasthttp v1.55.0 // indirect
269269
github.com/vbatts/tar-split v0.11.5 // indirect

go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ github.com/coder/coder/v2 v2.10.1-0.20240704130443-c2d44d16a352 h1:L/EjCuZxs5tOc
188188
github.com/coder/coder/v2 v2.10.1-0.20240704130443-c2d44d16a352/go.mod h1:P1KoQSgnKEAG6Mnd3YlGzAophty+yKA9VV48LpfNRvo=
189189
github.com/coder/envbuilder v1.0.0-rc.0.0.20240830145058-fb7e689f39ed h1:sDEjs9qB2uJ7O85vGmzMja99IZuLvesxElOUFyy22UY=
190190
github.com/coder/envbuilder v1.0.0-rc.0.0.20240830145058-fb7e689f39ed/go.mod h1:LWImvtIWaX3eiAI3zyU46WE/PrE099nCut1zJultSk0=
191-
github.com/coder/kaniko v0.0.0-20240807142221-ffc5e60fca41 h1:1Ye7AcLnuT5IDv6il7Fxo+aqpzlWfedkpraCCwx8Lyo=
192-
github.com/coder/kaniko v0.0.0-20240807142221-ffc5e60fca41/go.mod h1:YMK7BlxerzLlMwihGxNWUaFoN9LXCij4P+w/8/fNlcM=
191+
github.com/coder/kaniko v0.0.0-20240830141327-f307586e3dca h1:PrcSWrllqipTrtet50a3VyAJEQmjziIZyhpy0bsC6o0=
192+
github.com/coder/kaniko v0.0.0-20240830141327-f307586e3dca/go.mod h1:XoTDIhNF0Ll4tLmRYdOn31udU9w5zFrY2PME/crSRCA=
193193
github.com/coder/pretty v0.0.0-20230908205945-e89ba86370e0 h1:3A0ES21Ke+FxEM8CXx9n47SZOKOpgSE1bbJzlE4qPVs=
194194
github.com/coder/pretty v0.0.0-20230908205945-e89ba86370e0/go.mod h1:5UuS2Ts+nTToAMeOjNlnHFkPahrtDkmpydBen/3wgZc=
195195
github.com/coder/quartz v0.1.0 h1:cLL+0g5l7xTf6ordRnUMMiZtRE8Sq5LxpghS63vEXrQ=
@@ -524,8 +524,6 @@ github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u
524524
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
525525
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
526526
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
527-
github.com/karrick/godirwalk v1.16.1 h1:DynhcF+bztK8gooS0+NDJFrdNZjJ3gzVzC545UNA9iw=
528-
github.com/karrick/godirwalk v1.16.1/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk=
529527
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
530528
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
531529
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
@@ -774,6 +772,8 @@ github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0=
774772
github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw=
775773
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
776774
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
775+
github.com/twpayne/go-vfs/v5 v5.0.4 h1:/ne3h+rW7f5YOyOFguz+3ztfUwzOLR0Vts3y0mMAitg=
776+
github.com/twpayne/go-vfs/v5 v5.0.4/go.mod h1:zTPFJUbgsEMFNSWnWQlLq9wh4AN83edZzx3VXbxrS1w=
777777
github.com/u-root/uio v0.0.0-20240209044354-b3d14b93376a h1:BH1SOPEvehD2kVrndDnGJiUF0TrBpNs+iyYocu6h0og=
778778
github.com/u-root/uio v0.0.0-20240209044354-b3d14b93376a/go.mod h1:P3a5rG4X7tI17Nn3aOIAYr5HbIMukwXG0urG0WuL8OA=
779779
github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo=

internal/provider/cached_image_resource_test.go

+34
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,40 @@ RUN date > /date.txt`,
124124
)
125125
},
126126
},
127+
{
128+
// This tests that a multi-stage build works correctly.
129+
name: "multistage_run_copy",
130+
files: map[string]string{
131+
"Dockerfile": `
132+
FROM localhost:5000/test-ubuntu:latest AS a
133+
RUN date > /date.txt
134+
FROM localhost:5000/test-ubuntu:latest
135+
COPY --from=a /date.txt /date.txt`,
136+
},
137+
extraEnv: map[string]string{
138+
"CODER_AGENT_TOKEN": "some-token",
139+
"CODER_AGENT_URL": "https://coder.example.com",
140+
"FOO": testEnvValue,
141+
"ENVBUILDER_GIT_URL": "https://not.the.real.git/url",
142+
"ENVBUILDER_CACHE_REPO": "not-the-real-cache-repo",
143+
"ENVBUILDER_DOCKERFILE_PATH": "Dockerfile",
144+
},
145+
assertEnv: func(t *testing.T, deps testDependencies) resource.TestCheckFunc {
146+
return resource.ComposeAggregateTestCheckFunc(
147+
assertEnv(t,
148+
"CODER_AGENT_TOKEN", "some-token",
149+
"CODER_AGENT_URL", "https://coder.example.com",
150+
"ENVBUILDER_CACHE_REPO", deps.CacheRepo,
151+
"ENVBUILDER_DOCKERFILE_PATH", "Dockerfile",
152+
"ENVBUILDER_GIT_SSH_PRIVATE_KEY_PATH", deps.Repo.Key,
153+
"ENVBUILDER_GIT_URL", deps.Repo.URL,
154+
"ENVBUILDER_REMOTE_REPO_BUILD_MODE", "true",
155+
"ENVBUILDER_VERBOSE", "true",
156+
"FOO", "bar\nbaz",
157+
),
158+
)
159+
},
160+
},
127161
} {
128162
t.Run(tc.name, func(t *testing.T) {
129163
//nolint: paralleltest

0 commit comments

Comments
 (0)