Skip to content
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
4 changes: 2 additions & 2 deletions charms/garm-configurator/charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ config:
Minimum number of idle runners in the scaleset.
max-runner:
type: int
default: 0
default: 1
description: |
Maximum number of runners in the scaleset.
Maximum number of runners in the scaleset. Must be greater than 0.
labels:
type: string
description: |
Expand Down
4 changes: 2 additions & 2 deletions charms/garm-configurator/src/charm_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ def from_charm(cls, charm: ops.CharmBase) -> "ScalesetConfig":
)

max_runner = int(charm.config.get(SCALESET_MAX_RUNNER_CONFIG_NAME, 0))
if max_runner < 0:
if max_runner <= 0:
raise CharmConfigInvalidError(
f"{SCALESET_MAX_RUNNER_CONFIG_NAME} must be non-negative"
f"{SCALESET_MAX_RUNNER_CONFIG_NAME} must be greater than 0"
)
if max_runner < min_idle_runner:
raise CharmConfigInvalidError(
Expand Down
7 changes: 6 additions & 1 deletion charms/garm-configurator/tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,14 @@ def test_charm_waiting_with_valid_config_no_relation():
),
pytest.param(
{"max-runner": -5},
"max-runner must be non-negative",
"max-runner must be greater than 0",
id="negative-max-runner",
),
pytest.param(
{"max-runner": 0},
"max-runner must be greater than 0",
id="zero-max-runner",
),
pytest.param(
{"min-idle-runner": 5, "max-runner": 3},
"max-runner must be greater than or equal to min-idle-runner",
Expand Down
2 changes: 1 addition & 1 deletion charms/garm-configurator/tox.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ commands = [

[env.unit]
description = "Run unit tests"
deps = ["pytest", "coverage[toml]", "ops-scenario==8.7.1", "-r requirements.txt"]
deps = ["pytest", "coverage[toml]", "ops-scenario==8.8.0", "-r requirements.txt"]
commands = [
[
"coverage",
Expand Down
1 change: 1 addition & 0 deletions charms/tests/integration/test_garm_configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def deploy_garm_configurator_app_fixture(
"name": "test-scaleset",
"flavor": "m1.large",
"os-arch": "amd64",
"max-runner": "1",
"repo": "myorg/myrepo",
},
)
Expand Down
4 changes: 4 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

Each revision is versioned by the date of the revision.

## 2026-07-06

- `garm-configurator`: reject `max-runner=0` during config validation. GARM rejects scale set creation with `max_runners cannot be 0`, so the charm now surfaces the invalid configuration before publishing unusable scale set data to GARM.

## 2026-07-02

- Fix GARM organization and repository registration: the charm now sets a webhook secret when registering entities. GARM requires a non-empty webhook secret to register an org/repo, so registration previously failed with an opaque server error and scalesets were never created. The charm generates a throwaway secret automatically, so no operator configuration is required.
Expand Down
Loading