Skip to content

provider: Support multiple URLs in remote#450

Merged
stgraber merged 3 commits into
lxc:mainfrom
maveonair:multiple-remote-addresses
Jun 4, 2026
Merged

provider: Support multiple URLs in remote#450
stgraber merged 3 commits into
lxc:mainfrom
maveonair:multiple-remote-addresses

Conversation

@maveonair

@maveonair maveonair commented Jun 2, 2026

Copy link
Copy Markdown
Member

Fixes #449


This PR updates the provider to use Incus v7 and supports the new multiple remote address model introduced by Incus.

Incus remotes now expose addresses as a list, allowing clustered remotes to define more than one endpoint. To keep the Terraform provider API backward-compatible, the provider continues to use the existing remote.address attribute.

Multiple remote addresses can now be provided as a comma-separated string, matching the Incus CLI configuration format.

provider "incus" {
  accept_remote_certificate    = true
  generate_client_certificates = false

  default_remote = "cluster"

  remote {
    name    = "cluster"
    address = "https://10.1.2.8,https://10.1.2.9"
  }

  remote {
    name     = "docker"
    address  = "https://docker.io"
    protocol = "oci"
    public   = true
  }
}

@maveonair maveonair force-pushed the multiple-remote-addresses branch from c8d1bba to d5732da Compare June 2, 2026 17:52
@stgraber

stgraber commented Jun 2, 2026

Copy link
Copy Markdown
Member

@maveonair hmm, can we:

  • Split the v6 => v7 into its own commit
  • Not break API, either by allowing comma separated values in the existing config key (same as Incus does in its .yml) OR by retaining support for the existing key as a backward compatibility mechanism (returning an error if both are set)

Otherwise, we'll need a major version bump on this one as it's likely to affect quite a few users.

@maveonair

maveonair commented Jun 2, 2026

Copy link
Copy Markdown
Member Author

@maveonair hmm, can we:

* Split the v6 => v7 into its own commit

* Not break API, either by allowing comma separated values in the existing config key (same as Incus does in its .yml) OR by retaining support for the existing key as a backward compatibility mechanism (returning an error if both are set)

Otherwise, we'll need a major version bump on this one as it's likely to affect quite a few users.

  1. Yes, I can do that
  2. We can do addr = "https://....:8443, https://...:8443" as we have the logic already in place for INCUS_REMOTE. I think both addr and addrs is not a nice dev UX. Would you be fine if we go first with the comma separated approach?

Signed-off-by: Fabian Mettler <fabian@mettler.cc>
@maveonair maveonair force-pushed the multiple-remote-addresses branch from d5732da to c045b5a Compare June 2, 2026 18:04
@maveonair maveonair changed the title provider: Support multiple remote URLS provider: Use Incus V7 API Jun 2, 2026
@stgraber

stgraber commented Jun 2, 2026

Copy link
Copy Markdown
Member

We can do addr = "https://....:8443, https://...:8443" as we have the logic already in place for INCUS_REMOTE. I think both addr and addrs is not a nice dev UX. Would you be fine if we go first with the comma separated approach?

yep, comma separate works for me and aligns it with what we do in the Incus CLI as far as the on-disk storage of that data.

Signed-off-by: Fabian Mettler <fabian@mettler.cc>
@maveonair maveonair force-pushed the multiple-remote-addresses branch from be2f884 to 2fbaa11 Compare June 2, 2026 18:20
@maveonair maveonair changed the title provider: Use Incus V7 API provider: support multiple URLs in remote Jun 2, 2026
@maveonair maveonair changed the title provider: support multiple URLs in remote provider: Support multiple URLs in remote Jun 2, 2026
@maveonair

maveonair commented Jun 2, 2026

Copy link
Copy Markdown
Member Author

@stgraber it looks like the tests are failing with

 Failed instance creation: Failed getting remote image info: Failed to run:
       skopeo --insecure-policy inspect docker://docker.io/alpine:latest --no-tags:
       exit status 1 (time="2026-06-02T18:28:29Z" level=fatal msg="Error parsing
       image name \"docker://docker.io/alpine:latest\": loading registries
       configuration: loading registries configuration
       \"/etc/containers/registries.conf\": registries.conf must be in v2 format but
       is in v1")

I ran the same tests on my machine and ran the command above with Skopeo direclty and I don't get the error message. Do you have an idea why?

@stgraber

stgraber commented Jun 2, 2026

Copy link
Copy Markdown
Member

Probably just Github having a dirty /etc/containers. Maybe have the Github workflow delete that folder?

@maveonair maveonair force-pushed the multiple-remote-addresses branch from b4f2988 to 97511be Compare June 4, 2026 06:36
Signed-off-by: Fabian Mettler <fabian@mettler.cc>
@maveonair maveonair force-pushed the multiple-remote-addresses branch from 97511be to 0c9e177 Compare June 4, 2026 06:38
@maveonair maveonair requested a review from stgraber June 4, 2026 06:47
@stgraber stgraber merged commit ffcc51c into lxc:main Jun 4, 2026
17 of 18 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.

Multi urls remote not supported

2 participants