Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include encryption_at_rest path #16

Merged
merged 2 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/naming-lint-unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [pull_request]
jobs:
call-inclusive-naming-check:
name: Inclusive Naming
uses: canonical-web-and-design/Inclusive-naming/.github/workflows/woke.yaml@main
uses: canonical/inclusive-naming/.github/workflows/woke.yaml@main
with:
fail-on-error: "true"

Expand Down
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