Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion rcds/challenge/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ def get_context_files(root: Path) -> Iterator[Path]:
for line in fd
),
)
files = filter(lambda p: not spec.match_file(p.relative_to(root)), files)
files = filter(
lambda p: not spec.match_file(p.relative_to(root)) and p != dockerignore,
files,
)
return filter(lambda p: p.is_file(), files)


Expand Down
2 changes: 1 addition & 1 deletion tests/challenge/test_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_with_dockerignore(self, datadir: Path) -> None:
df_root = datadir / "contexts" / "dockerignore"
assert df_root.is_dir()
got = {str(p.relative_to(df_root)) for p in docker.get_context_files(df_root)}
assert got == {"Dockerfile", ".dockerignore", ".file", "file"}
assert got == {"Dockerfile", ".file", "file"}

def test_complex_dockerignore(self, datadir: Path) -> None:
df_root = datadir / "contexts" / "complex_dockerignore"
Expand Down