Skip to content

fix compute instance show: display multiple ssh keys - #900

Merged
aureliar8 merged 3 commits into
masterfrom
aureliar8/fix-instance-show-ssh-key
Aug 19, 2026
Merged

fix compute instance show: display multiple ssh keys#900
aureliar8 merged 3 commits into
masterfrom
aureliar8/fix-instance-show-ssh-key

Conversation

@aureliar8

@aureliar8 aureliar8 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Description

The cli (during compute instance show) was still using the deprecated sshKey fieldas the source of truth while nowadays it's sshKeys (plural) that needs to be used as an instance can have multiple ssh keys

Creation was already working fine

Checklist

(For exoscale contributors)

  • Changelog updated (under Unreleased block, and add the Pull Request #number for each bit you add to the CHANGELOG.md)
  • Testing

Testing

Before

exo c i create test-with-ssh-keys --ssh-key k1 --ssh-key k2 --ssh-key k3
 ✔ Creating instance "test-with-ssh-keys"... 24s
┼─────────────────────────────────────────┼──────────────────────────────────────┼
│            COMPUTE INSTANCE             │                                      │
┼─────────────────────────────────────────┼──────────────────────────────────────┼
│ ID                                      │ ad37e967-765d-4071-b99b-3c256baf5bdd │
│ Name                                    │ test-with-ssh-keys                   │
│ Creation Date                           │ 2026-08-19 07:50:20 +0000 UTC        │
│ Instance Type                           │ standard.medium                      │
│ Template                                │ Linux Ubuntu 24.04 LTS 64-bit        │
│ Zone                                    │ ch-gva-2                             │
│ Anti-Affinity Groups                    │ n/a                                  │
│ Deploy Target                           │ -                                    │
│ Security Groups                         │ default                              │
│ Private Instance                        │ No                                   │
│ Private Networks                        │ n/a                                  │
│ Elastic IPs                             │ n/a                                  │
│ Public IP                               │ inet4                                │
│ IP Address                              │ 151.145.196.141                      │
│ IPv6 Address                            │ -                                    │
│ SSH Key                                 │ k1                                   │
│ Disk Size                               │ 50 GiB                               │
│ State                                   │ running                              │
│ Labels                                  │ n/a                                  │
│ Secure Boot                             │ false                                │
│ Tpm                                     │ false                                │
│ Reverse DNS                             │                                      │
│ Application-Consistent Snapshot enabled │ false                                │
┼─────────────────────────────────────────┼──────────────────────────────────────┼

after

go run . c i show test-with-ssh-keys
┼─────────────────────────────────────────┼──────────────────────────────────────┼
│            COMPUTE INSTANCE             │                                      │
┼─────────────────────────────────────────┼──────────────────────────────────────┼
│ ID                                      │ ad37e967-765d-4071-b99b-3c256baf5bdd │
│ Name                                    │ test-with-ssh-keys                   │
│ Creation Date                           │ 2026-08-19 07:50:20 +0000 UTC        │
│ Instance Type                           │ standard.medium                      │
│ Template                                │ Linux Ubuntu 24.04 LTS 64-bit        │
│ Zone                                    │ ch-gva-2                             │
│ Anti-Affinity Groups                    │ n/a                                  │
│ Deploy Target                           │ -                                    │
│ Security Groups                         │ default                              │
│ Private Instance                        │ No                                   │
│ Private Networks                        │ n/a                                  │
│ Elastic IPs                             │ n/a                                  │
│ Public IP                               │ inet4                                │
│ IP Address                              │ 151.145.196.141                      │
│ IPv6 Address                            │ -                                    │
│ SSH Keys                                │ k1                                   │
│                                         │ k2                                   │
│                                         │ k3                                   │
│ Disk Size                               │ 50 GiB                               │
│ State                                   │ running                              │
│ Labels                                  │ n/a                                  │
│ Secure Boot                             │ false                                │
│ Tpm                                     │ false                                │
│ Reverse DNS                             │                                      │
│ Application-Consistent Snapshot enabled │ false                                │
┼─────────────────────────────────────────┼──────────────────────────────────────┼

}(),
Name: instance.Name,
PrivateNetworks: make([]string, 0),
SSHKey: utils.DefaultString(sshKeyName, "-"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: you can directly allocate InstanceShowOutput.SSHKeys with the size of instance.SSHKeys

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did that for consistency with over zero-initialized arrays in the rest of the codebase

@aureliar8
aureliar8 merged commit 2ce13e5 into master Aug 19, 2026
7 checks passed
@aureliar8
aureliar8 deleted the aureliar8/fix-instance-show-ssh-key branch August 19, 2026 08:34
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