Skip to content

Commit

Permalink
[DPE-5945] Rename expose_external configuration option (#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
Batalex authored Nov 20, 2024
1 parent fe4b61c commit a7a775a
Show file tree
Hide file tree
Showing 7 changed files with 202 additions and 197 deletions.
9 changes: 7 additions & 2 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@
type: charm
parts:
charm:
build-snaps:
- rustup
charm-binary-python-packages:
- setuptools
build-packages:
- libffi-dev
- libssl-dev
- rustc
- cargo
- pkg-config
override-build:
# get latest rust stable toolchain
rustup default stable

craftctl default
bases:
- build-on:
- name: "ubuntu"
Expand Down
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ options:
description: The maximum percentage of the total cpu, disk and network capacity that is allowed to be used on a broker. For example, a value of `0.8` ensures that no broker should have >80% utilization
type: float
default: 0.8
expose-external:
expose_external:
description: "String to determine how to expose the Kafka cluster externally from the Kubernetes cluster. Possible values: 'nodeport', 'none'"
type: string
default: "nodeport"
372 changes: 188 additions & 184 deletions poetry.lock

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ pydantic = "<2"
pyyaml = "^6.0.1"
requests = "^2.32.3"
lightkube = "0.15.0"
# FIXME: Unpin once rustc 1.76 is available at build time
rpds-py = "<0.19"

[tool.poetry.group.charm-libs.dependencies]
# data_platform_libs/v0/data_interfaces.py
Expand Down Expand Up @@ -78,8 +76,6 @@ black = "^22.3.0"
ruff = ">=0.1.0"
codespell = ">=2.2.2"
pyright = "^1.1.301"
# FIXME: Unpin once rustc 1.76 is available at build time
rpds-py = "<0.19"

[tool.poetry.group.unit]
optional = true
Expand All @@ -104,7 +100,7 @@ pure-sasl = ">=0.5"
kafka-python = ">=2.0"
requests = ">2.25"

pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v22.0.0", subdirectory = "python/pytest_plugins/pytest_operator_cache"}
pytest-operator-cache = { git = "https://github.com/canonical/data-platform-workflows", tag = "v22.0.0", subdirectory = "python/pytest_plugins/pytest_operator_cache" }
# To be enabled if we are using groups on integration tests

[tool.poetry.group.format.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/core/structured_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def profile_values(cls, value: str) -> str | None:
@validator("expose_external")
@classmethod
def expose_external_validator(cls, value: str) -> str | None:
"""Check expose-external config option is only used on Kubernetes charm."""
"""Check expose_external config option is only used on Kubernetes charm."""
if SUBSTRATE == "vm":
return

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def test_listeners_in_server_properties(
) -> None:
"""Checks that listeners are split into INTERNAL, CLIENT and EXTERNAL."""
# Given
charm_configuration["options"]["expose-external"]["default"] = "nodeport"
charm_configuration["options"]["expose_external"]["default"] = "nodeport"
cluster_peer = PeerRelation(PEER, PEER, local_unit_data={"private-address": "treebeard"})
zk_relation = Relation(ZK, ZK, remote_app_data=zk_data)
client_relation = Relation(REL_NAME, "app")
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test_kraft.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def test_ready_to_start_no_peer_cluster(charm_configuration, base_state: State):
def test_ready_to_start_missing_data_as_controller(charm_configuration, base_state: State):
# Given
charm_configuration["options"]["roles"]["default"] = "controller"
charm_configuration["options"]["expose-external"]["default"] = "none"
charm_configuration["options"]["expose_external"]["default"] = "none"
ctx = Context(
KafkaCharm,
meta=METADATA,
Expand All @@ -112,7 +112,7 @@ def test_ready_to_start_missing_data_as_controller(charm_configuration, base_sta
def test_ready_to_start_missing_data_as_broker(charm_configuration, base_state: State):
# Given
charm_configuration["options"]["roles"]["default"] = "broker"
charm_configuration["options"]["expose-external"]["default"] = "none"
charm_configuration["options"]["expose_external"]["default"] = "none"
ctx = Context(
KafkaCharm,
meta=METADATA,
Expand All @@ -136,7 +136,7 @@ def test_ready_to_start_missing_data_as_broker(charm_configuration, base_state:
def test_ready_to_start(charm_configuration, base_state: State):
# Given
charm_configuration["options"]["roles"]["default"] = "broker,controller"
charm_configuration["options"]["expose-external"]["default"] = "none"
charm_configuration["options"]["expose_external"]["default"] = "none"
ctx = Context(
KafkaCharm,
meta=METADATA,
Expand Down

0 comments on commit a7a775a

Please sign in to comment.