Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtering mechanisms for incus_image datasource #187

Open
jonatas-lima opened this issue Dec 16, 2024 · 2 comments
Open

Filtering mechanisms for incus_image datasource #187

jonatas-lima opened this issue Dec 16, 2024 · 2 comments

Comments

@jonatas-lima
Copy link
Contributor

Some cloud image datasources provide filtering mechanisms, such as the most_recent and name_regex parameters in aws_ami or google_compute_instance. I reviewed the code and identified two possible approaches to implement this feature:

  1. Client-side approach: Query all image aliases to Incus server, then apply the filters within the provider.

or

  1. Server-side approach: Modify the Incus server image_alias to accept filtering parameters directly. Something like here.

Which approach do you think would be more appropriate?

If this issue seems relevant, I’d be happy to contribute by working on it!

@maveonair
Copy link
Member

From a provider’s perspective, it’s always preferable to handle heavy work on the server-side. However, we already have logic in our provider that queries all aliases and determines the appropriate image. This is done, for example, when specifying the image’s architecture.

But if you need to query all possible image aliases first, it might not be the most efficient solution if an image server has many aliases. In such cases, it could make sense for the server to provide an API to leverage that functionality.

@stgraber what are your thoughts on this?

@stgraber
Copy link
Member

Most Incus image servers are static web servers using simplestreams, so there is no way to add an API to that which would do server-side filtering.

We could do it in the Incus API but then that would only apply to the relatively uncommon case where Incus itself is used as an image server which is very unlikely for any environment where enough images are present to justify server-side filtering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants