Skip to content

Commit

Permalink
Cherry-pick #16 via PR into release_1.29 (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
addyess authored May 29, 2024
1 parent 6b1476c commit 7a5d5e7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
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
19 changes: 14 additions & 5 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 @@ -81,11 +89,12 @@ def configure_apiserver(
api_opts["service-account-issuer"] = "https://kubernetes.default.svc"
api_opts["service-account-signing-key-file"] = str(service_account_key_path)
api_opts["service-account-key-file"] = str(service_account_key_path)
api_opts[
"kubelet-preferred-address-types"
] = "InternalIP,Hostname,InternalDNS,ExternalDNS,ExternalIP"
# TODO: encryption at rest
# api_opts["encryption-provider-config"] = str(encryption_config_path())
api_opts["kubelet-preferred-address-types"] = (
"InternalIP,Hostname,InternalDNS,ExternalDNS,ExternalIP"
)
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 7a5d5e7

Please sign in to comment.