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

fix: issue where kustomization files are empty #3094

Merged
merged 2 commits into from
Oct 30, 2024

Conversation

a1994sc
Copy link
Contributor

@a1994sc a1994sc commented Oct 12, 2024

Description

This PR addresses a where zarf is unable to properly discover the images from a kustomization file.

The culprit from my testing seems to be cause by f and newDestination being the same values when calling helpers.CreatePathAndCopy here

	...
	if err := helpers.CreatePathAndCopy(f, newDestination); err != nil {
	...

That function, found here, basically copies a file from one path to another, however there is no check if the source and destination are same values. This causes the resulting file to be empty.

The change in my PR uses the temp folder already created by zarf to make sure that source and destination files are different, preventing an empty file from being scanned.

Related Issue

Fixes #3065

Checklist before merging

@a1994sc a1994sc requested review from a team as code owners October 12, 2024 01:08
Copy link

netlify bot commented Oct 12, 2024

Deploy Preview for zarf-docs canceled.

Name Link
🔨 Latest commit edd902c
🔍 Latest deploy log https://app.netlify.com/sites/zarf-docs/deploys/672253074dbf710008b2fe29

src/pkg/packager/prepare.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented Oct 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
src/pkg/packager/prepare.go 52.63% <100.00%> (+1.60%) ⬆️

@phillebaba
Copy link
Member

@a1994sc how much effort do you think it would be to add a test for this fix?

@a1994sc
Copy link
Contributor Author

a1994sc commented Oct 16, 2024

I would have look into how the existing testing is done, so I'm unsure

Signed-off-by: Allen Conlon <software@conlon.dev>

- Includes unit test for kustomization
@a1994sc
Copy link
Contributor Author

a1994sc commented Oct 21, 2024

@phillebaba I updated the PR with a basic unit test.

@AustinAbro321 AustinAbro321 added this pull request to the merge queue Oct 30, 2024
Merged via the queue into zarf-dev:main with commit 1234b72 Oct 30, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The kustomizations does not seem to render out correctly for discoverying images
3 participants