-
Notifications
You must be signed in to change notification settings - Fork 618
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
ImageUpdateAutomation commits the same changes over and over on .spec.PushBranch
#3384
ImageUpdateAutomation commits the same changes over and over on .spec.PushBranch
#3384
Comments
Duplicate of: fluxcd/image-automation-controller#466 |
Sorry about that, I forgot to look into the controller specific github repo, closing! |
Reopening as this is orthogonal to fluxcd/image-automation-controller#466. This issue ignores changes already made and pushed into a push branch, and do them again, however the commits are not empty. I got this reproduced and am working on a fix. The other issue is not related to push branches, the controller keeps on writing empty commits. |
@klainte can you please try the image below and check whether the error persists? |
At present go-git does not support the MULTI_ACK capability, which means that follow-up fetches on a given remote will fail. To support Image Automation Controller use cases, the SwitchBranch was initially short-circuited to avoid additional fetches. However, this has the side effect of the controller pushing the same change to the target repository multiple times. (fluxcd/flux2#3384) In order to avoid this, a new WithSingleBranch option was created to enable the download of all references at the initial clone. From now on SwitchBranch has the single responsibility of switching branches, and no longer pulling references. The package git/gogit's primary goal is to support Flux use cases, currently there is no need to expand the current API to expose ways for users to refresh repository references outside the initial clone. Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
The new feature gate enables the download of all branch head references when push branches are configured. Fix fluxcd/flux2#3384. Relates to fluxcd/pkg#433. Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
@klainte Thank you for coming back so quickly. Would you mind testing this again with this image instead: It should fix the branch issue you reported. As for your config I believe it is fine, and the controller should be able to support it. The only thing I would suggest is that you probably want to have force push disabled, so one automation does not overwrite the other. To do that, you can try to start the controller with:
For more information, please refer to the v0.27.0 change log. |
At present go-git does not support the MULTI_ACK capability, which means that follow-up fetches on a given remote will fail. To support Image Automation Controller use cases, the SwitchBranch was initially short-circuited to avoid additional fetches. However, this has the side effect of the controller pushing the same change to the target repository multiple times. (fluxcd/flux2#3384) In order to avoid this, a new WithSingleBranch option was created to enable the download of all references at the initial clone. From now on SwitchBranch has the single responsibility of switching branches, and no longer pulling references. The package git/gogit's primary goal is to support Flux use cases, currently there is no need to expand the current API to expose ways for users to refresh repository references outside the initial clone. Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
At present go-git does not support the MULTI_ACK capability, which means that follow-up fetches on a given remote will fail. To support Image Automation Controller use cases, the SwitchBranch was initially short-circuited to avoid additional fetches. However, this has the side effect of the controller pushing the same change to the target repository multiple times. (fluxcd/flux2#3384) In order to avoid this, a new WithSingleBranch option was created to enable the download of all references at the initial clone. From now on SwitchBranch has the single responsibility of switching branches, and no longer pulling references. The package git/gogit's primary goal is to support Flux use cases, currently there is no need to expand the current API to expose ways for users to refresh repository references outside the initial clone. Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
At present go-git does not support the MULTI_ACK capability, which means that follow-up fetches on a given remote will fail. To support Image Automation Controller use cases, the SwitchBranch was initially short-circuited to avoid additional fetches. However, this has the side effect of the controller pushing the same change to the target repository multiple times. (fluxcd/flux2#3384) In order to avoid this, a new WithSingleBranch option was created to enable the download of all references at the initial clone. From now on SwitchBranch has the single responsibility of switching branches, and no longer pulling references. The package git/gogit's primary goal is to support Flux use cases, currently there is no need to expand the current API to expose ways for users to refresh repository references outside the initial clone. Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
@pjbgf Tests are conclusive with I saw the v0.27.0 change but decided to give it a try without the forcePush disabled. Thanks :) |
That's awesome, thank you @klainte for confirming. 🙇 We should release a new official version with the fix soon. |
The new official image automation controller image contains the fix: |
At present go-git does not support the MULTI_ACK capability, which means that follow-up fetches on a given remote will fail. To support Image Automation Controller use cases, the SwitchBranch was initially short-circuited to avoid additional fetches. However, this has the side effect of the controller pushing the same change to the target repository multiple times. (fluxcd/flux2#3384) In order to avoid this, a new WithSingleBranch option was created to enable the download of all references at the initial clone. From now on SwitchBranch has the single responsibility of switching branches, and no longer pulling references. The package git/gogit's primary goal is to support Flux use cases, currently there is no need to expand the current API to expose ways for users to refresh repository references outside the initial clone. Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
Describe the bug
Since v0.37.0, ImageUpdateAutomation with a
.spec.PushBranch
different from itsspec.GitCheckoutRefBranch
continuously commits modifications picked up by ImagePolicy in the.spec.PushBranch
until the modifications are merged on the main branch.We have notifications set up to MS Teams when a commit is performed on the repo.
with v0.36.0, the changes induced by ImagePolicy + ImageUpdateAutomation were only committed once to the target branch.
Now it is committed over and over, every 'interval` delay (5 min in our case).
Screenshot and logs available below.
I saw the change introduced by the v0.37.0 regarding "Automatic force-push of ImageUpdateAutomation". Maybe that's related, but I do not think the observed behaviour is expected.
Steps to reproduce
To reproduce, you need a similar configuration
Expected behavior
Same as v0.36: changes are committed only once.
Screenshots and recordings
Log from the ImageAutomationController
Corresponding notifications
OS / Distro
Ubuntu 18.04.6 LTS
Flux version
v0.37.0
Flux check
Git provider
Gitlab CE self-hosted
Container Registry provider
No response
Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: