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: Restore empty dir build #718

Merged
merged 2 commits into from
Jan 19, 2024
Merged

Conversation

stefanprodan
Copy link
Member

Kustomize v5.3 introduced a breaking change where it would error out with kustomization.yaml is empty if no resources are specified. This PR adds a placeholder to the generated file, to restore the previous behaviour and allow Flux to reconcile an empty dir.

Fix: fluxcd/flux2#4509

@stefanprodan stefanprodan added the area/kustomize Kustomize related issues and pull requests label Jan 18, 2024
Copy link
Member

@souleb souleb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@@ -26,7 +26,7 @@ import (
"strings"
"sync"

securefs "github.com/fluxcd/pkg/kustomize/filesys"
"github.com/hashicorp/go-multierror"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we use go1.20 we could replace this with errors.Join()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@stefanprodan stefanprodan force-pushed the restore-emptydir-build branch from 7efbfc1 to b551398 Compare January 18, 2024 10:30
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
@stefanprodan stefanprodan force-pushed the restore-emptydir-build branch from bd1f45b to e4ca429 Compare January 18, 2024 16:08
@stefanprodan stefanprodan merged commit 87f5fa0 into main Jan 19, 2024
13 checks passed
@stefanprodan stefanprodan deleted the restore-emptydir-build branch January 19, 2024 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kustomize Kustomize related issues and pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrading to 2.2.0, started getting "kustomize build failed: kustomization.yaml is empty"
3 participants