Skip to content
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

Problem with external gitRepository #753

Open
yotles opened this issue Jul 21, 2024 · 1 comment
Open

Problem with external gitRepository #753

yotles opened this issue Jul 21, 2024 · 1 comment

Comments

@yotles
Copy link

yotles commented Jul 21, 2024

@allenporter First of all thank you for such amazing tool! At first glance it could to resolve a lot of my issues during work with flux and gitops scheme.

But I cannot find the way to work properly. I have more or less standart platform admin repo with name conf:

tree conf
├── apps
│   ├── dev
│   └── prod
├── archived
│   ├── dev
│   └── prod
├── clusters
│   ├── dev
│   └── prod
└── infrastructure
    ├── archived
    ├── dev
    └── prod

And kustomizations within flux-system accessible ok with --sources:

flux-local  get ks --path ./clusters/dev --source flux-system
NAME              PATH
apps              apps/dev
flux-system       clusters/dev
infrastructure    infrastructure/dev

But I cannot figure out how to get work it with app which configured with external git repository. My manifests:

cat ./infrastructure/dev/app1/gitrepository/kustomize.yaml
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
  name: app1
  namespace: app1
spec:
  interval: 1m0s
  path: ./base
  prune: true
  sourceRef:
    kind: GitRepository
    name: app1
    namespace: app1
  serviceAccountName: app1

cat ./infrastructure/dev/app1/gitrepository/git.yaml
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
  name: app1
  namespace: app1
spec:
  interval: 1m0s
  ref:
    branch: dev
  secretRef:
    name: flux-deploy-app1
  url: https://gitlab.xxx.xxx/okd/apps/infrastructure/app1.git

Such repository saved with path:

apps/infrastructure/app1/

base
├── imagestream
├── secrets
├── values
└── vault

And what I get:

 flux-local get ks --path ./infrastructure/dev/app1 --source app1
flux-local error:  Kustomization 'app1/app1-kustomization' path field 'base' is not a directory: /conf/base

but in my case /conf/base is not correct path, in some way it should look into apps/infrastructure/app1/base. Could you please clarify is it possible to work with flux-local in such manner?

Thanks!

@allenporter
Copy link
Owner

Yes, this is not currently supported, as the tool will not go out and clone external repos. You may be able to get something working by cloning the external repos yourself and using the --sources flag (details) to map the name of a git repo source to a local path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants