diff --git a/task_test.go b/task_test.go index 1d8bd48..4cab4ec 100644 --- a/task_test.go +++ b/task_test.go @@ -11,6 +11,7 @@ import ( "reflect" "testing" + task "github.com/concourse/oci-build-task" "github.com/google/go-containerregistry/pkg/name" "github.com/google/go-containerregistry/pkg/registry" v1 "github.com/google/go-containerregistry/pkg/v1" @@ -19,7 +20,6 @@ import ( "github.com/google/go-containerregistry/pkg/v1/tarball" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - task "github.com/concourse/oci-build-task" ) type TaskSuite struct { @@ -116,7 +116,7 @@ func (s *TaskSuite) TestTarget() { func (s *TaskSuite) TestBuildkitSSH() { s.req.Config.ContextDir = "testdata/buildkit-ssh" - s.req.Config.BuildkitSSH = "my_ssh_key=./id_rsa_test" + s.req.Config.BuildkitSSH = "my_ssh_key=testdata/buildkit-ssh/id_rsa_test" _, err := s.build() s.NoError(err) diff --git a/testdata/buildkit-ssh/Dockerfile b/testdata/buildkit-ssh/Dockerfile index 42f55e3..51f878a 100644 --- a/testdata/buildkit-ssh/Dockerfile +++ b/testdata/buildkit-ssh/Dockerfile @@ -1,5 +1,7 @@ # syntax = docker/dockerfile:1.0-experimental FROM alpine -# shows secret from custom secret location: -RUN --mount=type=secret,id=my_ssh_key cat ./id_rsa_test +RUN apk add --no-cache openssh-client + +# shows private key available in ssh agent +RUN --mount=type=ssh,id=my_ssh_key ssh-add -l | grep "SHA256:DFxHFuit9VQtxkBrZWzJhf5OTL5/RwzCJuZjTAPC1DI"