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 unpack tar.gz archive with ADD instruction, issue #2409 #2991

Merged
merged 3 commits into from
Feb 29, 2024

Conversation

Greendor1234
Copy link
Contributor

@Greendor1234 Greendor1234 commented Feb 8, 2024

Fixes #2409

Description

This is a fix for the ADD instruction, as metioned in issue #2409 when used with multiple sources, specifically with tar.gz archive the build process didn't unpack the archive. I haven't written the unit test yet, but I checked the result by comparing two images (one builded with docker and the other one with kaniko) based on the Dockerfile described in the issue.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes unit tests
  • Adds integration tests if needed.

Reviewer Notes

  • The code flow looks good.
  • Unit tests and or integration tests added.

@aaron-prindle
Copy link
Collaborator

Thanks for the PR here @Greendor1234. Currently our CI/CD is erroring on this PR related to some lint errors:

Error: pkg/commands/add_test.go:39:33: `createFile` - `t` is unused (unparam)
func createFile(tempDir string, t *testing.T) error {
                                ^
Error: pkg/commands/add_test.go:54:50: `createTar` - `t` is unused (unparam)
func createTar(tempDir string, toCreate TarList, t *testing.T) error {
                                                 ^
Error: pkg/commands/add_test.go:75:2: ineffectual assignment to err (ineffassign)
	err = util.CreateTarballOfDirectory(filepath.Join(tempDir, toCreate.directory), tarFile)
	^
make: *** [Makefile:67: test] Error 1
FAILED /home/runner/work/kaniko/kaniko/scripts/../hack/linter.sh
Error: Process completed with exit code 2.

These need to be resolved to get the tests here all green, thanks

Copy link
Collaborator

@aaron-prindle aaron-prindle left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the PR here @Greendor1234!

@aaron-prindle aaron-prindle merged commit d5c36a6 into GoogleContainerTools:main Feb 29, 2024
10 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.

ADD operation does not support multiple file copies (with tar extractions). Differs from docker builds.
2 participants