Skip to content

Commit

Permalink
include encryption_at_rest path
Browse files Browse the repository at this point in the history
  • Loading branch information
addyess committed Mar 12, 2024
1 parent 3a5e868 commit 8df167c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
13 changes: 11 additions & 2 deletions charms/kubernetes_snaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ class ExternalCloud(Protocol):
]


def _snap_common_path(component) -> Path:
return Path("/var/snap/{}/common".format(component))


def encryption_config_path() -> Path:
return _snap_common_path("kube-apiserver") / "encryption/encryption_config.yaml"


def configure_apiserver(
advertise_address,
audit_policy,
Expand Down Expand Up @@ -84,8 +92,9 @@ def configure_apiserver(
api_opts["kubelet-preferred-address-types"] = (
"InternalIP,Hostname,InternalDNS,ExternalDNS,ExternalIP"
)
# TODO: encryption at rest
# api_opts["encryption-provider-config"] = str(encryption_config_path())
enc_provider_config = encryption_config_path()
if enc_provider_config.exists():
api_opts["encryption-provider-config"] = str(enc_provider_config)

api_opts["advertise-address"] = advertise_address

Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ deps =
ruff
commands =
black {[vars]all_path}
ruff --fix {[vars]all_path}
ruff format {[vars]all_path}

[testenv:lint]
description = Check code against coding style standards
Expand All @@ -33,7 +33,7 @@ deps =
codespell
commands =
codespell {toxinidir}
ruff {[vars]all_path}
ruff check {[vars]all_path}
black --check --diff {[vars]all_path}

[testenv:unit]
Expand Down

0 comments on commit 8df167c

Please sign in to comment.