Skip to content

Commit 6633638

Browse files
authored
Merge branch 'scaleway:master' into master
2 parents baaa760 + e48ece1 commit 6633638

File tree

6 files changed

+561
-382
lines changed

6 files changed

+561
-382
lines changed

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.25.0
44

55
require (
66
github.com/aws/aws-sdk-go-v2 v1.39.2
7-
github.com/aws/aws-sdk-go-v2/service/s3 v1.88.3
7+
github.com/aws/aws-sdk-go-v2/service/s3 v1.88.4
88
github.com/buildpacks/pack v0.38.2
99
github.com/c-bata/go-prompt v0.2.6
1010
github.com/charmbracelet/bubbletea v1.3.10
@@ -21,7 +21,7 @@ require (
2121
github.com/karrick/tparse/v2 v2.8.2
2222
github.com/mattn/go-colorable v0.1.14
2323
github.com/mattn/go-isatty v0.0.20
24-
github.com/moby/buildkit v0.25.0
24+
github.com/moby/buildkit v0.25.1
2525
github.com/opencontainers/go-digest v1.0.0
2626
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35.0.20251002202252-ab1363c81acf
2727
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
@@ -65,7 +65,7 @@ require (
6565
github.com/aws/aws-sdk-go-v2/service/ecr v1.50.1 // indirect
6666
github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.37.2 // indirect
6767
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1 // indirect
68-
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.9 // indirect
68+
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.0 // indirect
6969
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.9 // indirect
7070
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.9 // indirect
7171
github.com/aws/aws-sdk-go-v2/service/sso v1.29.1 // indirect

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.37.2 h1:EfatDVSMFxaS5TiR0C0zss
8585
github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.37.2/go.mod h1:oRy1IEgzXtOkEk4B/J7HZbXUC258drDLtkmc++lN7IA=
8686
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1 h1:oegbebPEMA/1Jny7kvwejowCaHz1FWZAQ94WXFNCyTM=
8787
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1/go.mod h1:kemo5Myr9ac0U9JfSjMo9yHLtw+pECEHsFtJ9tqCEI8=
88-
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.9 h1:by3nYZLR9l8bUH7kgaMU4dJgYFjyRdFEfORlDpPILB4=
89-
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.9/go.mod h1:IWjQYlqw4EX9jw2g3qnEPPWvCE6bS8fKzhMed1OK7c8=
88+
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.0 h1:X0FveUndcZ3lKbSpIC6rMYGRiQTcUVRNH6X4yYtIrlU=
89+
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.0/go.mod h1:IWjQYlqw4EX9jw2g3qnEPPWvCE6bS8fKzhMed1OK7c8=
9090
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.9 h1:5r34CgVOD4WZudeEKZ9/iKpiT6cM1JyEROpXjOcdWv8=
9191
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.9/go.mod h1:dB12CEbNWPbzO2uC6QSWHteqOg4JfBVJOojbAoAUb5I=
9292
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.9 h1:wuZ5uW2uhJR63zwNlqWH2W4aL4ZjeJP3o92/W+odDY4=
9393
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.9/go.mod h1:/G58M2fGszCrOzvJUkDdY8O9kycodunH4VdT5oBAqls=
94-
github.com/aws/aws-sdk-go-v2/service/s3 v1.88.3 h1:P18I4ipbk+b/3dZNq5YYh+Hq6XC0vp5RWkLp1tJldDA=
95-
github.com/aws/aws-sdk-go-v2/service/s3 v1.88.3/go.mod h1:Rm3gw2Jov6e6kDuamDvyIlZJDMYk97VeCZ82wz/mVZ0=
94+
github.com/aws/aws-sdk-go-v2/service/s3 v1.88.4 h1:mUI3b885qJgfqKDUSj6RgbRqLdX0wGmg8ruM03zNfQA=
95+
github.com/aws/aws-sdk-go-v2/service/s3 v1.88.4/go.mod h1:6v8ukAxc7z4x4oBjGUsLnH7KGLY9Uhcgij19UJNkiMg=
9696
github.com/aws/aws-sdk-go-v2/service/sso v1.29.1 h1:8OLZnVJPvjnrxEwHFg9hVUof/P4sibH+Ea4KKuqAGSg=
9797
github.com/aws/aws-sdk-go-v2/service/sso v1.29.1/go.mod h1:27M3BpVi0C02UiQh1w9nsBEit6pLhlaH3NHna6WUbDE=
9898
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.34.2 h1:gKWSTnqudpo8dAxqBqZnDoDWCiEh/40FziUjr/mo6uA=
@@ -364,8 +364,8 @@ github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG
364364
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
365365
github.com/mitchellh/ioprogress v0.0.0-20180201004757-6a23b12fa88e h1:Qa6dnn8DlasdXRnacluu8HzPts0S1I9zvvUPDbBnXFI=
366366
github.com/mitchellh/ioprogress v0.0.0-20180201004757-6a23b12fa88e/go.mod h1:waEya8ee1Ro/lgxpVhkJI4BVASzkm3UZqkx/cFJiYHM=
367-
github.com/moby/buildkit v0.25.0 h1:cRgh74ymzyHxS5a/lsYT4OCyVU8iC3UgkwasIEUi0og=
368-
github.com/moby/buildkit v0.25.0/go.mod h1:phM8sdqnvgK2y1dPDnbwI6veUCXHOZ6KFSl6E164tkc=
367+
github.com/moby/buildkit v0.25.1 h1:j7IlVkeNbEo+ZLoxdudYCHpmTsbwKvhgc/6UJ/mY/o8=
368+
github.com/moby/buildkit v0.25.1/go.mod h1:phM8sdqnvgK2y1dPDnbwI6veUCXHOZ6KFSl6E164tkc=
369369
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
370370
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
371371
github.com/moby/go-archive v0.1.0 h1:Kk/5rdW/g+H8NHdJW2gsXyZ7UnzvJNOy6VKJqueWdcQ=

internal/namespaces/instance/v1/custom_server.go

Lines changed: 66 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -380,13 +380,71 @@ func serverUpdateBuilder(c *core.Command) *core.Command {
380380
return c
381381
}
382382

383-
func volumeIsFromSBS(api *block.API, zone scw.Zone, volumeID string) bool {
384-
_, err := api.GetVolume(&block.GetVolumeRequest{
385-
Zone: zone,
386-
VolumeID: volumeID,
387-
})
383+
// customServer is a copy of instance.Server without the fields that are deprecated or duplicated in another section.
384+
// It is used by the `instance server get` command.
385+
type customServer struct {
386+
ID string `json:"id"`
387+
Name string `json:"name"`
388+
Organization string `json:"organization"`
389+
Project string `json:"project"`
390+
AllowedActions []instance.ServerAction `json:"allowed_actions"`
391+
Tags []string `json:"tags"`
392+
CommercialType string `json:"commercial_type"`
393+
CreationDate *time.Time `json:"creation_date"`
394+
DynamicIPRequired bool `json:"dynamic_ip_required"`
395+
RoutedIPEnabled *bool `json:"routed_ip_enabled"`
396+
Hostname string `json:"hostname"`
397+
Image *instance.Image `json:"image"`
398+
Protected bool `json:"protected"`
399+
PrivateIP *string `json:"private_ip"`
400+
PublicIPs []*instance.ServerIP `json:"public_ips"`
401+
MacAddress string `json:"mac_address"`
402+
ModificationDate *time.Time `json:"modification_date"`
403+
State instance.ServerState `json:"state"`
404+
StateDetail string `json:"state_detail"`
405+
IPv6 *instance.ServerIPv6 `json:"ipv6"`
406+
BootType instance.BootType `json:"boot_type"`
407+
SecurityGroup *instance.SecurityGroupSummary `json:"security_group"`
408+
Arch instance.Arch `json:"arch"`
409+
PlacementGroup *instance.PlacementGroup `json:"placement_group"`
410+
Zone scw.Zone `json:"zone"`
411+
AdminPasswordEncryptionSSHKeyID *string `json:"admin_password_encryption_ssh_key_id"`
412+
AdminPasswordEncryptedValue *string `json:"admin_password_encrypted_value"`
413+
Filesystems []*instance.ServerFilesystem `json:"filesystems"`
414+
EndOfService bool `json:"end_of_service"`
415+
}
388416

389-
return err == nil
417+
func customServerFromInstanceServer(server *instance.Server) *customServer {
418+
return &customServer{
419+
ID: server.ID,
420+
Name: server.Name,
421+
Organization: server.Organization,
422+
Project: server.Project,
423+
AllowedActions: server.AllowedActions,
424+
Tags: server.Tags,
425+
CommercialType: server.CommercialType,
426+
CreationDate: server.CreationDate,
427+
DynamicIPRequired: server.DynamicIPRequired,
428+
RoutedIPEnabled: server.RoutedIPEnabled,
429+
Hostname: server.Hostname,
430+
Image: server.Image,
431+
Protected: server.Protected,
432+
PrivateIP: server.PrivateIP,
433+
PublicIPs: server.PublicIPs,
434+
MacAddress: server.MacAddress,
435+
ModificationDate: server.ModificationDate,
436+
State: server.State,
437+
StateDetail: server.StateDetail,
438+
BootType: server.BootType,
439+
SecurityGroup: server.SecurityGroup,
440+
Arch: server.Arch,
441+
PlacementGroup: server.PlacementGroup,
442+
Zone: server.Zone,
443+
AdminPasswordEncryptionSSHKeyID: server.AdminPasswordEncryptionSSHKeyID,
444+
AdminPasswordEncryptedValue: server.AdminPasswordEncryptedValue,
445+
Filesystems: server.Filesystems,
446+
EndOfService: server.EndOfService,
447+
}
390448
}
391449

392450
func serverGetBuilder(c *core.Command) *core.Command {
@@ -506,12 +564,12 @@ func serverGetBuilder(c *core.Command) *core.Command {
506564
}
507565

508566
return &struct {
509-
*instance.Server
567+
*customServer
510568
Volumes []*customVolume
511569
PrivateNics []customNICs `json:"private_nics"`
512570
Warnings []string `json:"warnings"`
513571
}{
514-
server,
572+
customServerFromInstanceServer(server),
515573
orderVolumes(volumes),
516574
nics,
517575
warnings,
@@ -536,10 +594,6 @@ func serverGetBuilder(c *core.Command) *core.Command {
536594
Title: "Public IPs",
537595
FieldName: "PublicIPs",
538596
},
539-
{
540-
Title: "IPv6",
541-
FieldName: "IPv6",
542-
},
543597
{
544598
FieldName: "PrivateNics",
545599
Title: "Private NICs",

internal/namespaces/instance/v1/helpers_types.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/fatih/color"
1010
"github.com/scaleway/scaleway-cli/v2/core"
1111
"github.com/scaleway/scaleway-cli/v2/internal/terminal"
12+
block "github.com/scaleway/scaleway-sdk-go/api/block/v1alpha1"
1213
"github.com/scaleway/scaleway-sdk-go/api/instance/v1"
1314
product_catalog "github.com/scaleway/scaleway-sdk-go/api/product_catalog/v2alpha1"
1415
"github.com/scaleway/scaleway-sdk-go/scw"
@@ -51,6 +52,15 @@ func SizeValue(s *scw.Size) scw.Size {
5152
return 0
5253
}
5354

55+
func volumeIsFromSBS(api *block.API, zone scw.Zone, volumeID string) bool {
56+
_, err := api.GetVolume(&block.GetVolumeRequest{
57+
Zone: zone,
58+
VolumeID: volumeID,
59+
})
60+
61+
return err == nil
62+
}
63+
5464
func warningServerTypeDeprecated(
5565
ctx context.Context,
5666
client *scw.Client,

0 commit comments

Comments
 (0)