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

cloneRefName() does not support annotated git tags #546

Closed
bburky opened this issue May 4, 2023 · 0 comments · Fixed by #568
Closed

cloneRefName() does not support annotated git tags #546

bburky opened this issue May 4, 2023 · 0 comments · Fixed by #568

Comments

@bburky
Copy link

bburky commented May 4, 2023

cloneRefName() does not support annotated git tags and attempts to clone the annotated tag object's id as if it were a commit object. This causes the following error (with the tag's hash, not the commit):

unable to resolve commit object for 'da39a3ee5e6b4b0d3255bfef95601890afd80709': object not found

Currently Flux's cloneRefName() passes the ref to getRemoteHEAD() to resolve the ref to an object id, and then passes the id to cloneCommit() which only supports commit objects, not annotated tags.

A configuration like the following will trigger the error:

apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
  name: repository-name
spec:
  ref:
    name: refs/tags/an-annotated-git-tag

We accidentally stumbled across this when a new developer made the tag and they used an annotated tag not expecting there to be any difference at all for Flux. We had to a little bit of debugging to figure out that an annotated tag caused the issue. I think most users would expect any ref to work with name:.


See #539 for discussion and #539 (comment) for a proposed solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant