coreos / coreos-assembler

Tooling container to assemble CoreOS-like systems
https://coreos.github.io/coreos-assembler/
Apache License 2.0
337 stars 166 forks source link

Docs: Using the provided alias with `COREOS_ASSEMBLER_CONFIG_GIT` leave FS with dangling files #3817

Open jbtrystram opened 4 months ago

jbtrystram commented 4 months ago

If you set COREOS_ASSEMBLER_CONFIG_GIT=/some/path/ the current alias will mount /some/path into /srv/src/config into the container.

This allow having a clone of fedora-coreos-config wherever you want. It works well, but leaves some stuff on your FS. Indeed, the alias also have -v ${PWD}:/srv set up. Which cause a weird file created in your local FS.

To reproduce:

cd ~
cosa shell #because you just want to check a rpm version or something
exit

# back in the host ~
ls -l 
drwxr-xr-t. 1 nobody nobody      12 May 28 16:06  src
ls -l src/
drwxr-xr-t. 1 nobody nobody 0 May 28 16:06 config

I can only delete those using root. I realize it's a bit of a corner case but I don't really know how it can be fixed :shrug: I'm referencing this alias : https://coreos.github.io/coreos-assembler/building-fcos/#define-a-bash-alias-to-run-cosa

jlebon commented 4 months ago

It's created by the container stack. Yeah, that'd be awkward to try to detect. I guess the alias could check that the directory is either empty (e.g. you're about to cosa init) or has a builds/ dir (proxy for "is a cosa workdir"). Not sure how much that's worth though; the expectation is that you use the cosa alias from a cosa workdir.

travier commented 2 months ago

You can probably remove them without root with (untested):

podman run -rm -ti -v $HOME:/srv fedora rmdir /srv/config /srv/src