Skip to content

feat(iutil): carry location and devices on Instance - #257

Merged
jochumdev merged 2 commits into
lxc:mainfrom
tallica:feat/instance-location-devices
Nov 11, 2026
Merged

jochumdev merged 2 commits into
lxc:mainfrom
tallica:feat/instance-location-devices

Conversation

@tallica

@tallica tallica commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

iutil.Instance drops the cluster member an instance runs on and its devices, so a consumer cannot tell where an instance sits or what is attached to it.

This adds both, read in enricher.setInstance (devices expanded, falling back to Devices as interfaces() already does):

  • Instance.Location(): the cluster member, empty off a cluster.
  • Instance.Devices(): an iterator over cloned devices, read-only like Config().
  • Both are in Equal, EqualNoNets and the JSON wire form, so moving an instance to another member produces a changed event.

NewInstance gains location and devices parameters; callers are updated.

Motivation: jochumdev/incus-caddy-config#2 (templates that route through the member's address need .Location).

Signed-off-by: Michał Lipski <michal@tallica.pl>
@tallica
tallica force-pushed the feat/instance-location-devices branch from edbbf0f to 20912fb Compare November 11, 2026 16:01
@tallica
tallica marked this pull request as ready for review November 11, 2026 16:01
Signed-off-by: Michał Lipski <michal@tallica.pl>
@tallica
tallica force-pushed the feat/instance-location-devices branch from 841988c to b7f39aa Compare November 11, 2026 16:05
@jochumdev
jochumdev merged commit 096198e into lxc:main Nov 11, 2026
8 checks passed
@jochumdev

Copy link
Copy Markdown
Member

Thanks.

@tallica
tallica deleted the feat/instance-location-devices branch November 11, 2026 22:51
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.

2 participants