0

I have a kustomize overlay that refers to its base in its kustomization file overlays/test/kustomization.yaml as follows:

resources:
  - ../../base

The relevant directory structure is as follows:

<some_path>/base/kustomization.yaml
<some_path>/overlays/test/kustomization.yaml

When I try kubectl kustomize overlays/test the following error occurs:

err="accumulating resources: accumulation err='accumulating resources from '../../base': '<some_path>/base' must resolve to a file': recursed accumulation of path '/base'

The documentation for resources says:

Each entry in this list must be a path to a file, or a path (or URL) referring to another kustomization directory,

If I am not mistaken, /<some_path>/base should be a valid kustomization directory, because /<some_path>/base/kustomization.yaml exists. So why must the path resolve to a file (not: directory) according to the error message? What am I missing?

rookie099
  • 2,201
  • 2
  • 26
  • 52
  • That all looks fine. Can you update your question to include (a) the output of `tree` when run in the `` directory (or `find . -type f -print` if you don't have `tree`), (b) the contents of `base/kustomization.yaml`, and (c) the version of kustomize you're using? – larsks Oct 10 '22 at 13:31
  • @larks Thanks for your suggestions. I've meanwhile been able to resolve this. I was about to delete my question, but because of your interaction I'm now going to answer it myself. Maybe it's worth recording it in this way. – rookie099 Oct 10 '22 at 13:58

1 Answers1

0

I was meanwhile able to resolve this. There was a stupid mistake in <some_path>/base/kustomization.yaml, so kubectl kustomize overlays/test failing was apparently an indirect effect of kubectl kustomize base failing as well.

rookie099
  • 2,201
  • 2
  • 26
  • 52