#Host.directory() include vs exclude - if they conflict which one wins?

1 messages · Page 1 of 1 (latest)

potent niche
#

Title says it all.

If I call Client.host().directory() (in any sdk), and i supply includes and excludes, and the patterns/globs happen to conflict with each other on includes and excludes, which one will win?

unique swan
#

I don’t know the answer off hand, but in case it helps, it’s passed through to buildkit (llb local() call)

potent niche
honest shell
#

just did a quick test and exclude wins over include.

It kind of makes sense also since the way I reason about it is that include * is always implicit when you use Host.directory.

potent niche
#

thanks marcos, i spent a few minutes poking around the Copy function in buildkit and wasn't able to find that, going from how it goes from Copy to Walk was a little tough to understand

#

your second link makes it a lot clearer though!

honest shell
#

sure! happy to help!

potent niche
#

Slightly tangential to the original topic - I haven't found out whether it's buildkit or dagger that does this, but apparently either one of the two will silently refuse to stage a folder in your container when calling "with_directory" if it has the string "secrets" in the folder name

That was a fun thing to debug 😄

#

I think at the very least it should warn that the folder was skipped if this is controlled by Dagger team (I also think Buildkit should spit out a warning as well if it's a buildkit thing).

honest shell
potent niche
#

I am out tomorrow but I will get a minimal repro going for this when I’m back!

honest shell
#

looking forward to the repo 🙌

ember plaza
#

I also can't repro easily, I've tried with setting the source and dest to include "secrets", and it doesn't seem to appear.

Our of curiosity, you wouldn't have an exclude pattern somewhere that matches the secrets folder?