Repository navigation
Conversation
yanksyoon
requested review from
cbartz,
florentianayuwono,
javierdelapuente,
weiiwang01 and
yhaliaw
as code owners
October 21, 2026 13:26
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Lets the operator pin the OpenStack security group a GARM scale set's runners are launched in, by passing an ID or name straight through to the provider.
garm-configurator: new optionalsecurity-groupconfiguration. It is published on thegarm-configuratorrelation assecurity_group, likeimage_visibility.garm: readssecurity_groupfrom the configurator's databag and puts it in the scale set'sextra_specs.security_groups, whichgarm-provider-openstack(v0.1.5, already pinned in the rock) maps to the instance port. A change is picked up by the existing drift detection, so the scale set is updated in place.Why we need it
Runners in one OpenStack project share its default security group, so they can reach each other, and a compromised job can attack its peers (ISD-7035). Pinning a locked-down group isolates them. The group itself stays the operator's to create and manage: the charms only pass the reference through.
This is the minimal version of ISD-7035. It does not create or converge the group. #436 manages a group's lifecycle from the charms; it is a separate, larger change and this PR neither builds on it nor modifies it. If both land,
security-groupcan name the group #436 manages.Test plan
tox -c tox.toml -e unit, per charm):garm454 passed,garm-configurator66 passed. The new tests assert the configured group reaches the provider:test_create_sends_security_group_as_an_extra_spec— the create call carriesextra_specs == {"security_groups": ["sg-runner"]}.test_update_converges_security_group— a changed or removed group converges in one update instead of re-updating on every reconcile.test_security_group_follows_the_configurator_databag— the databag value lands on the scale set spec, and an absent value stays unset for an older configurator.test_security_group_written_to_garm_configurator_relation— the charm config reaches the databag, empty when unset.fmt,lint,complexity,static: clean for both charms.tox -e garm-e2eagainst a tenant would be the check.Review focus
str(charm.config.get(..., "")).strip()rather than_get_optional_string_config(...)plusor "":ScalesetConfig.from_charmand_configure_garm_relationboth sit exactly at the cognitive-complexity limit, and either form pushes one of them over. That is why the field defaults to""instead ofNone.security_groups), matchinggarm-provider-openstack, but the configurator takes one group. A list-valued option is the obvious next step if operators need more than one.Potential breaking changes
None. The option is optional; while unset the charm publishes an empty
security_groupand the scale set's extra specs are unchanged, so the provider keeps attaching the project's default group.New dependencies, APIs, modules, or workflow changes
garm-configuratorsecurity-group.security_groupon thegarm-configuratorrelation.security_groupsis an existinggarm-provider-openstackextra spec.Checklist
CONTRIBUTING.mdhas been updated upon changes to the contribution/development process (n/a: no process change)docs/changelog.mdwith user-relevant changes.copilot-collections.yamlor.github/instructions/: (n/a)