-
Notifications
You must be signed in to change notification settings - Fork 72
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
Merged but not deleted push branch halts automation #164
Comments
This is not possible with any version of Flux today, since Flux works from git, there is no change to apply, and since the image metadata is the only place where Flux could look to know that something has changed, and Flux no longer does anything with image metadata as it is commonly rate limited and expensive to pull the metadata from each image tag one by one, there would not currently be any way for Flux to know if something has changed in the manner you are describing. If you have imagePullPolicy set to Always, you can trigger this kind of update by recycling the pods with eg. The rest of your report does sound like a bug. Flux should be smart enough to catch up the pending branch with the base branch if it can be fast-forwarded (but apparently it isn't!) |
See #165, which I think is exactly what you want. (EDIT: oh I see you already found it!) |
I've reproduced this by following the image automation guide. That should make it easier to debug! |
OK the short answer is: cloning with depth=1 screws the branching here up. The longer answer: the "push branch" part of the API here is implemented like this:
In usual circumstances, after 2.) there's either a local push branch, or not. But when the clone is shallow, the ref is found in 4.) but it can't be checked out. The contract of fetch (both in git and in the gogit library) is that all objects needed to populate the history of the fetched ref are also fetched, so this feels like a bug in gogit to me. I'll try to log an issue there, for a start. |
This issue looks pretty familiar: go-git/go-git#207 (so I won't file one myself, for now). While that (or the yet to be diagnosed but similar problem here) is not fixed upstream in go-git, the most straight-forward thing to do would be to not use shallow clones. |
By manipulating the tests and changing which of
In other words, if libgit2 is used to clone, it all works no matter what's used for other operations; and if go-git is used to clone, at least some things will fail. So I think my comments above are incorrect, in that go-git does not uniquely have a problem with shallow clones vs fetching and pushing. There is some code that does local operations (changing branches, creating a commit) that always uses go-git -- I have not tried reimplementing that, to see if it makes a difference. I hope not, because that would be pretty disappointing, and using libgit2 for those operations is painful. The simplest solution seems to be just ignoring the |
source-controller/pkg/git does shallow clones when using the go-git implementation, and apparently this causes problems when fetching a branch that has been merged at the origin: #164 So far as I can tell, getting a shallow clone breaks the automation, no matter whether go-git or libgit2 is used for operations after cloning. So: just use libgit2 for cloning, which means non-shallow clones; and, for fetch and push, since there's no functional difference between the implementations for those. Signed-off-by: Michael Bridgen <michael@weave.works>
source-controller/pkg/git does shallow clones when using the go-git implementation, and apparently this causes problems when fetching a branch that has been merged at the origin: #164 So far as I can tell, getting a shallow clone breaks the automation, no matter whether go-git or libgit2 is used for operations after cloning. So: just use libgit2 for cloning, which means non-shallow clones; and, for fetch and push, since there's no functional difference between the implementations for those. Signed-off-by: Michael Bridgen <michael@weave.works>
source-controller/pkg/git does shallow clones when using the go-git implementation, and apparently this causes problems when fetching a branch that has been merged at the origin: #164 So far as I can tell, getting a shallow clone breaks the automation, no matter whether go-git or libgit2 is used for operations after cloning. So: just use libgit2 for cloning, which means non-shallow clones; and, for fetch and push, since there's no functional difference between the implementations for those. Signed-off-by: Michael Bridgen <michael@weave.works>
source-controller/pkg/git does shallow clones when using the go-git implementation, and apparently this causes problems when fetching a branch that has been merged at the origin: #164 So far as I can tell, getting a shallow clone breaks the automation, no matter whether go-git or libgit2 is used for operations after cloning. So: just use libgit2 for cloning, which means non-shallow clones; and, for fetch and push, since there's no functional difference between the implementations for those. Signed-off-by: Michael Bridgen <michael@weave.works>
I've got the basic image update automation configuration set up:
It pushes to GitHub on a branch called "pending". If I merge "pending" but do not delete pending then I end up with this error message in my logs, repeating forever. As long as this error message is happening automation updates stop happening The moment that I delete the "pending" branch from GitHub the error message goes away and automation resumes.
I'd also like to ask if the image automation will automatically detect changes to the image even when the tag doesn't change. For example, if I'm deploying haproxy:2.2.14 the maintainers will periodically rebuild their image when their base image changes (e.g. they rebuild 2.2.14 because of a CVE in a dependent library like SSL) and they'll release a new "version" of 2.2.14 with the same exact tag but with a different hash. Can/does flux2 pick that up and deploy the new image?
The text was updated successfully, but these errors were encountered: