Merge pull request #47 from fluxcd/revision-fix
git: fix revision for git tags
This commit is contained in:
commit
6ffb946c54
|
@ -20,7 +20,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o source-c
|
||||||
|
|
||||||
FROM alpine:3.11
|
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/
|
COPY --from=builder /workspace/source-controller /usr/local/bin/
|
||||||
|
|
||||||
|
|
|
@ -321,6 +321,9 @@ func (r *GitRepositoryReconciler) sync(ctx context.Context, repository sourcev1.
|
||||||
|
|
||||||
if revision == "" {
|
if revision == "" {
|
||||||
revision = fmt.Sprintf("%s/%s", branch, ref.Hash().String())
|
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(),
|
artifact := r.Storage.ArtifactFor(repository.Kind, repository.ObjectMeta.GetObjectMeta(),
|
||||||
|
|
Loading…
Reference in New Issue