Skip to content

Commit

Permalink
Support krmignore in diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
allenporter committed Apr 23, 2024
1 parent 9f64ebd commit 18d7cd6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions .krmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.git
local-charts
tests/testdata/cluster9/local-charts
14 changes: 14 additions & 0 deletions flux_local/tool/diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,22 @@ async def run( # type: ignore[no-untyped-def]
"""Async Action implementation."""
path = kwargs.get("path") or "."

# Parse directories to ignore from `.krmignore`
krmignore = pathlib.Path(path) / ".krmignore"
ignoredirs = []
if krmignore.exists():
with krmignore.open() as fd:
ignoredirs = [
str(pathlib.Path(line.strip())) for line in fd.readlines()
]

errors = []
for root, dirs, files in os.walk(str(path)):
# Ignore any directories that we should not walk
rootpath = str(pathlib.Path(root))
if any([rootpath.startswith(i) for i in ignoredirs]):
continue

for file in files:
if not (file.endswith(".yaml") or file.endswith(".yml")):
continue
Expand Down

0 comments on commit 18d7cd6

Please sign in to comment.