Fix pool ID check when listing instances

We should be looking for the poolIDKey in the extended LXD config.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2023-06-04 15:43:03 +03:00
parent fdfcc619ad
commit 234095e456
No known key found for this signature in database
GPG key ID: 7D073DCC2C074CB5

View file

@ -417,7 +417,7 @@ func (l *LXD) ListInstances(ctx context.Context, poolID string) ([]params.Instan
for _, instance := range instances {
if id, ok := instance.ExpandedConfig[controllerIDKeyName]; ok && id == l.controllerID {
if poolID != "" {
id := instance.ExpandedConfig[poolID]
id := instance.ExpandedConfig[poolIDKey]
if id != poolID {
// Pool ID was specified. Filter out instances belonging to other pools.
continue