Skip to content

Commit ae0825b

Browse files
authored
[DPE-5945] Rename expose_external configuration option (#151)
1 parent a3734ec commit ae0825b

13 files changed

+280
-289
lines changed

charmcraft.yaml

+7-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,20 @@
44
type: charm
55
parts:
66
charm:
7+
build-snaps:
8+
- rustup
79
charm-binary-python-packages:
810
- setuptools
911
- pydantic
1012
build-packages:
1113
- libffi-dev
1214
- libssl-dev
13-
- rustc
14-
- cargo
1515
- pkg-config
16+
override-build:
17+
# get latest rust stable toolchain
18+
rustup default stable
19+
20+
craftctl default
1621
bases:
1722
- build-on:
1823
- name: "ubuntu"

config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ options:
108108
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
109109
type: float
110110
default: 0.8
111-
expose-external:
111+
expose_external:
112112
description: "String to determine how to expose the Kafka cluster externally from the Kubernetes cluster. Possible values: 'nodeport', 'false'"
113113
type: string
114114
default: "false"

poetry.lock

+261-270
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

-5
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ pydantic = "^1.10.7"
4141
pyyaml = "^6.0.1"
4242
requests = ">2.25"
4343
lightkube = "0.15.0"
44-
# FIXME: Unpin once rustc 1.76 is available at build time
45-
rpds-py = "<0.19"
46-
4744

4845
[tool.poetry.group.charm-libs.dependencies]
4946
# data_platform_libs/v0/data_interfaces.py
@@ -74,8 +71,6 @@ ruff = ">=0.1.0"
7471
codespell = ">=2.2.2"
7572
pyright = "^1.1.301"
7673
lightkube = "0.15.0"
77-
# FIXME: Unpin once rustc 1.76 is available at build time
78-
rpds-py = "<0.19"
7974

8075
[tool.poetry.group.unit]
8176
optional = true

src/core/structured_config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def profile_values(cls, value: str) -> str | None:
234234
@validator("expose_external")
235235
@classmethod
236236
def expose_external_validator(cls, value: str) -> str | None:
237-
"""Check expose-external config option is only used on Kubernetes charm."""
237+
"""Check expose_external config option is only used on Kubernetes charm."""
238238
if SUBSTRATE == "vm":
239239
return
240240

tests/integration/ha/test_ha.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ async def test_build_and_deploy(ops_test: OpsTest, kafka_charm, app_charm):
8585
num_units=1,
8686
resources={"kafka-image": KAFKA_CONTAINER},
8787
trust=True,
88-
config={"expose-external": "nodeport"},
88+
config={"expose_external": "nodeport"},
8989
),
9090
ops_test.model.deploy(ZK_NAME, channel="3/edge", num_units=1, trust=True),
9191
ops_test.model.deploy(app_charm, application_name=DUMMY_NAME, trust=True),
@@ -124,7 +124,7 @@ async def test_multi_cluster_isolation(ops_test: OpsTest, kafka_charm):
124124
num_units=1,
125125
resources={"kafka-image": KAFKA_CONTAINER},
126126
trust=True,
127-
config={"expose-external": "nodeport"},
127+
config={"expose_external": "nodeport"},
128128
),
129129
ops_test.model.deploy(
130130
ZK_NAME, application_name=second_zk_name, channel="3/edge", trust=True

tests/integration/test_balancer.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ async def test_build_and_deploy(self, ops_test: OpsTest, kafka_charm):
5555
config={
5656
"roles": "broker,balancer" if self.balancer_app == APP_NAME else "broker",
5757
"profile": "testing",
58-
"expose-external": "nodeport",
58+
"expose_external": "nodeport",
5959
},
6060
resources={"kafka-image": KAFKA_CONTAINER},
6161
trust=True,
@@ -92,7 +92,7 @@ async def test_build_and_deploy(self, ops_test: OpsTest, kafka_charm):
9292
config={
9393
"roles": self.balancer_app,
9494
"profile": "testing",
95-
"expose-external": "nodeport",
95+
"expose_external": "nodeport",
9696
},
9797
resources={"kafka-image": KAFKA_CONTAINER},
9898
trust=True,

tests/integration/test_charm.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async def test_build_and_deploy(ops_test: OpsTest, kafka_charm):
4545
num_units=1,
4646
resources={"kafka-image": KAFKA_CONTAINER},
4747
trust=True,
48-
config={"expose-external": "nodeport"},
48+
config={"expose_external": "nodeport"},
4949
),
5050
)
5151
await ops_test.model.block_until(lambda: len(ops_test.model.applications[ZK_NAME].units) == 3)

tests/integration/test_password_rotation.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async def test_build_and_deploy(ops_test: OpsTest, kafka_charm):
3636
resources={"kafka-image": KAFKA_CONTAINER},
3737
num_units=1,
3838
trust=True,
39-
config={"expose-external": "nodeport"},
39+
config={"expose_external": "nodeport"},
4040
),
4141
)
4242
await ops_test.model.block_until(lambda: len(ops_test.model.applications[ZK_NAME].units) == 3)

tests/integration/test_provider.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ async def test_deploy_charms_relate_active(
5151
num_units=1,
5252
resources={"kafka-image": KAFKA_CONTAINER},
5353
trust=True,
54-
config={"expose-external": "nodeport"},
54+
config={"expose_external": "nodeport"},
5555
),
5656
ops_test.model.deploy(app_charm, application_name=DUMMY_NAME_1, num_units=1, trust=True),
5757
)

tests/integration/test_scaling.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ async def test_kafka_simple_scale_up(ops_test: OpsTest, kafka_charm):
3232
num_units=1,
3333
resources={"kafka-image": KAFKA_CONTAINER},
3434
trust=True,
35-
config={"expose-external": "nodeport"},
35+
config={"expose_external": "nodeport"},
3636
),
3737
)
3838
await ops_test.model.wait_for_idle(apps=[APP_NAME, ZK_NAME])

tests/integration/test_tls.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ async def test_deploy_tls(ops_test: OpsTest, kafka_charm, app_charm):
5555
resources={"kafka-image": KAFKA_CONTAINER},
5656
config={
5757
"ssl_principal_mapping_rules": "RULE:^.*[Cc][Nn]=([a-zA-Z0-9.]*).*$/$1/L,DEFAULT",
58-
"expose-external": "nodeport",
58+
"expose_external": "nodeport",
5959
},
6060
trust=True,
6161
),

tests/unit/test_config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def test_listeners_in_server_properties(
132132
) -> None:
133133
"""Checks that listeners are split into INTERNAL, CLIENT and EXTERNAL."""
134134
# Given
135-
charm_configuration["options"]["expose-external"]["default"] = "nodeport"
135+
charm_configuration["options"]["expose_external"]["default"] = "nodeport"
136136
cluster_peer = PeerRelation(PEER, PEER, local_unit_data={"private-address": "treebeard"})
137137
zk_relation = Relation(ZK, ZK, remote_app_data=zk_data)
138138
client_relation = Relation(REL_NAME, "app")

0 commit comments

Comments
 (0)