This repository was archived by the owner on Jun 3, 2025. It is now read-only.
Don't write whiteout files to directories that were replaced with files or links#2590
Merged
aaron-prindle merged 1 commit intoJun 22, 2023
Conversation
gabyx
approved these changes
Jun 20, 2023
gabyx
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me.
Some questions, and small typos I guess.
| if err != nil { | ||
| return err | ||
| } | ||
| if skipWhiteout { |
|
|
||
| for _, file := range kanikoFiles { | ||
| if strings.HasPrefix(file, "a/.wh.") { | ||
| t.Errorf("Last layer should not add whiteout files to deleted directory but found %s", file) |
Collaborator
|
Agree w/ @gabyx, LGTM just address the single nit - |
2e765ba to
94fe941
Compare
| var disableGcsAuth bool | ||
| flag.StringVar(&c.gcsBucket, "bucket", "gs://kaniko-test-bucket", "The gcs bucket argument to uploaded the tar-ed contents of the `integration` dir to.") | ||
| flag.StringVar(&c.imageRepo, "repo", "gcr.io/kaniko-test", "The (docker) image repo to build and push images to during the test. `gcloud` must be authenticated with this repo or serviceAccount must be set.") | ||
| flag.StringVar(&c.imageRepo, "repo", "localhost:5000", "The (docker) image repo to build and push images to during the test. `gcloud` must be authenticated with this repo or serviceAccount must be set.") |
Collaborator
There was a problem hiding this comment.
I missed this initially but can you also change this back to its original value
| flag.StringVar(&c.serviceAccount, "serviceAccount", "", "The path to the service account push images to GCR and upload/download files to GCS.") | ||
| flag.StringVar(&gcsEndpoint, "gcs-endpoint", "", "Custom endpoint for GCS. Used for local integration tests") | ||
| flag.BoolVar(&disableGcsAuth, "disable-gcs-auth", false, "Disable GCS Authentication. Used for local integration tests") | ||
| flag.BoolVar(&disableGcsAuth, "disable-gcs-auth", true, "Disable GCS Authentication. Used for local integration tests") |
Collaborator
There was a problem hiding this comment.
I missed this initially but can you also change this back to its original value
…es or links If a non-empty directory gets replaced with something other than a directory (e.g. file or symlink), the files in that directory also get deleted. However, there should not be any whiteout files for them in the layer. If there were, the resulting tar file would not be extractable. Fixes GoogleContainerTools#2308
94fe941 to
e710ac2
Compare
aaron-prindle
approved these changes
Jun 22, 2023
aaron-prindle
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the PR here @andreasf! LGTM
kylecarbs
pushed a commit
to coder/kaniko
that referenced
this pull request
Jul 12, 2023
…es or links (GoogleContainerTools#2590) If a non-empty directory gets replaced with something other than a directory (e.g. file or symlink), the files in that directory also get deleted. However, there should not be any whiteout files for them in the layer. If there were, the resulting tar file would not be extractable. Fixes GoogleContainerTools#2308
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2308
Description
If a non-empty directory gets replaced with something other than a directory (e.g. file or symlink), the files in that directory also get deleted. However, there should not be any whiteout files for them in the layer. If there were, the resulting tar file would not be extractable.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Reviewer Notes