kustomize icon indicating copy to clipboard operation
kustomize copied to clipboard

Local reference to temporary directory fails build on Mac

Open Stef16Robbe opened this issue 1 year ago • 2 comments

What happened?

I added this local reference in my Kustomize file (MacOS):

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../../../../var/folders/2b/ryb_dw7j1gg183b46_ppt5sr0000gn/T/folder

It is a relative path towards /var/folders/2b/ryb_dw7j1gg183b46_ppt5sr0000gn/T/folder, which exists, and contains a Kustomize file that builds successfully on it's own (using kustomize build "../../../../../var/folders/2b/ryb_dw7j1gg183b46_ppt5sr0000gn/T/folder" works fine)

But when I try to refer to it in a Kustomize file (shown above), I get an error:

Error: accumulating resources: accumulation err='accumulating resources from '../../../../../var/folders/2b/ryb_dw7j1gg183b46_ppt5sr0000gn/T/folder': evalsymlink failure on '/Users/var/folders/2b/ryb_dw7j1gg183b46_ppt5sr0000gn/T/folder' : lstat /Users/var: no such file or directory': must build at directory: not a valid directory: evalsymlink failure on '/Users/var/folders/2b/ryb_dw7j1gg183b46_ppt5sr0000gn/T/folder' : lstat /Users/var: no such file or directory

The problem is that, for some reason, now all the sudden, Kustomize is looking in /Users? /Users/var/folders/2b/ryb_dw7j1gg183b46_ppt5sr0000gn/T/folder does indeed not exist, but it's not the path I've given to Kustomize.

It probably has something to do with symlinking on Mac, but I'm confused as to why it does work when building the file directly, but not when it's referred to in another Kustomize file.

What did you expect to happen?

A successful build

How can we reproduce it (as minimally and precisely as possible)?

  1. Create a temp dir on MacOS, I did it in Go with os.TempDir()
  2. Add a Kustomize file in it
  3. Refer to it from somewhere else on the filesystem

Expected output

N/A

Actual output

An error

Kustomize version

v5.4.3

Operating system

MacOS

Stef16Robbe avatar Aug 20 '24 13:08 Stef16Robbe

This happens on linux as well.

We ran into the same issue. If you have nested kustomizations, it will break.

Previous structure that worked prior to this version.

kubernetes/qualityenv/kustomization.yaml kubernetes/qualityenv/build-test/kustomization.yaml

Running "kustomize localize qualityenv/build-test localized/qualityenv-build-test --scope ." breaks.

If you flatten the folder structure it will work.

basically we had to work around by changing our structure to

kubernetes/qualityenv/kustomization.yaml kubernetes/qualityenv-build-test/kustomization.yaml

and run kustomize localize qualityenv-build-test localized/qualityenv-build-test --scope .

leonardj78 avatar Aug 30 '24 18:08 leonardj78

Hi there, @Stef16Robbe! Thanks for reporting this issue.

I was unable to reproduce it on MacOS, even with a latest head build. Would you be able to provide a minimal example that replicates the problem described?

/triage needs-information

stormqueen1990 avatar Sep 03 '24 20:09 stormqueen1990

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Dec 02 '24 21:12 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Jan 01 '25 21:01 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-triage-robot avatar Jan 31 '25 21:01 k8s-triage-robot

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

k8s-ci-robot avatar Jan 31 '25 21:01 k8s-ci-robot