Skip to content

feat(provider): list provider instances #645

Draft
lengau wants to merge 3 commits intomainfrom
work/639/provider-images
Draft

feat(provider): list provider instances #645
lengau wants to merge 3 commits intomainfrom
work/639/provider-images

Conversation

@lengau
Copy link
Collaborator

@lengau lengau commented Aug 30, 2024

  • Have you followed the guidelines for contributing?
  • Have you signed the CLA?
  • Have you successfully run tox?

Fixes #639
Requires #644

Copy link
Contributor

@mr-cal mr-cal left a comment

Choose a reason for hiding this comment

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

Nice!

@mr-cal mr-cal requested a review from a team August 30, 2024 13:12
Copy link
Contributor

@upils upils left a comment

Choose a reason for hiding this comment

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

LGTM.

"""
return is_installed()

def list_instances(self) -> Collection[LXDInstance]:
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Add a test, at least to make sure we detect that this function should be updated if/when the LXDInstance class is updated? (same for the multipass provider)

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, a simple unit test for both would be useful.

@me6262
Copy link

me6262 commented Jan 27, 2026

what's left to do on this draft before merging?

install()
ensure_multipass_is_ready()

def list_instances(self) -> Collection[MultipassInstance]:
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this list all vms? Not just vms for the current application?

The API feels ambiguous or underdocumented, if the lxd provider returns instances for the current application (via project) and the multipass provider returns all vms.

Copy link
Contributor

Choose a reason for hiding this comment

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

In my opinion, the call for multipass should only return VMs starting with <app-name>- (for example, snapcraft- or rockcraft-).

This approach is naive, because if someone creates their own multipass vm like snapcraft-dev, we would unintentionally delete that. A follow-up PR could add some metadata or fingerprint to the VMs created by craft-providers, so we only delete our VMs.

"""
return is_installed()

def list_instances(self) -> Collection[LXDInstance]:
Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, a simple unit test for both would be useful.

@mr-cal
Copy link
Contributor

mr-cal commented Jan 28, 2026

Hi @me6262,

I think the remaining work is:

  • address feedback
  • merge in latest changes and resolve conflicts
  • add an entry to the changelog

@Aeonoi
Copy link

Aeonoi commented Feb 3, 2026

I can work on this.

@mr-cal
Copy link
Contributor

mr-cal commented Feb 4, 2026

I can work on this.

@Aeonoi, great! You can create a new PR and either use this as a starting point, or start from scratch.

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.

Provide a way to list (relevant) provider instances

5 participants