bakdata / kpops

Deploy Kafka pipelines to Kubernetes
https://bakdata.github.io/kpops
MIT License
12 stars 1 forks source link

Fix early exit upon Helm exit code 1 #376

Closed sujuka99 closed 10 months ago

sujuka99 commented 10 months ago

fixes #373

Fix

I am getting this error when I try to use dry-run: subprocess.CalledProcessError: Command '['helm', 'get', 'manifest', 'account-producer', '--namespace', 'my-namespace']' returned non-zero exit status 1. why? does he launch it first in dry-run ? when I do that in my commandline I get To learn more, consult https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke Error: release: not found

The problem came from setting subproces.run(..., check = True) without handling the raised exception.

Preventive measures

I took some imports out of TYPE_CHECKING blocks to avoid problems with pydantic as it uses type hints at runtime

Ruff

Updated to the latest (0.1.1) version. Now all fixes deemed unsafe will not be automatically carried out even if it is possible to do so. The user can choose to enable the unsafe autofixes with the --unsafe-fixes flag

Example

While testing I noticed that we could use the namespace env var in some places in the example, so I did it and had to adjust the tests.