Skip to content

Commit

Permalink
[Fixes #481] remove add registry sidecar from docker-build tests
Browse files Browse the repository at this point in the history
The end to end test attaches a sidecar with a image registry for tasks to push into to. However, the function add_sidecar_registry sets the sidecar registry instead of appending it. Removing the function from test to remove this bug. There is a local registry being added to the test that is deployed with deployment and svc. The svc is referenced during the test instead of the sidecar. #481
  • Loading branch information
popcor255 authored and tekton-robot committed Aug 31, 2020
1 parent 42ed094 commit a9600e0
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 11 deletions.
6 changes: 4 additions & 2 deletions task/docker-build/0.1/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ metadata:
spec:
description: >-
This task will build and push an image using docker.
The task will build an out image out of a Dockerfile.
This image will be pushed to an image registry.
The image will be built and pushed using a dind sidecar over TCP+TLS.
params:
- name: image
description: Reference of the image docker will produce.
Expand All @@ -34,6 +32,9 @@ spec:
- name: push_extra_args
description: Extra parameters passed for the push command when pushing images.
default: ""
- name: insecure_registry
description: Allows the user to push to an insecure registry that has been specified
default: ""
workspaces:
- name: source
results:
Expand Down Expand Up @@ -86,6 +87,7 @@ spec:
- --storage-driver=vfs
- --userland-proxy=false
- --debug
- --insecure-registry=$(params.insecure_registry)
securityContext:
privileged: true
env:
Expand Down
4 changes: 0 additions & 4 deletions task/docker-build/0.1/tests/pre-apply-task-hook.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#!/usr/bin/env bash

# Add an internal registry as sidecar to the task so we can upload it directly
# from our tests without having to go to an external registry.
add_sidecar_registry ${TMPF}

# Add git-clone
kubectl -n ${tns} apply -f ./task/git-clone/0.1/git-clone.yaml
37 changes: 36 additions & 1 deletion task/docker-build/0.1/tests/resources.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
Expand All @@ -9,3 +8,39 @@ spec:
resources:
requests:
storage: 500Mi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: registry-docker-build-local
namespace: docker-build-0-1
spec:
selector:
matchLabels:
app: registry-docker-build-local
template:
metadata:
labels:
app: registry-docker-build-local
spec:
containers:
- name: registry-docker-build-local
image: registry:2
resources:
limits:
memory: "128Mi"
cpu: "500m"
ports:
- containerPort: 5000
---
apiVersion: v1
kind: Service
metadata:
name: registry
namespace: docker-build-0-1
spec:
selector:
app: registry-docker-build-local
ports:
- port: 5000
targetPort: 5000
7 changes: 4 additions & 3 deletions task/docker-build/0.1/tests/run.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
Expand Down Expand Up @@ -30,7 +29,9 @@ spec:
workspace: shared-workspace
params:
- name: image
value: localhost:5000/nocode
value: registry.docker-build-0-1.svc.cluster.local:5000/nocode
- name: insecure_registry
value: registry.docker-build-0-1.svc.cluster.local:5000
---
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
Expand All @@ -42,4 +43,4 @@ spec:
workspaces:
- name: shared-workspace
persistentvolumeclaim:
claimName: docker-source-pvc
claimName: docker-source-pvc
2 changes: 1 addition & 1 deletion test/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ TEST_YAML_IGNORES=${TEST_YAML_IGNORES:-""}

# Allow ignoring some yaml tests, space separated, should be the basename of the
# test for example "s2i"
TEST_TASKRUN_IGNORES=${TEST_TASKRUN_IGNORES:-"docker-build"}
TEST_TASKRUN_IGNORES=${TEST_TASKRUN_IGNORES:-""}

set -ex
set -o pipefail
Expand Down

0 comments on commit a9600e0

Please sign in to comment.