Skip to content

feat(compute): add security-group update command - #981

Merged
imiric merged 1 commit into
masterfrom
imiric/sc-209715/feat/security-group-update
Dec 3, 2026
Merged

imiric merged 1 commit into
masterfrom
imiric/sc-209715/feat/security-group-update

Conversation

@imiric

@imiric imiric commented Dec 1, 2026

Copy link
Copy Markdown
Member

Description

In-place Security Group updates are now supported by the API, so changing a name or description no longer requires deleting and recreating the group.

This exposes it via a new exo compute security-group update command.

Part of sc-209715

Checklist

(For exoscale contributors)

  • Changelog updated (under Unreleased block, and add the Pull Request #number for each bit you add to the CHANGELOG.md)
  • Testing

Testing

Tested on preprod with a simplified version of the E2E test. Worked as expected.

@imiric
imiric requested a review from a team December 1, 2026 11:31

@pierre-emmanuelJ pierre-emmanuelJ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, and the e2e coverage is nice. One small thing inline about empty values.

}

if cmd.Flags().Changed(clicmd.MustCLICommandFlagName(c, &c.Description)) {
request.Description = c.Description

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--description '' (and --name '') silently does nothing: both fields are omitempty in UpdateSecurityGroupRequest, so the empty value never reaches the API, and the command still reports success with the old value. Clearing a description looks like a natural use of this command, so I'd at least reject empty values in CmdPreRun with a clear error rather than pretend it worked.

Repro
exo compute security-group create sg-test --description 'initial desc'
exo -O json compute security-group update sg-test --description '' | jq -c '{name,description}'
# {"name":"sg-test","description":"initial desc"}
exo -O json compute security-group update sg-test --name '' | jq -c '{name,description}'
# {"name":"sg-test","description":"initial desc"}

@imiric imiric Dec 3, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

This should be changed in the OpenAPI spec and exposed by egoscale, but in the meantime I added some validation like you suggested.

BTW, this is not the only place with this issue. It also happens with EIP updates, SKS nodepool updates, and privnet updates. It is implemented correctly in NLB updates, though.

I'll discuss this internally with relevant teams and maybe propose a fix.

In-place Security Group updates are now supported by the API, so
changing a name or description no longer requires deleting and
recreating the group.

This exposes it via a new `exo compute security-group update` command.

Part of [sc-209715][1]

[1]: https://app.shortcut.com/exoscale/story/209715/

Co-authored-by: qwen3.8-flash-next <noreply@qwen.ai>
@imiric
imiric force-pushed the imiric/sc-209715/feat/security-group-update branch from e97e81f to e02d0f1 Compare December 3, 2026 10:41
@imiric

imiric commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

E2E tests failed with an unrelated error:

error: Forbidden: DBaaS operation are not yet permitted in es-mad-1

Merging.

@imiric
imiric merged commit 9c08b2b into master Dec 3, 2026
7 of 8 checks passed
@imiric
imiric deleted the imiric/sc-209715/feat/security-group-update branch December 3, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants