Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

anti-affinity group: fix a bug in the "show" command to list all attached instances from different zones #649

Conversation

elkezza
Copy link
Contributor

@elkezza elkezza commented Nov 11, 2024

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)

  • Changelog updated (under Unreleased block)
  • 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                                  │
┼─────────────┼──────────────────────────────────────┼

@elkezza elkezza requested review from kobajagi and a team November 11, 2024 12:10
@elkezza elkezza merged commit 26d4184 into master Nov 11, 2024
2 checks passed
@elkezza elkezza deleted the salehelkaza/sc-108576/exo-cli-show-anti-affinity-group-with-instances branch November 11, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants