Skip to content

Feature: Support deleting multiple objects in CLI#2656

Merged
stgraber merged 2 commits intolxc:mainfrom
Mujib-Ahasan:delete-multiple-object
Nov 28, 2025
Merged

Feature: Support deleting multiple objects in CLI#2656
stgraber merged 2 commits intolxc:mainfrom
Mujib-Ahasan:delete-multiple-object

Conversation

@Mujib-Ahasan
Copy link
Copy Markdown
Contributor

Description

Changes have been made to ensure multiple object deletion in a single command with multiple objects in argument. This PR is opened to make the feature available.

Related issue #2651

@Mujib-Ahasan
Copy link
Copy Markdown
Contributor Author

Hey @stgraber , only for commands first push is made:

  • incus cluster group delete
  • incus image alias delete
  • incus network delete

will push others after these reviews

@Mujib-Ahasan
Copy link
Copy Markdown
Contributor Author

Commands support multiple delete objects (including previous):

  • incus network acl delete
  • incus network address-set delete
  • incus network integration delete
  • incus network zone delete

@stgraber
Copy link
Copy Markdown
Member

@Mujib-Ahasan you'll want to look at and fix the issues reported by the Tests / Code checks.

@Mujib-Ahasan
Copy link
Copy Markdown
Contributor Author

Hello @stgraber, I tried my best to avoid errors.
Not sure what changes warning.go want. PTAL

func (c *cmdWarningDelete) Run(cmd *cobra.Command, args []string) error {

@stgraber stgraber force-pushed the delete-multiple-object branch 2 times, most recently from 8f01bf2 to d314d96 Compare November 25, 2025 05:48
Comment on lines +281 to +283
cmd.Short = i18n.G("Delete a cluster group")
cmd.Short = i18n.G("Delete cluster-groups")
cmd.Long = cli.FormatSection(i18n.G("Description"), i18n.G(
`Delete a cluster group`))
`Delete cluster-groups`))
Copy link
Copy Markdown
Member

@stgraber stgraber Nov 25, 2025

Choose a reason for hiding this comment

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

This should be Delete cluster groups instead of cluster-groups.

@@ -278,18 +278,14 @@ func (c *cmdClusterGroupDelete) Command() *cobra.Command {
cmd := &cobra.Command{}
cmd.Use = cli.Usage("delete", i18n.G("[<remote>:]<group>"))
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.

This usage needs to be updated to show multiple groups being allowed.

[<remote>:]<group> [[<remote>:]<group>...]

if resource.name == "" {
return errors.New(i18n.G("Missing network address set name"))
}
// Delete the Address Set.
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.

Shouldn't be capitalized, just Delete the address set. is fine.

@stgraber
Copy link
Copy Markdown
Member

@Mujib-Ahasan I did a quick rebase of the changes and reviewed them.

The main things I'm seeing are:

  • All the Use fields need updating. I provided an example for the cluster group one.
  • Couple of minors spelling things.
  • I think you may have missing warning delete in this change.
  • The "Code" test failure is because of the translation template. Once you've updated all the "Use" fields, run "make i18n" and commit the result as "i18n: Update translation templates", that should take care of that failure. I can also handle that one for you easily if that helps.

@Mujib-Ahasan
Copy link
Copy Markdown
Contributor Author

Thank you @stgraber for pointing out,I'll change it as suggested, soon!!

@Mujib-Ahasan Mujib-Ahasan force-pushed the delete-multiple-object branch from d314d96 to b0996d1 Compare November 25, 2025 17:31
@github-actions github-actions bot added Documentation Documentation needs updating API Changes to the REST API and removed Documentation Documentation needs updating API Changes to the REST API labels Nov 25, 2025
@Mujib-Ahasan
Copy link
Copy Markdown
Contributor Author

previously did some mistake during pushing, hope this will work now.

The "Code" test failure is because of the translation template. Once you've updated all the "Use" fields, run "make i18n" and commit the result as "i18n: Update translation templates", that should take care of that failure. I can also handle that one for you easily if that helps.

It would be great if you handle this!

@stgraber
Copy link
Copy Markdown
Member

Looking into this one now

@stgraber stgraber force-pushed the delete-multiple-object branch from 8049aa4 to 5e23954 Compare November 28, 2025 00:15
@stgraber stgraber merged commit 4e7d352 into lxc:main Nov 28, 2025
37 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants