diff options
author | 2024-05-13 08:42:32 +0000 | |
---|---|---|
committer | 2024-05-16 20:28:13 +0100 | |
commit | cfc5be08b784e300353fd5f01693adaa89285def (patch) | |
tree | dbf242fba4015e01a779670d42d1f0787ce7fc57 /kubernetes/scripts/create_x509_user_config.py | |
parent | Bump pre-commit from 3.7.0 to 3.7.1 (#286) (diff) |
Bump ruff from 0.4.2 to 0.4.4
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.4.2 to 0.4.4.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.4.2...v0.4.4)
---
updated-dependencies:
- dependency-name: ruff
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <[email protected]>
Diffstat (limited to 'kubernetes/scripts/create_x509_user_config.py')
-rw-r--r-- | kubernetes/scripts/create_x509_user_config.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kubernetes/scripts/create_x509_user_config.py b/kubernetes/scripts/create_x509_user_config.py index 195e149..05a6750 100644 --- a/kubernetes/scripts/create_x509_user_config.py +++ b/kubernetes/scripts/create_x509_user_config.py @@ -67,7 +67,7 @@ def approve_cert_signing_request(csr: str, tmpdir: str) -> None: run_and_return_output(f"kubectl apply -f {csr_path}", tmpdir) run_and_return_output(f"kubectl certificate approve {user}") approved_cert = run_and_return_output(f"kubectl get csr {user} -o jsonpath='{{.status.certificate}}'") - with Path(tmpdir, f"{user}.crt").open("w") as f: + with Path(tmpdir, f"{user}.crt").open("w", encoding="locale") as f: f.write(base64.b64decode(approved_cert).decode("utf-8")) run_and_return_output(f"kubectl delete csr {user}") @@ -86,7 +86,7 @@ def give_user_perms(tmpdir: str) -> None: def build_kubectl_config(tmpdir: str) -> None: """Build up a kubectl config from all the files in the tmpdir.""" cluster_public_key = run_and_return_output(r"kubectl get cm kube-root-ca.crt -o jsonpath={.data.ca\.crt}") - with Path(tmpdir, "ca.crt").open("w") as f: + with Path(tmpdir, "ca.crt").open("w", encoding="locale") as f: f.write(cluster_public_key) cluster_url = run_and_return_output("kubectl config view --minify --output jsonpath={.clusters[*].cluster.server}") |