Repository navigation
feat(compute): add security-group update command - #981
Conversation
pierre-emmanuelJ
left a comment
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
--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"}There was a problem hiding this comment.
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>
e97e81f to
e02d0f1
Compare
|
E2E tests failed with an unrelated error: Merging. |
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 updatecommand.Part of sc-209715
Checklist
(For exoscale contributors)
CHANGELOG.md)Testing
Tested on preprod with a simplified version of the E2E test. Worked as expected.