allenporter/flux-local

Error building Fluxtomization when `metadata.namespace` is not present

budimanjojo opened this issue · 2 comments

I got this error when running through github action:

flux-local error:  Error building Fluxtomization in '/home/runner/work/home-cluster/home-cluster/pr' path 'cluster': Invalid <class 'flux_local.manifest.Kustomization'> missing metadata.namespace: {'apiVersion': 'kustomize.toolkit.fluxcd.io/v1', 'kind': 'Kustomization', 'metadata': {'name': 'flux-manifests', 'annotations': {'config.kubernetes.io/index': '165', 'config.kubernetes.io/path': 'base/flux-system/flux-manifests.yaml', 'internal.config.kubernetes.io/index': '165', 'internal.config.kubernetes.io/path': 'base/flux-system/flux-manifests.yaml'}}, 'spec': {'path': './', 'sourceRef': {'kind': 'OCIRepository', 'name': 'flux-manifests'}, 'interval': '30m', 'prune': True, 'wait': True, 'patches': [{'patch': '- op: add\n  path: /spec/template/spec/containers/0/args/-\n  value: --concurrent=8\n- op: add\n  path: /spec/template/spec/containers/0/args/-\n  value: --kube-api-qps=500\n- op: add\n  path: /spec/template/spec/containers/0/args/-\n  value: --kube-api-burst=1000\n- op: add\n  path: /spec/template/spec/containers/0/args/-\n  value: --requeue-dependency=5s\n', 'target': {'kind': 'Deployment', 'name': '(kustomize-controller|helm-controller|source-controller)'}}, {'patch': 'apiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: all\nspec:\n  template:\n    spec:\n      containers:\n        - name: manager\n          resources:\n            limits:\n              cpu: 2000m\n              memory: 2Gi\n', 'target': {'kind': 'Deployment', 'name': '(kustomize-controller|helm-controller|source-controller)'}}]}}Try specifying another path within the git repo?

The error is gone when I add metadata.namespace to my Fluxtomization. This is expected in a logic viewpoint but flux in the cluster is not complaining so I think maybe this is something to be considered? Thank you for the great tool!

@budimanjojo Thanks for the report, happy to fix this -- sorry fell off my radar. What namespace do you expect these to end up in? flux-system or default?

@allenporter I don't even remember what was this issue about 😅, probably I managed to get around it or u fixed it. I'm gonna close this for now.