Skip to content

Commit f0497d3

Browse files
committed
Fix revision for git tags
1 parent 56b264e commit f0497d3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

controllers/gitrepository_controller.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,9 @@ func (r *GitRepositoryReconciler) sync(ctx context.Context, repository sourcev1.
321321

322322
if revision == "" {
323323
revision = fmt.Sprintf("%s/%s", branch, ref.Hash().String())
324+
if repository.Spec.Reference.Tag != "" {
325+
revision = fmt.Sprintf("%s/%s", repository.Spec.Reference.Tag, ref.Hash().String())
326+
}
324327
}
325328

326329
artifact := r.Storage.ArtifactFor(repository.Kind, repository.ObjectMeta.GetObjectMeta(),

0 commit comments

Comments
 (0)