diff --git a/CHANGELOG.md b/CHANGELOG.md index 86a777164..50044699f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,9 +8,11 @@ ### Bug fixes + - compute: allow instance and instance pool operations to use template IDs omitted from template lists (#888) - compute: honor the selected template's minimum disk size when creating instances and instance pools (#882) - instance create: apply delete protection in the instance's zone, fixing a wrong-zone "Not Found" error when creating protected instances outside the default zone (#879) +- instance show: correctly show multiple ssh keys - sks cluster update: fix oidc config drop (#881) ### ImprovementsāŽ diff --git a/cmd/compute/instance/instance_show.go b/cmd/compute/instance/instance_show.go index b17776577..b5f0340e7 100644 --- a/cmd/compute/instance/instance_show.go +++ b/cmd/compute/instance/instance_show.go @@ -33,7 +33,7 @@ type InstanceShowOutput struct { PublicIPAssignment v3.PublicIPAssignment `json:"public-ip" outputLabel:"Public IP"` IPAddress string `json:"ip_address"` IPv6Address string `json:"ipv6_address" outputLabel:"IPv6 Address"` - SSHKey string `json:"ssh_key"` + SSHKeys []string `json:"ssh_keys"` DiskSize string `json:"disk_size"` State v3.InstanceState `json:"state"` Labels map[string]string `json:"labels"` @@ -115,11 +115,6 @@ func (c *instanceShowCmd) CmdRun(cmd *cobra.Command, _ []string) error { ipV6 = &parsed // only assign pointer if it's a valid IP } - var sshKeyName *string - if instance.SSHKey != nil { - sshKeyName = &instance.SSHKey.Name - } - out := InstanceShowOutput{ AntiAffinityGroups: make([]string, 0), CreationDate: instance.CreatedAT.String(), @@ -137,7 +132,7 @@ func (c *instanceShowCmd) CmdRun(cmd *cobra.Command, _ []string) error { }(), Name: instance.Name, PrivateNetworks: make([]string, 0), - SSHKey: utils.DefaultString(sshKeyName, "-"), + SSHKeys: make([]string, 0), SecurityGroups: make([]string, 0), SecureBoot: *instance.SecurebootEnabled, Tpm: *instance.TpmEnabled, @@ -215,6 +210,10 @@ func (c *instanceShowCmd) CmdRun(cmd *cobra.Command, _ []string) error { } } + for _, k := range instance.SSHKeys { + out.SSHKeys = append(out.SSHKeys, k.Name) + } + if instance.SecurityGroups != nil { for _, sg := range instance.SecurityGroups { resp, err := client.ListSecurityGroups(ctx)