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: handle whiteout for created dirs #11

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

rchincha
Copy link

@rchincha rchincha commented Sep 4, 2024

When a dir is created, overlayfs adds the opaque xattr. Detect this case and add the dir to the generated tar blob.

When a dir is created, overlayfs adds the opaque xattr.
Detect this case and add the dir to the generated tar blob.

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
Copy link

@joylatten joylatten left a comment

Choose a reason for hiding this comment

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

looks good.
Is the else statement needed since there is a "return tg.AddFile(pathInTar, curPath)" outside of the else?

// skip this since previous layers dont have this file/dir
log.Debugf("skipping whiteout since %s not present in any previous layers", pathInTar)
return nil
// overlayfs adds opaque xattr for newly created dirs,

Choose a reason for hiding this comment

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

does this path ever get hit for files and not just directories?

the old comment said "file/dir" but here we sound like we're assuming it's only dirs. Are there cases where we might have been missing adding a file to the tar also?

Copy link
Author

Choose a reason for hiding this comment

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

Have seen this only for dirs.

@rchincha rchincha merged commit e9397ba into project-stacker:stacker Sep 6, 2024
rchincha added a commit to rchincha/stacker that referenced this pull request Sep 6, 2024
For newly created dirs, overlayfs sets opaque attr which generates a
whiteout file in the blob tarball.

project-stacker/umoci#11

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
rchincha added a commit to project-stacker/stacker that referenced this pull request Sep 6, 2024
For newly created dirs, overlayfs sets opaque attr which generates a
whiteout file in the blob tarball.

project-stacker/umoci#11

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
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.

3 participants