Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating some tests to not require the docker socket #716

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions examples/taskruns/private-taskrun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,8 @@ spec:
steps:
- name: pull
# Private image is just Ubuntu
image: gcr.io/cloud-builders/docker
args: ["pull", "gcr.io/build-crd-testing/secret-sauce"]
volumeMounts:
- name: docker-socket
mountPath: /var/run/docker.sock
volumes:
- name: docker-socket
hostPath:
path: /var/run/docker.sock
type: Socket
image: quay.io/rhpipeline/skopeo:alpine
command: ["skopeo"]
args: ["copy", "docker://gcr.io/build-crd-testing/secret-sauce", "dir:///tmp/"]
trigger:
type: manual
13 changes: 3 additions & 10 deletions examples/taskruns/taskrun-docker-basic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,7 @@ spec:
taskSpec:
steps:
- name: test
image: gcr.io/cloud-builders/docker
image: quay.io/rhpipeline/skopeo:alpine
# Test pulling a private builder container.
args: ["pull", "gcr.io/build-crd-testing/secret-sauce"]
volumeMounts:
- name: docker-socket
mountPath: /var/run/docker.sock
volumes:
- name: docker-socket
hostPath:
path: /var/run/docker.sock
type: Socket
command: ["skopeo"]
args: ["copy", "docker://gcr.io/build-crd-testing/secret-sauce", "dir:///tmp/"]
13 changes: 3 additions & 10 deletions test/pipelinerun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,10 @@ func TestPipelineRun(t *testing.T) {

task := tb.Task(getName(taskName, index), namespace, tb.TaskSpec(
// Reference build: https://github.com/knative/build/tree/master/test/docker-basic
tb.Step("config-docker", "gcr.io/cloud-builders/docker",
tb.Command("docker"),
tb.Args("pull", "gcr.io/build-crd-testing/secret-sauce"),
tb.VolumeMount("docker-socket", "/var/run/docker.sock"),
tb.Step("config-docker", "quay.io/rhpipeline/skopeo:alpine",
tb.Command("skopeo"),
tb.Args("copy", "docker://gcr.io/build-crd-testing/secret-sauce", "dir:///tmp/"),
),
tb.TaskVolume("docker-socket", tb.VolumeSource(corev1.VolumeSource{
HostPath: &corev1.HostPathVolumeSource{
Path: "/var/run/docker.sock",
Type: newHostPathType(string(corev1.HostPathSocket)),
},
})),
))
if _, err := c.TaskClient.Create(task); err != nil {
t.Fatalf("Failed to create Task `%s`: %s", getName(taskName, index), err)
Expand Down