-
Notifications
You must be signed in to change notification settings - Fork 600
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
Changes on GitRepository ignored after changing ref type #4841
Comments
I suspect this is because the tag field is still in etcd and when both branch and tag are specified, the tag gets priority. Can you please post PS You should really update the API version for both GitRepo and Kustomization to v1. The beta versions you’re using have been deprecated long time ago. |
|
@Trik16 run that command for a GitRepo which has the reported issue
|
|
You missed |
I did not, this is what I get |
Ok I suspect this issue is due to having deprecated API versions in Git. To fix the APIs and also to make sure changing from tag to branch is always considered by Flux, you need to use When setting a branch do: apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: <repository-name>
spec:
ref:
name: "refs/heads/main" When setting a tag do: apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: <repository-name>
spec:
ref:
name: "refs/tags/v1.0.0" |
ok, thanks |
Describe the bug
Due to our release pipeline I noticed that I have troubles to update the
gitrepository
if I change theref
type fromtag
tobranch
or vice versa. Even if I reconcile the source the changes is ignored and I had to delete manually the sources and load from scratch with flux-systemkustomize
reconciliation.Steps to reproduce
./kustomize/overlays/stable
) on the chosen namespace and then change fromtag
tobranch
in theref
field:Expected behavior
I want that flux applies automatically the changes from the
ref
field specified even if it changes typeScreenshots and recordings
No response
OS / Distro
Ubuntu 24.04 LTS
Flux version
flux: v2.2.3
Flux check
► checking prerequisites
✗ flux 2.2.3 <2.3.0 (new CLI version is available, please upgrade)
✔ Kubernetes 1.26.7 >=1.26.0-0
► checking version in cluster
✔ distribution: flux-v2.2.3
✔ bootstrapped: true
► checking controllers
✔ helm-controller: deployment ready
► ghcr.io/fluxcd/helm-controller:v0.37.4
✔ image-automation-controller: deployment ready
► ghcr.io/fluxcd/image-automation-controller:v0.37.1
✔ image-reflector-controller: deployment ready
► ghcr.io/fluxcd/image-reflector-controller:v0.31.2
✔ kustomize-controller: deployment ready
► ghcr.io/fluxcd/kustomize-controller:v1.2.2
✔ notification-controller: deployment ready
► ghcr.io/fluxcd/notification-controller:v1.2.4
✔ source-controller: deployment ready
► ghcr.io/fluxcd/source-controller:v1.2.4
► checking crds
✔ alerts.notification.toolkit.fluxcd.io/v1beta3
✔ buckets.source.toolkit.fluxcd.io/v1beta2
✔ gitrepositories.source.toolkit.fluxcd.io/v1
✔ helmcharts.source.toolkit.fluxcd.io/v1beta2
✔ helmreleases.helm.toolkit.fluxcd.io/v2beta2
✔ helmrepositories.source.toolkit.fluxcd.io/v1beta2
✔ imagepolicies.image.toolkit.fluxcd.io/v1beta2
✔ imagerepositories.image.toolkit.fluxcd.io/v1beta2
✔ imageupdateautomations.image.toolkit.fluxcd.io/v1beta1
✔ kustomizations.kustomize.toolkit.fluxcd.io/v1
✔ ocirepositories.source.toolkit.fluxcd.io/v1beta2
✔ providers.notification.toolkit.fluxcd.io/v1beta3
✔ receivers.notification.toolkit.fluxcd.io/v1
✔ all checks passed
Git provider
GitHub
Container Registry provider
No response
Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: