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.
My team has run into the same with our Skaffold setup.
lemme look
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'
@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
โโโ kustomization.yaml
โโโ overlays
โโโ na3
โโโ dev
โโโ kustomization.yaml
to
โโโ 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.
Most helpful comment
@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
to
FWIW, the top level
appdir is a good place for aREADME.md.