-
Notifications
You must be signed in to change notification settings - Fork 216
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
Gitrepos based on revision show the wrong commit in Status #2403
Comments
1 task
0xavi0
added a commit
to 0xavi0/fleet
that referenced
this issue
May 6, 2024
Changing the commit retrieved when applying `gitrepo`s with revisions. It will show the commit for that revision/tag instead to the latest commit for the default branch (`master`) Refers to: rancher#2403 Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
0xavi0
added a commit
to 0xavi0/fleet
that referenced
this issue
May 6, 2024
Changing the commit retrieved when applying `gitrepo`s with revisions. It will show the commit for that revision/tag instead to the latest commit for the default branch (`master`) Refers to: rancher#2403 Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
0xavi0
added a commit
to 0xavi0/fleet
that referenced
this issue
May 6, 2024
Changing the commit retrieved when applying `gitrepo`s with revisions. It will show the commit for that revision/tag instead to the latest commit for the default branch (`master`) Refers to: rancher#2403 Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
0xavi0
added a commit
to 0xavi0/fleet
that referenced
this issue
May 6, 2024
Changing the commit retrieved when applying `gitrepo`s with revisions. It will show the commit for that revision/tag instead to the latest commit for the default branch (`master`) Refers to: rancher#2403 Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
manno
pushed a commit
that referenced
this issue
May 22, 2024
* Return commit for revision instead of HEAD Changing the commit retrieved when applying `gitrepo`s with revisions. It will show the commit for that revision/tag instead to the latest commit for the default branch (`master`) Refers to: #2403 * pkg/git code refactor This is a refactoring of the code in `pkg/git` package in order to make it more testable. It basically splits things into smaller entities and follows the interface/struct approach to make visible (and mockable) some previously internal code. --------- Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
QA TemplateSolutionFleet now gets the commit for the tag, not for the Testing
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there an existing issue for this?
Current Behavior
I'm using the following
gitrepo
:The git repository has 3 tags
After applying the
gitrepo
(which references tag v0.0.0) we can see the followingcommit
in thegitrepo
But
b91254d06622d8e0ace1f76c0926b95af2efb63a
is the hash for the repository's HEAD, not the commit for tagv0.0.0
The issue is happening because the
LatestCommit
function in the fetch.go file is using the provided branch to get the last commit ormaster
if none is provided.As this example is using a revision no branch is provided and we obtain the Commit from
master
(head).Expected Behavior
I would expect to see the commit for the tag instead to the one for
HEAD
Steps To Reproduce
Apply the gitrepo referenced and observe the Commit in the
gitrepo
The text was updated successfully, but these errors were encountered: