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

whiteouts present when extracting images with multiple layers #599

Closed
mudler opened this issue Sep 4, 2021 · 1 comment
Closed

whiteouts present when extracting images with multiple layers #599

mudler opened this issue Sep 4, 2021 · 1 comment
Labels
kind/bug Something isn't working

Comments

@mudler
Copy link
Contributor

mudler commented Sep 4, 2021

cos-toolkit version:
0.6.7

Describe the bug
Seems whiteouts are present when using derivative images with multiple layers

To Reproduce
cos-upgrade to an image with layers that are adding/removing the same file

Expected behavior
No whiteouts present

Additional context
Possible regression caused by #509 . A possible workaround would be to set export LUET_PRIVILEGED_EXTRACT=true in the cos config file

@mudler mudler added the kind/bug Something isn't working label Sep 4, 2021
@mudler mudler assigned mudler and unassigned mudler Sep 4, 2021
@mudler
Copy link
Contributor Author

mudler commented Sep 6, 2021

@ibuildthecloud which version of cos-installer are you running? It might be just a old one.

I've tried to repro, but it seems it was a problem only when LUET_PRIVILEGED_EXTRACT=true is set, note that was changed since #509.

My test:

FROM alpine

RUN touch foo
RUN rm -rf foo

Pushed as image: quay.io/costoolkit/test-images:wh

❯ sudo luet util unpack quay.io/costoolkit/test-images:wh unpack                                                                                                            
 Luet version 0.17.8-g3402641241fd6459a4c95f6055b98a728c4e2c67 2021-08-11 0135 UTC                                                                                          
                                                                                                                                                                            
        Luet Copyright (C) 2019-2021 Ettore Di Giacinto                                                                                                                     
        This program comes with ABSOLUTELY NO WARRANTY.                                                                                                                     
        This is free software, and you are welcome to redistribute it                                                                                                       
        under certain conditions.                                                                                                                                           
                                                                                                                                                                            
 Downloading quay.io/costoolkit/test-images:wh to /home/ettore/tests/unpack                                                                                                 
 Pulled: sha256:eb357244172dcdc5fb8019b8e9462a4f1db9b0d6e833fd6b2acf82528d0892b1 quay.io/costoolkit/test-images:wh                                                          
 Size: 5.332MiB                                                                                                                                                             
                                                                                                                                                                            
~/tests 11s                                                                                                                                                                 
❯ ls -liah unpack                                                                                                                                                           
total 76K                                                                                                                                                                   
 74847242 drwxr-xr-x 19 ettore users 4.0K Sep  6 10:52 .                                                                                                                    
 73142049 drwxr-xr-x  5 ettore users 4.0K Sep  6 10:32 ..                                                                                                                   
 76286679 drwxr-xr-x  2 root   root  4.0K Aug 27 13:05 bin                                                                                                                  
 76286761 drwxr-xr-x  2 root   root  4.0K Aug 27 13:05 dev                                                                                                                  
 76943366 drwxr-xr-x 15 root   root  4.0K Aug 27 13:05 etc                                                                                                                  
 82972309 drwxr-xr-x  2 root   root  4.0K Aug 27 13:05 home                                                                                                                 
 82972311 drwxr-xr-x  7 root   root  4.0K Aug 27 13:05 lib                                                                                                                  
 83628220 drwxr-xr-x  5 root   root  4.0K Aug 27 13:05 media                                                                                                                
 83889528 drwxr-xr-x  2 root   root  4.0K Aug 27 13:05 mnt                                                                                                                  
 84018601 drwxr-xr-x  2 root   root  4.0K Aug 27 13:05 opt                                                                                                                  
 84018606 dr-xr-xr-x  2 root   root  4.0K Aug 27 13:05 proc                                                                                                                 
 84150237 drwx------  2 root   root  4.0K Aug 27 13:05 root                                                                                                                 
 84412245 drwxr-xr-x  2 root   root  4.0K Aug 27 13:05 run                                                                                                                  
 84412247 drwxr-xr-x  2 root   root  4.0K Aug 27 13:05 sbin                                                                                                                 
 98308105 drwxr-xr-x  2 root   root  4.0K Aug 27 13:05 srv                                                                                                                  
 98702122 drwxr-xr-x  2 root   root  4.0K Aug 27 13:05 sys                                                                                                                  
 98960978 drwxrwxrwt  2 root   root  4.0K Aug 27 13:05 tmp                                                                                                                  
 98960981 drwxr-xr-x  7 root   root  4.0K Aug 27 13:05 usr                                                                                                                  
101191385 drwxr-xr-x 12 root   root  4.0K Aug 27 13:05 var                                                                                                                  

While the bug is present when using the old extraction way, which is based on the containerd snapshotter, but we have it disabled by default already in #509:

❯ sudo -E LUET_PRIVILEGED_EXTRACT=true luet util unpack quay.io/costoolkit/test-images:wh unpack
 Luet version 0.17.8-g3402641241fd6459a4c95f6055b98a728c4e2c67 2021-08-11 0135 UTC
 
        Luet Copyright (C) 2019-2021 Ettore Di Giacinto
        This program comes with ABSOLUTELY NO WARRANTY.
        This is free software, and you are welcome to redistribute it
        under certain conditions.

 Downloading quay.io/costoolkit/test-images:wh to /home/ettore/tests/unpack
 Pulled: sha256:818113230e3d0af5402d93db197743fbda2cae84eaf49eccf5864e67f52cf50c quay.io/costoolkit/test-images:wh
 Size: 2.686MiB

~/tests
❯ ls -liah unpack
total 76K
 74847242 drwxr-xr-x 19 root   root  4.0K Sep  6 10:53 .
 73142049 drwxr-xr-x  5 ettore users 4.0K Sep  6 10:53 ..
 76286679 drwxr-xr-x  2 root   root  4.0K Aug 27 13:05 bin
 76286761 drwxr-xr-x  2 root   root  4.0K Aug 27 13:05 dev
 76943366 drwxr-xr-x 15 root   root  4.0K Aug 27 13:05 etc
 74847248 -rw-r--r--  1 root   root     0 Sep  6 10:33 foo
 82972309 drwxr-xr-x  2 root   root  4.0K Aug 27 13:05 home
 82972311 drwxr-xr-x  7 root   root  4.0K Aug 27 13:05 lib
 83628220 drwxr-xr-x  5 root   root  4.0K Aug 27 13:05 media
 83889528 drwxr-xr-x  2 root   root  4.0K Aug 27 13:05 mnt
 84018601 drwxr-xr-x  2 root   root  4.0K Aug 27 13:05 opt
 84018606 dr-xr-xr-x  2 root   root  4.0K Aug 27 13:05 proc
 84150237 drwx------  2 root   root  4.0K Aug 27 13:05 root
 84412245 drwxr-xr-x  2 root   root  4.0K Aug 27 13:05 run
 84412247 drwxr-xr-x  2 root   root  4.0K Aug 27 13:05 sbin
 98308105 drwxr-xr-x  2 root   root  4.0K Aug 27 13:05 srv
 98702122 drwxr-xr-x  2 root   root  4.0K Aug 27 13:05 sys
 98960978 drwxrwxrwt  2 root   root  4.0K Aug 27 13:05 tmp
 98960981 drwxr-xr-x  7 root   root  4.0K Aug 27 13:05 usr
101191385 drwxr-xr-x 12 root   root  4.0K Aug 27 13:05 var
 74847321 -rw-------  1 root   root     0 Sep  6 10:33 .wh.foo

@mudler mudler closed this as completed Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant