Allow to configure storage pool name
As mentioned in [the linuxcontainers.org thread](https://discuss.linuxcontainers.org/t/early-development-version-of-the-resurrected-incus-compose-online/25690/), right now incus-compose hardcodes a storage pool named of `default`. On IncusOS, the default storage pool is named `local`. For flexibility, it would be great to add an option to allow configuring the target storage pool name. I reworked the patch provided by [@Sagi](https://discuss.linuxcontainers.org/t/early-development-version-of-the-resurrected-incus-compose-online/25690/13) to apply cleanly on top of main: ```diff --- a/cmd/incus-compose/main.go 2026-05-29 16:49:19.808194755 +0000 +++ b/cmd/incus-compose/main.go 2026-05-29 16:50:04.865815063 +0000 @@ -151,6 +151,12 @@ Aliases: []string{"p"}, Usage: `Project name`, }, + // TODO: check for valid pool name; idk. what incus permits? + &cli.StringFlag{ + Name: "pool-name", + Usage: `Pool name`, + Value: "default", + }, &cli.StringSliceFlag{ Name: "file", Aliases: []string{"f"}, @@ -237,6 +243,7 @@ client.ClientURL(url), client.ClientLogger(slog.Default()), client.ClientInsecureSkipVerify(), + client.ClientDefaultStoragePool(cmd.String("pool-name")), } // Add TLS client certificate if provided @@ -278,6 +285,7 @@ client.ClientLogger(slog.Default()), client.ClientProvideInstanceServer(server), client.ClientCacheProject(cacheProject), + client.ClientDefaultStoragePool(cmd.String("pool-name")), } c := client.New(ctx, opts...) ``` This adds a `--pool-name` global flag, however it doesn't seem to be sufficient: ``` % incus-compose --remote incus-os --pool-name local --project-name immich-compose --debug up 14:02 DBG Using connection remote=incus-os 14:02 DBG Got project url=https://re.da.ct.ed:8443 name=default incus_name=default 14:02 DBG Found healthchecks url=https://re.da.ct.ed:8443 project=immich-compose incus_project=immich-compose 14:02 DBG Getting image url=https://re.da.ct.ed:8443 project=immich-compose incus_project=immich-compose image=ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:bcf63357191b76a916ae5eb93464d65c07511da41e3bf7a8416db519b40b1c23 service=database 14:02 DBG Getting image url=https://re.da.ct.ed:8443 project=immich-compose incus_project=immich-compose image=ghcr.io/immich-app/immich-server:v2 service=immich-server 14:02 DBG Getting image url=https://re.da.ct.ed:8443 project=immich-compose incus_project=immich-compose image=ghcr.io/immich-app/immich-machine-learning:v2 service=immich-machine-learning 14:02 DBG Getting image url=https://re.da.ct.ed:8443 project=immich-compose incus_project=immich-compose image=docker.io/valkey/valkey:9@sha256:3b55fbaa0cd93cf0d9d961f405e4dfcc70efe325e2d84da207a0a8e6d8fde4f9 service=redis 14:02 DBG Prepared healthd sidecar image url=https://re.da.ct.ed:8443 project=immich-compose incus_project=immich-compose name=ic-healthd 14:02 DBG network:default 14:02 DBG network:default 14:02 DBG network:default 14:02 DBG Ensure url=https://re.da.ct.ed:8443 project=immich-compose incus_project=immich-compose resources="[instance(redis-1) instance(database-1) instance(immich-machine-learning-1) instance(immich-server-1) network(ic-pzw3m2z2kt) image(ghcr.io/immich-app/postgres@sha256:bcf63357191b76a916ae5eb93464d65c07511da41e3bf7a8416db519b40b1c23) image(ghcr.io/immich-app/immich-server:v2) image(ghcr.io/immich-app/immich-machine-learning:v2) image(docker.io/valkey/valkey@sha256:3b55fbaa0cd93cf0d9d961f405e4dfcc70efe325e2d84da207a0a8e6d8fde4f9) image(registry.gitlab.com:r3j0/incus-compose/ic-healthd:latest) healthd(ic-healthd)]" 14:02 DBG Done url=https://re.da.ct.ed:8443 name=ghcr.io/immich-app/immich-server:v2 kind=image action=ensure 14:02 DBG Done url=https://re.da.ct.ed:8443 name=ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:bcf63357191b76a916ae5eb93464d65c07511da41e3bf7a8416db519b40b1c23 kind=image action=ensure 14:02 DBG Done url=https://re.da.ct.ed:8443 name=docker.io/valkey/valkey:9@sha256:3b55fbaa0cd93cf0d9d961f405e4dfcc70efe325e2d84da207a0a8e6d8fde4f9 kind=image action=ensure 14:02 DBG Done url=https://re.da.ct.ed:8443 name=ghcr.io/immich-app/immich-machine-learning:v2 kind=image action=ensure 14:02 DBG Done url=https://re.da.ct.ed:8443 name=registry.gitlab.com:r3j0/incus-compose/ic-healthd:latest kind=image action=ensure 14:02 DBG Done url=https://re.da.ct.ed:8443 name=default kind=network action=ensure 14:02 DBG Result with error url=https://re.da.ct.ed:8443 name=redis-1 kind=instance action=ensure error="in an operation: Failed instance creation: Failed creating instance record: Failed initializing instance: Failed loading storage pool: Storage pool not found" 14:02 DBG Result with error url=https://re.da.ct.ed:8443 name=database-1 kind=instance action=ensure error="in an operation: Failed instance creation: Failed creating instance record: Failed initializing instance: Failed loading storage pool: Storage pool not found" 14:02 DBG Result with error url=https://re.da.ct.ed:8443 name=immich-machine-learning-1 kind=instance action=ensure error="in an operation: Failed instance creation: Failed creating instance record: Failed initializing instance: Failed loading storage pool: Storage pool not found" 14:02 DBG Result with error url=https://re.da.ct.ed:8443 name=immich-server-1 kind=instance action=ensure error="bind mounts not supported over network connection" 14:02 DBG Result with error url=https://re.da.ct.ed:8443 name=ic-healthd kind=instance action=ensure error="in an operation: Failed instance creation: Failed creating instance record: Failed initializing instance: Failed loading storage pool: Storage pool not found" 14:02 ERR Creating resources url=https://re.da.ct.ed:8443 project=immich-compose incus_project=immich-compose error="in an operation: instance(redis-1): Failed instance creation: Failed creating instance record: Failed initializing instance: Failed loading storage pool: Storage pool not found\nin an operation: instance(database-1): Failed instance creation: Failed creating instance record: Failed initializing instance: Failed loading storage pool: Storage pool not found\nin an operation: instance(immich-machine-learning-1): Failed instance creation: Failed creating instance record: Failed initializing instance: Failed loading storage pool: Storage pool not found\nbind mounts not supported over network connection: instance(immich-server-1)\ncreating instance: ensuring instance: in an operation: instance(ic-healthd): Failed instance creation: Failed creating instance record: Failed initializing instance: Failed loading storage pool: Storage ``` Just leaving this here in case anyone looks for it, there's no rush thanks for your time.
issue