Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 25, 2024
1 parent 8114dca commit 31f4d1f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
7 changes: 4 additions & 3 deletions libsentrykube/kubectl/important_diffs.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,10 @@ def process_folder(folder: str) -> Dict[str, List[ApplyResult]]:
for filename in filenames:
full_path = os.path.join(dirpath, filename)

with open(full_path) as input_file, tempfile.NamedTemporaryFile(
mode="w", delete=False
) as output_stream:
with (
open(full_path) as input_file,
tempfile.NamedTemporaryFile(mode="w", delete=False) as output_stream,
):
file_apply_results[filename] = process_file(
full_path, input_file, output_stream
)
Expand Down
9 changes: 6 additions & 3 deletions sentry_kube/cli/apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,12 @@ def _dump_yaml_docs_to_tmpdir(yaml_docs: List[str]) -> Iterator[str]:
# NOTE: our dummy threading implementation might change the order of diff output.
# If you really need sorted diff like native kubectl diff, then you would need
# to set concurrency to 1
with contextlib.ExitStack() as stack, concurrent.futures.ThreadPoolExecutor(
max_workers=KUBECTL_DIFF_CONCURRENCY
) as executor:
with (
contextlib.ExitStack() as stack,
concurrent.futures.ThreadPoolExecutor(
max_workers=KUBECTL_DIFF_CONCURRENCY
) as executor,
):
chunk_size = max(len(yaml_docs) // KUBECTL_DIFF_CONCURRENCY, 1)
kubectl_diff_cmds = [
cmd
Expand Down

0 comments on commit 31f4d1f

Please sign in to comment.