Closed trunet closed 2 weeks ago
@trunet When we introduce an image data source, it only works with images that are available on a specific instance server, like the ones you get with incus image list
. For the normal images that you download from the image servers, you should use the resource definition.
Do we have the same understanding?
Do we have the same understanding?
@maveonair you mean the ones present in the cluster, right? I have “local” images available in all cluster members and that’s what I need.
Do we have the same understanding?
@maveonair you mean the ones present in the cluster, right? I have “local” images available in all cluster members and that’s what I need.
Yes, exactly this is what I mean. So the definition would look like:
data "incus_image" "my_image" {
name = "my_image" # is the alias of the image, fingerprint would also be possible to set instead
}
output "fingerprint" {
value = data.incus_image.my_image.fingerprint
}
resource "incus_instance" "instance1" {
image = data.incus_image.my_image.fingerprint
name = "instance1"
}
yes, that’s it. thanks.
ahh, one thing, would be nice to have an incus_images where you can query multiple images with wildcards or regex. in my case, I have versions and would like to query the latest.
ahh, one thing, would be nice to have an incus_images where you can query multiple images with wildcards or regex. in my case, I have versions and would like to query the latest.
Do you mind if we start with a simple datasource first :)?
yeah, of course. appreciate the hard work.
I have a custom pipeline that delivers enriched images (things like custom apt sources, custom ldap, sssd, security tooling, ...) to incus clusters versioned.
This datasource will allow these images to be versioned and selected by latest and/or specific version when specifying on incus_instance dynamically.