From f0497d3164ee6a769f99d1d3c8b876cbc97144f3 Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Tue, 28 Apr 2020 20:18:33 +0300 Subject: [PATCH 1/2] Fix revision for git tags --- controllers/gitrepository_controller.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/controllers/gitrepository_controller.go b/controllers/gitrepository_controller.go index ca67aa261..3cd49e613 100644 --- a/controllers/gitrepository_controller.go +++ b/controllers/gitrepository_controller.go @@ -321,6 +321,9 @@ func (r *GitRepositoryReconciler) sync(ctx context.Context, repository sourcev1. if revision == "" { revision = fmt.Sprintf("%s/%s", branch, ref.Hash().String()) + if repository.Spec.Reference.Tag != "" { + revision = fmt.Sprintf("%s/%s", repository.Spec.Reference.Tag, ref.Hash().String()) + } } artifact := r.Storage.ArtifactFor(repository.Kind, repository.ObjectMeta.GetObjectMeta(), From 62d3469ce1065eac961e8ceb0bb5afc40961edde Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Tue, 28 Apr 2020 20:18:58 +0300 Subject: [PATCH 2/2] build: install tar package --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4087d6509..23c31c06e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o source-c FROM alpine:3.11 -RUN apk add --no-cache openssh-client ca-certificates tini 'git>=2.12.0' socat curl bash +RUN apk add --no-cache openssh-client ca-certificates tar tini 'git>=2.12.0' socat curl bash COPY --from=builder /workspace/source-controller /usr/local/bin/