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

Skip determining unix socket if a remote config address is set #358

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

MusicDin
Copy link
Member

This PR prevents unix socket to be determined if remote config address is set.

When this PR is merged, users will be able to create an arbitrary default remote and use it with lxd-user socket.
For example:

provider "lxd" {
  lxd_remote {
    name     = "lxd-users"
    scheme   = "unix"
    address  = "/var/snap/lxd/common/lxd-user/unix.socket"
    default  = true
  }
}

resource "lxd_instance" "instance" {
  remote  = "lxd-users"
  project = "user-1001"

  name      = "tf-c1"
  image     = "images:alpine/3.16"
  ephemeral = false
}

^ Above currently does not work, because provider tries to determine the unix socket for LXD defined remotes (such as images remote).

lxd/provider.go Outdated Show resolved Hide resolved
@MusicDin MusicDin force-pushed the fix/def-remote-addr branch from f072c02 to fc0dfcc Compare October 24, 2023 07:37
@simondeziel simondeziel merged commit 64f071d into terraform-lxd:main Oct 24, 2023
2 checks passed
@MusicDin MusicDin deleted the fix/def-remote-addr branch February 28, 2024 15:12
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.

3 participants