Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
anti-affinity group: fix a bug in the "show" command to list all atta…
…ched instances from different zones (#649) # Description Fix a bug in the "show" command to list all attached instances from different zones, while the user tries to printanti-affinity group, the attached instance list is printed empty. ## Checklist (For exoscale contributors) * [x] Changelog updated (under *Unreleased* block) * [x] Testing ## Testing ### Before the fix ``` PS C:\Users\Administrator\Desktop\Apps\Exoscale\CLI\exo-cli show anti-affinity-group with instances> go run . compute instance create se-test-2 --anti-affinity-group=se-test-1 --zone=de-muc-1 ✔ Creating instance "se-test-2"... 12s ┼──────────────────────┼──────────────────────────────────────┼ │ COMPUTE INSTANCE │ │ ┼──────────────────────┼──────────────────────────────────────┼ │ ID │ 583ee938-e5f8-4142-a3f4-f08dc77ce3a9 │ │ Name │ se-test-2 │ │ Creation Date │ 2024-11-07 17:55:25 +0000 UTC │ │ Instance Type │ standard.medium │ │ Template │ Linux Ubuntu 22.04 LTS 64-bit │ │ Zone │ de-muc-1 │ │ Anti-Affinity Groups │ se-test-1 │ │ Deploy Target │ - │ │ Security Groups │ default │ │ Private Instance │ No │ │ Private Networks │ n/a │ │ Elastic IPs │ n/a │ │ IP Address │ 194.182.180.240 │ │ IPv6 Address │ - │ │ SSH Key │ - │ │ Disk Size │ 50 GiB │ │ State │ running │ │ Labels │ n/a │ │ Reverse DNS │ │ ┼──────────────────────┼──────────────────────────────────────┼ PS C:\Users\Administrator\Desktop\Apps\Exoscale\CLI\exo-cli show anti-affinity-group with instances> go run . compute anti-affinity-group show se-test-1 ┼─────────────┼──────────────────────────────────────┼ │ ID │ a769d132-5baa-4a09-8a12-28437fd3f820 │ │ Name │ se-test-1 │ │ Description │ │ │ Instances │ │ │ │ │ ┼─────────────┼──────────────────────────────────────┼ ``` ### After the fix ``` PS C:\Users\Administrator\Desktop\Apps\Exoscale\CLI\exo-cli show anti-affinity-group with instances> go run . compute instance create se-af-test-3 --anti-affinity-group=se-test-1 -z=at-vie-2 ✔ Creating instance "se-af-test-3"... 9s ┼──────────────────────┼──────────────────────────────────────┼ │ COMPUTE INSTANCE │ │ ┼──────────────────────┼──────────────────────────────────────┼ │ ID │ 371f94ba-1a1d-4fc0-a4be-9c3e60301b2a │ │ Name │ se-af-test-3 │ │ Creation Date │ 2024-11-11 11:08:09 +0000 UTC │ │ Instance Type │ standard.medium │ │ Template │ Linux Ubuntu 22.04 LTS 64-bit │ │ Zone │ at-vie-2 │ │ Anti-Affinity Groups │ se-test-1 │ │ Deploy Target │ - │ │ Security Groups │ default │ │ Private Instance │ No │ │ Private Networks │ n/a │ │ Elastic IPs │ n/a │ │ IP Address │ 138.124.210.60 │ │ IPv6 Address │ - │ │ SSH Key │ - │ │ Disk Size │ 50 GiB │ │ State │ running │ │ Labels │ n/a │ │ Reverse DNS │ │ ┼──────────────────────┼──────────────────────────────────────┼ PS C:\Users\Administrator\Desktop\Apps\Exoscale\CLI\exo-cli show anti-affinity-group with instances> go run . compute anti-affinity-group show se-test-1 ┼─────────────┼──────────────────────────────────────┼ │ ID │ a769d132-5baa-4a09-8a12-28437fd3f820 │ │ Name │ se-test-1 │ │ Description │ │ │ Instances │ 371f94ba-1a1d-4fc0-a4be-9c3e60301b2a │ ┼─────────────┼──────────────────────────────────────┼ PS C:\Users\Administrator\Desktop\Apps\Exoscale\CLI\exo-cli show anti-affinity-group with instances> go run . compute instance create se-af-test-4 --anti-affinity-group=se-test-1 -z=de-muc-1 ✔ Creating instance "se-af-test-4"... 12s ┼──────────────────────┼──────────────────────────────────────┼ │ COMPUTE INSTANCE │ │ ┼──────────────────────┼──────────────────────────────────────┼ │ ID │ fe9ef0e1-3133-48e1-b897-6b49199c2b7e │ │ Name │ se-af-test-4 │ │ Creation Date │ 2024-11-11 11:09:22 +0000 UTC │ │ Instance Type │ standard.medium │ │ Template │ Linux Ubuntu 22.04 LTS 64-bit │ │ Zone │ de-muc-1 │ │ Anti-Affinity Groups │ se-test-1 │ │ Deploy Target │ - │ │ Security Groups │ default │ │ Private Instance │ No │ │ Private Networks │ n/a │ │ Elastic IPs │ n/a │ │ IP Address │ 194.182.181.4 │ │ IPv6 Address │ - │ │ SSH Key │ - │ │ Disk Size │ 50 GiB │ │ State │ running │ │ Labels │ n/a │ │ Reverse DNS │ │ ┼──────────────────────┼──────────────────────────────────────┼ PS C:\Users\Administrator\Desktop\Apps\Exoscale\CLI\exo-cli show anti-affinity-group with instances> go run . compute anti-affinity-group show se-test-1 ┼─────────────┼──────────────────────────────────────┼ │ ID │ a769d132-5baa-4a09-8a12-28437fd3f820 │ │ Name │ se-test-1 │ │ Description │ │ │ Instances │ 371f94ba-1a1d-4fc0-a4be-9c3e60301b2a │ │ │ fe9ef0e1-3133-48e1-b897-6b49199c2b7e │ ┼─────────────┼──────────────────────────────────────┼ PS C:\Users\Administrator\Desktop\Apps\Exoscale\CLI\exo-cli show anti-affinity-group with instances> go run . compute instance delete se-af-test-3 -z=at-vie-2 [+] Are you sure you want to delete instance "se-af-test-3"? [yN]: y ✔ Deleting instance "se-af-test-3"... 6s PS C:\Users\Administrator\Desktop\Apps\Exoscale\CLI\exo-cli show anti-affinity-group with instances> go run . compute instance delete se-af-test-4 -z=de-mus-1 error: switch client zone v3: get zone api endpoint: find zone: "de-mus-1" not found in ListZonesResponse: Not Found exit status 1 PS C:\Users\Administrator\Desktop\Apps\Exoscale\CLI\exo-cli show anti-affinity-group with instances> go run . compute instance delete se-af-test-4 -z=de-muc-1 [+] Are you sure you want to delete instance "se-af-test-4"? [yN]: y ✔ Deleting instance "se-af-test-4"... 12s PS C:\Users\Administrator\Desktop\Apps\Exoscale\CLI\exo-cli show anti-affinity-group with instances> go run . compute anti-affinity-group show se-test-1 ┼─────────────┼──────────────────────────────────────┼ │ ID │ a769d132-5baa-4a09-8a12-28437fd3f820 │ │ Name │ se-test-1 │ │ Description │ │ │ Instances │ n/a │ ┼─────────────┼──────────────────────────────────────┼ ``` --------- Co-authored-by: Philipp Sauter <[email protected]>
- Loading branch information