I have the following setup for a context directory within a Chef module:
// +defaultPath="/"
// +ignore=[
// "**",
// "!.chef/knife-local.rb",
// "!.chef/knife.rb",
// "!lib",
// "!plugins",
// "!site-cookbooks"
// ]
source *dagger.Directory,
When I call using the default args, the source is registered as a context directory and the expected files/dirs are filtered out:
$ cd ~/git/chef
$ dagger call -E shell
...
● ✔ chef(
┆ source: context /Users/cbochs/git/chef (
┆ ┆ exclude: ["**", "!.chef/knife-local.rb", "!.chef/knife.rb", "!lib", "!plugins", "!site-cookbooks"]
┆ )
...
dagger ~ $ ls
lib plugins site-cookbooks
However, when I call the same module, overriding the source explicitly, the directory is no longer considered a "context" directory and all all files/dirs are uploaded:
$ dagger call -E shell --source ~/git/chef
...
...
├╴✔ address(value: "/Users/cbochs/git/chef"): Address! = xxh3:382e3f919e7e378a 0.0s
╰╴✔ .directory: Directory! = xxh3:a255ebbf0650aeda 16.3s
╰╴✔ Host.directory(path: "/Users/cbochs/git/chef"): Directory! = xxh3:1525476f2171ef54 16.3s
╰╴✔ filesync 16.3s
├╴✔ .chef 0.0s ◆ Written Bytes: 1.9 kB
├╴✔ .dagger 0.1s ◆ Written Bytes: 349 kB
├╴✔ .git 14.1s ◆ Written Bytes: 1.5 GB
├╴✔ .github 1.9s ◆ Written Bytes: 24 B
...
✔ chef(
│ ┆ source: Address.directory: Directory! = xxh3:682c87b9aed296a5
...
dagger ~ $ ls
Gemfile Rakefile chefignore dagger.json docs plugins site-cookbooks
README.md bin cookstyle data_bags lib script
This is unexpected to me. I had two thoughts when this occurred
- Why is the explicit
--sourcenot marked as a "context" directory? - Why is the
+ignorepragma not respected when passing--source?