Skip to content

bug: repo branch is changed permanently when an addon does git checkout #26

@HarikrishnanBalagopal

Description

@HarikrishnanBalagopal

Bug

When an addon runs on an app, fetches the repo for that app and changes the git branch to a different one, that change is permanent. Future addon runs will use that new branch. Even the Tackle UI shows the new branch instead of the one the user specified.

Steps to reproduce

  1. Create an application in the Tackle 2 Hub with a repo url and a branch main.
  2. Run an addon that fetches the repo and checkouts a different branch or creates a new branch.
  3. Once the addon is finished, go back to the Tackle 2 Hub UI and look at the application. The branch will have changed.

Context

Currently working around this issue in Move2Kube addon by detecting the current branch before checking out a new branch
https://github.com/konveyor/addon-move2kube/blob/main/cmd/utils.go#L114-L126
and then checking out the original branch once the transformation is finished.
https://github.com/konveyor/addon-move2kube/blob/main/cmd/utils.go#L148-L151

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions