Skip to content

Commit

Permalink
Merge pull request #75 from gabriel-samfira/fix-list-instances-in-exa…
Browse files Browse the repository at this point in the history
…mples

Fix ListInstances in external provider examples
  • Loading branch information
gabriel-samfira committed Feb 3, 2023
2 parents 0513767 + 4982cab commit fc1012d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions contrib/providers.d/azure/garm-external-provider
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ function GetInstance() {

function ListInstances() {
INSTANCES=$(az vm list --query "[?tags.garm_pool_id == '${GARM_POOL_ID}']" -o json --only-show-errors 2>&1)
echo $info | jq -r '
echo $info | jq -r '[
.[] | {
provider_id: .name,
name: .name,
Expand All @@ -326,7 +326,7 @@ function ListInstances() {
os_arch: .tags.os_arch,
pool_id: .tags.garm_pool_id,
status: {"Creating": "pending_create", "Migrating": "pending_create", "Failed": "error", "Succeeded": "running", "Deleting": "pending_delete"}[.provisioningState]
}'
}]'
}

# Login to Azure
Expand Down
4 changes: 2 additions & 2 deletions contrib/providers.d/openstack/garm-external-provider
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,12 @@ function StopServer() {

function ListInstances() {
INSTANCES=$(openstack server list --os-compute-api-version 2.52 --tags garm-pool-id=${GARM_POOL_ID} --long -f json)
echo ${INSTANCES} | jq -r '
echo ${INSTANCES} | jq -r '[
.[] | .Properties * {
provider_id: .ID,
name: .Name,
status: {"ACTIVE": "running", "SHUTOFF": "stopped", "BUILD": "pending_create", "ERROR": "error", "DELETING": "pending_delete"}[.Status]
}'
}]'
}

function GetInstance() {
Expand Down

0 comments on commit fc1012d

Please sign in to comment.