lxc / terraform-provider-incus

Incus provider for Terraform/OpenTofu
https://linuxcontainers.org/incus
Mozilla Public License 2.0
45 stars 10 forks source link

Fix: If Image Remote is not set, the instance server is used as the image server. #100

Closed maveonair closed 1 month ago

maveonair commented 1 month ago

If Image Remote is not set, the instance server is used as the image server.

This pull request fixes: https://github.com/lxc/terraform-provider-incus/issues/94

Example:

resource "incus_project" "test" {
  name = "test"

  config = {
    "features.images"   = true
    "features.profiles" = false
  }
}

resource "incus_image" "alpine" {
  source_remote = "images"
  source_image  = "alpine/3.18/arm64"
  project       = incus_project.test.name
}

resource "incus_instance" "test1" {
  name    = "test1"
  image   = "images:alpine/3.18/arm64"
  project = incus_project.test.name
}

resource "incus_instance" "test2" {
  name    = "test2"
  image   = incus_image.alpine.fingerprint
  project = incus_project.test.name
}
stgraber commented 1 month ago

The new test is failing