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

Multi-layer overlays fail to render #596

Closed
mgoodness opened this issue Dec 4, 2018 · 4 comments
Closed

Multi-layer overlays fail to render #596

mgoodness opened this issue Dec 4, 2018 · 4 comments
Assignees

Comments

@mgoodness
Copy link
Contributor

I have a project that uses 4 layers, each of which uses the previous layer as its base.

overlays/sandbox3.us-east-1

bases:
- ../aws-nonprod

overlays/aws-nonprod

bases:
- ../aws

overlays/aws

bases:
- ../../base

When I run kustomize build overlays/sandbox3.us-east-1 with v1.0.11 I get

Error: loadResMapFromBasesAndResources: SemiResources: loadResMapFromBasesAndResources: couldn't make ldr for ../aws: cycle detected: new root '/Users/mgoodness/dev/cluster-configuration/networkpolicy/overlays/aws' contains previous root '/Users/mgoodness/dev/cluster-configuration/networkpolicy/overlays/aws-nonprod'

This configuration worked with kustomize v1.0.10. I am able to render if I skip an intermediate layer. Other projects that use only 3 layers also render correctly.

@laverya
Copy link
Contributor

laverya commented Dec 5, 2018

My team has run into the same with our Skaffold setup.

@monopole monopole self-assigned this Dec 5, 2018
@monopole
Copy link
Contributor

monopole commented Dec 5, 2018

lemme look

@bstevenson
Copy link

bstevenson commented Dec 7, 2018

Seeing same issue or very similar issue. Worked in 1.0.10 (only changed the disableHash ---> disableNameSuffixHash between 1.0.10 --> 1.0.11)

Structure:

app/
├── app.yaml
├── config-map.yaml
├── kustomization.yaml
├── overlays
│   └── na3
│       └── dev
│           └── kustomization.yaml
└── secrets.yaml

Base kustomization file:

cat app/kustomization.yaml
namespace: "test"
resources:
- config-map.yaml
- app.yaml
- secrets.yaml
generatorOptions:
  timeoutSeconds: 20
  disableNameSuffixHash: true

Overlay kustomization file:

cat app/overlays/na3/dev/kustomization.yaml
bases:
- ../../../../app
imageTags:
- name: <private_repo>/app
  newTag: 6.5.0
Error: loadResMapFromBasesAndResources: couldn't make ldr for ../../../../app: cycle detected: new root '/Users/xxxxxxx/repos/xxxxxx/kubernetes/base/app' contains previous root '/Users/xxxxxxxx/repos/xxxxxxxxxx/kubernetes/base/app/overlays/na3/dev'

@monopole
Copy link
Contributor

@mgoodness feel free to review #624

@bstevenson As things now stand, the layout you describe is disallowed. We found that allowing an overlay to be a subdirectory of a base makes it too easy to create recursion problems.

The fix is to change from

app
├── kustomization.yaml
└── overlays
    └── na3
        └── dev
            └── kustomization.yaml

to

app
├── base
│   └── kustomization.yaml
└── overlays
    └── na3
        └── dev
            └── kustomization.yaml  #  contains "bases: ../../../base"

FWIW, the top level app dir is a good place for a README.md.

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

4 participants