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

kustomize build fails when resources key is missing #5337

Closed
ckeeney opened this issue Sep 21, 2023 · 5 comments
Closed

kustomize build fails when resources key is missing #5337

ckeeney opened this issue Sep 21, 2023 · 5 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@ckeeney
Copy link

ckeeney commented Sep 21, 2023

What happened?

On v5.0, kustomize build would build the empty kustomization below .

# kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

On 5.1.1, kustomize build would fail with confusing error message:

Error: accumulating resources: 
accumulation err='accumulating resources from '../../base': '....../packages/namespaces/base' must resolve to a file': 
couldn't make target for path '...../packages/namespaces/base': kustomization.yaml is empty

What did you expect to happen?

I expected 5.1.1 to build the kustomization without errors.

A simple workaround is to define a resources key with an empty array as the value.

# kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources: []

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

Run kustomize build on v5.1.1 on the manifest

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

Expected output

No response

Actual output

No response

Kustomize version

5.1.1

Operating system

Linux

@ckeeney ckeeney added the kind/bug Categorizes issue or PR as related to a bug. label Sep 21, 2023
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Sep 21, 2023
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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/test-infra repository.

@ckeeney
Copy link
Author

ckeeney commented Sep 21, 2023

I spent some time debugging failing builds and the error message for this is sort of misleading.

If this regression is intended, feel free to close this issue without fixing, and at least this comment can serve as some documentation that might save someone else some time.

@sarab97
Copy link
Member

sarab97 commented Oct 30, 2023

This is the intended change introduced in v5.1 by PR #4949. This avoids silently ignoring empty files.
/close

@k8s-ci-robot
Copy link
Contributor

@sarab97: Closing this issue.

In response to this:

This is the intended change introduced in v5.1 by PR #4949. This avoids silently ignoring empty files.
/close

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/test-infra repository.

@cep21
Copy link

cep21 commented Jan 5, 2024

@sarab97 Can I get more clarification on why this does not qualify as a breaking change and a major version increase?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

4 participants