-
Notifications
You must be signed in to change notification settings - Fork 187
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
Source controller fails to correctly fetch the git repositories #350
Comments
You have to set the path to where the CRDs are. |
Should I modify this? ---
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: GitRepository
metadata:
name: kube-prometheus-stack-crds
namespace: flux-system
spec:
interval: 30m
url: https://github.com/prometheus-community/helm-charts.git
ref:
# renovate: registryUrl=https://prometheus-community.github.io/helm-charts
tag: kube-prometheus-stack-15.2.0
ignore: |
# exclude all
/*
# include crds directory
!/charts/kube-prometheus-stack/crds
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
kind: Kustomization
metadata:
name: kube-prometheus-stack-crds
namespace: flux-system
spec:
interval: 30m
prune: false
sourceRef:
kind: GitRepository
name: kube-prometheus-stack-crds |
I am seeing the same issue, even on my root-level I didn't see anything in the 0.13 release notes that indicates I would need to change anything? |
@Diaoul you have to set the path: apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
kind: Kustomization
metadata:
name: kube-prometheus-stack-crds
namespace: flux-system
spec:
interval: 30m
prune: false
sourceRef:
kind: GitRepository
name: kube-prometheus-stack-crds
path: ./charts/kube-prometheus-stack/crds |
Then I imagine the ignore isn't needed anymore in the GitRepository? |
Now I have this:
I don't see how this solves the repository being empty though |
Ignore has been refactored and I think we have a bug where all files are removed. To answer your question, you should use ignore to trim down the artifact, no point in storing files in-cluster that you don't need. |
@Diaoul as a workaround until we fix this, you can now tell helm-controller to do the CRDs upgrade, no need to use a Kustomization anymore, see https://toolkit.fluxcd.io/components/helm/helmreleases/#crds |
Have identified the core of the issue, will work on a patch that should be released later today. |
That works for helm charts that package CRDs, however in kube-prometheus-stack they were removed from the packaged chart... you have to apply them manually. |
Pulling in |
Awesome, thanks for the quick fix! |
Is it possible this bug could have re-surfaced? With just a test k8s cluster (docker desktop), I am trying to install flux2, and point to folder in my repository, Repo structure (from the root):
Creating the source with: $ flux create source git staging --url ssh://[email protected]/lrstanley/flux2-testing.git --branch main --interval 30s $ flux get sources git -A
NAMESPACE NAME READY MESSAGE REVISION SUSPENDED
flux-system staging True Fetched revision: main/76154b7474b7ed488a23fd0ef57899f8ff0dbb1d main/76154b7474b7ed488a23fd0ef57899f8ff0dbb1d False It successfully pulls the right branch and commit. Looking at the files on the pod, under /data/gitrepository/flux-system/staging $ ls -lah
total 16K
drwxr-sr-x 2 controll 1337 4.0K Aug 5 16:32 .
drwxr-sr-x 3 controll 1337 4.0K Aug 5 16:31 ..
-rw-r--r-- 1 controll 1337 32 Aug 5 16:31 76154b7474b7ed488a23fd0ef57899f8ff0dbb1d.tar.gz
lrwxrwxrwx 1 controll 1337 87 Aug 5 16:31 latest.tar.gz -> /data/gitrepository/flux-system/staging/76154b7474b7ed488a23fd0ef57899f8ff0dbb1d.tar.gz Tried similar with source-controller version v0.15.3, and similar issues, 32 byte file, but I am still unable to read the tar files or get anything form them. Trying to extract them, and it returns successfully, without extracting any files. And ofc when I try and setup a kustomization based off the source, it says files don't exist (this is on source-controller v0.12.1): $ flux create kustomization staging --source=GitRepository/staging --path="./tooling-eks/clusters/staging/" --prune=true
✚ generating Kustomization
► applying Kustomization
✔ Kustomization created
◎ waiting for Kustomization reconciliation
✗ kustomization path not found: stat /tmp/staging242136554/tooling-eks/clusters/staging: no such file or directory Maybe I'm missing something simple here. I tried running v0.15.3 of the source-controller as well. Any addl. info I can provide? |
Any chance the https://github.com/fluxcd/flux2-kustomize-helm-example/blob/main/.sourceignore is still the same, and excluding your directory? |
Fuck. I didn't realize this was a thing. I have been troubleshooting this the entire WEEK, I am not sure how I didn't see this... Thanks, looks like it's just me being dumb. 🤦🏻 |
Describe the bug
The bug manifests with errors on reconciliations such as
apply failed: error: no objects passed to apply
or
It is due to the source controller not fetching the repository correctly (32 bytes tarball)
Despite reporting success
To Reproduce
Have a GitRepository
Reconcile it
Check the source controller data
Expected behavior
Repository not empty
Additional context
This bug was introduces with v0.13.0, previous version worked fine.
The text was updated successfully, but these errors were encountered: