diff --git a/go.mod b/go.mod index 7dc7283..233c0b3 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/dirien/devpod-provider-scaleway -go 1.23.0 +go 1.24.0 toolchain go1.24.1 @@ -8,7 +8,7 @@ require ( github.com/loft-sh/devpod v0.6.15 github.com/loft-sh/log v0.0.0-20240219160058-26d83ffb46ac github.com/pkg/errors v0.9.1 - github.com/scaleway/scaleway-sdk-go v1.0.0-beta.34 + github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36 github.com/spf13/cobra v1.9.1 golang.org/x/crypto v0.38.0 ) @@ -41,10 +41,10 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/spf13/pflag v1.0.6 // indirect github.com/tidwall/jsonc v0.3.2 // indirect - golang.org/x/sync v0.15.0 // indirect + golang.org/x/sync v0.19.0 // indirect golang.org/x/sys v0.33.0 // indirect golang.org/x/term v0.32.0 // indirect - golang.org/x/text v0.26.0 // indirect + golang.org/x/text v0.32.0 // indirect google.golang.org/protobuf v1.35.1 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect diff --git a/go.sum b/go.sum index 9a93974..9d79348 100644 --- a/go.sum +++ b/go.sum @@ -22,8 +22,6 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= -github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/docker v27.4.0-rc.2+incompatible h1:9OJjVGtelk/zGC3TyKweJ29b9Axzh0s/0vtU4mneumE= github.com/docker/docker v27.4.0-rc.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= @@ -85,8 +83,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.34 h1:48+VFHsyVcAHIN2v1Ao9v1/RkjJS5AwctFucBrfYNIA= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.34/go.mod h1:zFWiHphneiey3s8HOtAEnGrRlWivNaxW5T6d5Xfco7g= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36 h1:ObX9hZmK+VmijreZO/8x9pQ8/P/ToHD/bdSb4Eg4tUo= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36/go.mod h1:LEsDu4BubxK7/cWhtlQWfuxwL4rf/2UEpxXz1o1EMtM= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= @@ -103,6 +101,8 @@ github.com/tidwall/jsonc v0.3.2/go.mod h1:dw+3CIxqHi+t8eFSpzzMlcVYxKp08UP5CD8/uS github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +go.yaml.in/yaml/v4 v4.0.0-rc.3 h1:3h1fjsh1CTAPjW7q/EMe+C8shx5d8ctzZTrLcs/j8Go= +go.yaml.in/yaml/v4 v4.0.0-rc.3/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -122,8 +122,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8= -golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= +golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -146,8 +146,8 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= -golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= +golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU= +golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -162,6 +162,8 @@ google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojt gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/dnaeon/go-vcr.v4 v4.0.6 h1:PiJkrakkmzc5s7EfBnZOnyiLwi7o7A9fwPzN0X2uwe0= +gopkg.in/dnaeon/go-vcr.v4 v4.0.6/go.mod h1:sbq5oMEcM4PXngbcNbHhzfCP9OdZodLhrbRYoyg09HY= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/api/account/v3/account_sdk.go b/vendor/github.com/scaleway/scaleway-sdk-go/api/account/v3/account_sdk.go index afc5e48..cb35d84 100644 --- a/vendor/github.com/scaleway/scaleway-sdk-go/api/account/v3/account_sdk.go +++ b/vendor/github.com/scaleway/scaleway-sdk-go/api/account/v3/account_sdk.go @@ -55,6 +55,8 @@ const ( ContractTypeContainer = ContractType("container") // A contract specific to Baremetal products. ContractTypeBaremetal = ContractType("baremetal") + // A contract specific to Network products. + ContractTypeNetwork = ContractType("network") ) func (enum ContractType) String() string { @@ -73,6 +75,7 @@ func (enum ContractType) Values() []ContractType { "instance", "container", "baremetal", + "network", } } diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/api/block/v1alpha1/block_sdk.go b/vendor/github.com/scaleway/scaleway-sdk-go/api/block/v1alpha1/block_sdk.go index a2691ae..4463de8 100644 --- a/vendor/github.com/scaleway/scaleway-sdk-go/api/block/v1alpha1/block_sdk.go +++ b/vendor/github.com/scaleway/scaleway-sdk-go/api/block/v1alpha1/block_sdk.go @@ -742,7 +742,7 @@ type ListSnapshotsResponse struct { // Snapshots: paginated returned list of snapshots. Snapshots []*Snapshot `json:"snapshots"` - // TotalCount: total number of snpashots in the project. + // TotalCount: total number of snapshots in the project. TotalCount uint64 `json:"total_count"` } diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/instance_metadata_sdk.go b/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/instance_metadata_sdk.go index 9d6da40..9297865 100644 --- a/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/instance_metadata_sdk.go +++ b/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/instance_metadata_sdk.go @@ -96,6 +96,7 @@ type Metadata struct { Organization string `json:"organization,omitempty"` Project string `json:"project,omitempty"` CommercialType string `json:"commercial_type,omitempty"` + Image Image `json:"image,omitempty"` // PublicIP IPv4 only PublicIP struct { ID string `json:"id"` @@ -170,6 +171,36 @@ type Metadata struct { CreationDate string `json:"creation_date,omitempty"` Zone string `json:"zone,omitempty"` } `json:"private_nics,omitempty"` + MACAddress string `json:"mac_address,omitempty"` + EndOfService bool `json:"end_of_service,omitempty"` + Protected bool `json:"protected,omitempty"` + SecurityGroup struct { + ID string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + } `json:"security_group,omitempty"` + State string `json:"state,omitempty"` + Arch string `json:"arch,omitempty"` + AllowedActions []string `json:"allowed_actions,omitempty"` + FileSystems []struct { + FileSystemID string `json:"filesystem_id,omitempty"` + State string `json:"state,omitempty"` + } + CreatedAt string `json:"creation_date,omitempty"` + UpdatedAt string `json:"modification_date,omitempty"` + Zone string `json:"zone,omitempty"` + EnableIPv6 bool `json:"enable_ipv6,omitempty"` + DynamicIPRequired bool `json:"dynamic_ip_required,omitempty"` + PlacementGroup struct { + ID string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Organization string `json:"organization,omitempty"` + Project string `json:"project,omitempty"` + PolicyMode string `json:"policy_mode,omitempty"` + PolicyType string `json:"policy_type,omitempty"` + PolicyRespected bool `json:"policy_respected,omitempty"` + Tags []string `json:"tags,omitempty"` + Zone string `json:"zone,omitempty"` + } `json:"placement_group,omitempty"` } // ListUserData returns the metadata available from the server diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/instance_sdk.go b/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/instance_sdk.go index aba7a54..0082c4c 100644 --- a/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/instance_sdk.go +++ b/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/instance_sdk.go @@ -85,8 +85,9 @@ type AttachServerVolumeRequestVolumeType string const ( AttachServerVolumeRequestVolumeTypeUnknownVolumeType = AttachServerVolumeRequestVolumeType("unknown_volume_type") AttachServerVolumeRequestVolumeTypeLSSD = AttachServerVolumeRequestVolumeType("l_ssd") - AttachServerVolumeRequestVolumeTypeBSSD = AttachServerVolumeRequestVolumeType("b_ssd") - AttachServerVolumeRequestVolumeTypeSbsVolume = AttachServerVolumeRequestVolumeType("sbs_volume") + // Deprecated. + AttachServerVolumeRequestVolumeTypeBSSD = AttachServerVolumeRequestVolumeType("b_ssd") + AttachServerVolumeRequestVolumeTypeSbsVolume = AttachServerVolumeRequestVolumeType("sbs_volume") ) func (enum AttachServerVolumeRequestVolumeType) String() string { @@ -975,8 +976,10 @@ type SnapshotVolumeType string const ( SnapshotVolumeTypeUnknownVolumeType = SnapshotVolumeType("unknown_volume_type") SnapshotVolumeTypeLSSD = SnapshotVolumeType("l_ssd") - SnapshotVolumeTypeBSSD = SnapshotVolumeType("b_ssd") - SnapshotVolumeTypeUnified = SnapshotVolumeType("unified") + // Deprecated. + SnapshotVolumeTypeBSSD = SnapshotVolumeType("b_ssd") + // Deprecated. + SnapshotVolumeTypeUnified = SnapshotVolumeType("unified") ) func (enum SnapshotVolumeType) String() string { @@ -1059,10 +1062,11 @@ type VolumeServerState string const ( VolumeServerStateAvailable = VolumeServerState("available") VolumeServerStateSnapshotting = VolumeServerState("snapshotting") - VolumeServerStateFetching = VolumeServerState("fetching") VolumeServerStateResizing = VolumeServerState("resizing") + VolumeServerStateFetching = VolumeServerState("fetching") VolumeServerStateSaving = VolumeServerState("saving") VolumeServerStateHotsyncing = VolumeServerState("hotsyncing") + VolumeServerStateAttaching = VolumeServerState("attaching") VolumeServerStateError = VolumeServerState("error") ) @@ -1078,10 +1082,11 @@ func (enum VolumeServerState) Values() []VolumeServerState { return []VolumeServerState{ "available", "snapshotting", - "fetching", "resizing", + "fetching", "saving", "hotsyncing", + "attaching", "error", } } @@ -1104,7 +1109,8 @@ func (enum *VolumeServerState) UnmarshalJSON(data []byte) error { type VolumeServerVolumeType string const ( - VolumeServerVolumeTypeLSSD = VolumeServerVolumeType("l_ssd") + VolumeServerVolumeTypeLSSD = VolumeServerVolumeType("l_ssd") + // Deprecated. VolumeServerVolumeTypeBSSD = VolumeServerVolumeType("b_ssd") VolumeServerVolumeTypeSbsVolume = VolumeServerVolumeType("sbs_volume") VolumeServerVolumeTypeScratch = VolumeServerVolumeType("scratch") @@ -1148,8 +1154,9 @@ const ( VolumeStateAvailable = VolumeState("available") VolumeStateSnapshotting = VolumeState("snapshotting") VolumeStateFetching = VolumeState("fetching") - VolumeStateResizing = VolumeState("resizing") VolumeStateSaving = VolumeState("saving") + VolumeStateAttaching = VolumeState("attaching") + VolumeStateResizing = VolumeState("resizing") VolumeStateHotsyncing = VolumeState("hotsyncing") VolumeStateError = VolumeState("error") ) @@ -1167,8 +1174,9 @@ func (enum VolumeState) Values() []VolumeState { "available", "snapshotting", "fetching", - "resizing", "saving", + "attaching", + "resizing", "hotsyncing", "error", } @@ -1192,8 +1200,10 @@ func (enum *VolumeState) UnmarshalJSON(data []byte) error { type VolumeVolumeType string const ( - VolumeVolumeTypeLSSD = VolumeVolumeType("l_ssd") - VolumeVolumeTypeBSSD = VolumeVolumeType("b_ssd") + VolumeVolumeTypeLSSD = VolumeVolumeType("l_ssd") + // Deprecated. + VolumeVolumeTypeBSSD = VolumeVolumeType("b_ssd") + // Deprecated. VolumeVolumeTypeUnified = VolumeVolumeType("unified") VolumeVolumeTypeScratch = VolumeVolumeType("scratch") VolumeVolumeTypeSbsVolume = VolumeVolumeType("sbs_volume") @@ -1278,9 +1288,6 @@ type Volume struct { // Name: volume name. Name string `json:"name"` - // Deprecated: ExportURI: show the volume NBD export URI. - ExportURI *string `json:"export_uri"` - // Size: volume disk size. Size scw.Size `json:"size"` @@ -1434,6 +1441,12 @@ type PrivateNIC struct { // Tags: private NIC tags. Tags []string `json:"tags"` + + // CreationDate: private NIC creation date. + CreationDate *time.Time `json:"creation_date"` + + // Zone: the zone in which the Private NIC is located. + Zone scw.Zone `json:"zone"` } // SecurityGroupSummary: security group summary. @@ -2424,7 +2437,7 @@ type CreateServerRequest struct { // Name: instance name. Name string `json:"name,omitempty"` - // DynamicIPRequired: define if a dynamic IPv4 is required for the Instance. + // DynamicIPRequired: by default, `dynamic_ip_required` is true, a dynamic ip is attached to the instance (if no flexible ip is already attached). DynamicIPRequired *bool `json:"dynamic_ip_required,omitempty"` // Deprecated: RoutedIPEnabled: if true, configure the Instance so it uses the new routed IP mode. @@ -3560,6 +3573,15 @@ type PlanBlockMigrationRequest struct { SnapshotID *string `json:"snapshot_id,omitempty"` } +// ReleaseIPToIpamRequest: release ip to ipam request. +type ReleaseIPToIpamRequest struct { + // Zone: zone to target. If none is passed will use default zone from the config. + Zone scw.Zone `json:"-"` + + // IPID: ID of the IP you want to release from the Instance but retain in IPAM. + IPID string `json:"-"` +} + // ServerActionRequest: server action request. type ServerActionRequest struct { // Zone: zone to target. If none is passed will use default zone from the config. @@ -4771,7 +4793,7 @@ func (s *API) GetServerCompatibleTypes(req *GetServerCompatibleTypesRequest, opt return &resp, nil } -// AttachServerVolume: +// AttachServerVolume: Attach a volume to an Instance. func (s *API) AttachServerVolume(req *AttachServerVolumeRequest, opts ...scw.RequestOption) (*AttachServerVolumeResponse, error) { var err error @@ -4807,7 +4829,7 @@ func (s *API) AttachServerVolume(req *AttachServerVolumeRequest, opts ...scw.Req return &resp, nil } -// DetachServerVolume: +// DetachServerVolume: Detach a volume from an Instance. func (s *API) DetachServerVolume(req *DetachServerVolumeRequest, opts ...scw.RequestOption) (*DetachServerVolumeResponse, error) { var err error @@ -4879,7 +4901,7 @@ func (s *API) AttachServerFileSystem(req *AttachServerFileSystemRequest, opts .. return &resp, nil } -// DetachServerFileSystem: Detach a filesystem volume to an Instance. +// DetachServerFileSystem: Detach a filesystem volume from an Instance. func (s *API) DetachServerFileSystem(req *DetachServerFileSystemRequest, opts ...scw.RequestOption) (*DetachServerFileSystemResponse, error) { var err error @@ -6914,3 +6936,37 @@ func (s *API) CheckBlockMigrationOrganizationQuotas(req *CheckBlockMigrationOrga } return nil } + +// ReleaseIPToIpam: **The IP remains available in IPAM**, which means that it is still reserved by the Organization, and can be reattached to another resource (Instance or other product). +func (s *API) ReleaseIPToIpam(req *ReleaseIPToIpamRequest, opts ...scw.RequestOption) error { + var err error + + if req.Zone == "" { + defaultZone, _ := s.client.GetDefaultZone() + req.Zone = defaultZone + } + + if fmt.Sprint(req.Zone) == "" { + return errors.New("field Zone cannot be empty in request") + } + + if fmt.Sprint(req.IPID) == "" { + return errors.New("field IPID cannot be empty in request") + } + + scwReq := &scw.ScalewayRequest{ + Method: "POST", + Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/ips/" + fmt.Sprint(req.IPID) + "/release-to-ipam", + } + + err = scwReq.SetBody(req) + if err != nil { + return err + } + + err = s.client.Do(scwReq, nil, opts...) + if err != nil { + return err + } + return nil +} diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/api/marketplace/v2/marketplace_sdk.go b/vendor/github.com/scaleway/scaleway-sdk-go/api/marketplace/v2/marketplace_sdk.go index 5f0fb65..465a869 100644 --- a/vendor/github.com/scaleway/scaleway-sdk-go/api/marketplace/v2/marketplace_sdk.go +++ b/vendor/github.com/scaleway/scaleway-sdk-go/api/marketplace/v2/marketplace_sdk.go @@ -401,6 +401,9 @@ type ListLocalImagesRequest struct { // Zone: filter local images available on this Availability Zone. Zone *scw.Zone `json:"-"` + // Arch: filter local images available for this machine architecture. + Arch *string `json:"-"` + // ImageID: filter by image id. // Precisely one of ImageID, VersionID, ImageLabel must be set. ImageID *string `json:"image_id,omitempty"` @@ -619,6 +622,7 @@ func (s *API) ListLocalImages(req *ListLocalImagesRequest, opts ...scw.RequestOp parameter.AddToQuery(query, "page", req.Page) parameter.AddToQuery(query, "order_by", req.OrderBy) parameter.AddToQuery(query, "zone", req.Zone) + parameter.AddToQuery(query, "arch", req.Arch) parameter.AddToQuery(query, "type", req.Type) parameter.AddToQuery(query, "image_id", req.ImageID) parameter.AddToQuery(query, "version_id", req.VersionID) diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/api/std/std_sdk.go b/vendor/github.com/scaleway/scaleway-sdk-go/api/std/std_sdk.go index 0584f7a..3cec3ea 100644 --- a/vendor/github.com/scaleway/scaleway-sdk-go/api/std/std_sdk.go +++ b/vendor/github.com/scaleway/scaleway-sdk-go/api/std/std_sdk.go @@ -38,6 +38,539 @@ var ( _ = namegenerator.GetRandomName ) +type CountryCode string + +const ( + CountryCodeUnknownCountryCode = CountryCode("unknown_country_code") + CountryCodeAF = CountryCode("AF") + CountryCodeAX = CountryCode("AX") + CountryCodeAL = CountryCode("AL") + CountryCodeDZ = CountryCode("DZ") + CountryCodeAS = CountryCode("AS") + CountryCodeAD = CountryCode("AD") + CountryCodeAO = CountryCode("AO") + CountryCodeAI = CountryCode("AI") + CountryCodeAQ = CountryCode("AQ") + CountryCodeAG = CountryCode("AG") + CountryCodeAR = CountryCode("AR") + CountryCodeAM = CountryCode("AM") + CountryCodeAW = CountryCode("AW") + CountryCodeAU = CountryCode("AU") + CountryCodeAT = CountryCode("AT") + CountryCodeAZ = CountryCode("AZ") + CountryCodeBS = CountryCode("BS") + CountryCodeBH = CountryCode("BH") + CountryCodeBD = CountryCode("BD") + CountryCodeBB = CountryCode("BB") + CountryCodeBY = CountryCode("BY") + CountryCodeBE = CountryCode("BE") + CountryCodeBZ = CountryCode("BZ") + CountryCodeBJ = CountryCode("BJ") + CountryCodeBM = CountryCode("BM") + CountryCodeBT = CountryCode("BT") + CountryCodeBO = CountryCode("BO") + CountryCodeBQ = CountryCode("BQ") + CountryCodeBA = CountryCode("BA") + CountryCodeBW = CountryCode("BW") + CountryCodeBV = CountryCode("BV") + CountryCodeBR = CountryCode("BR") + CountryCodeIO = CountryCode("IO") + CountryCodeBN = CountryCode("BN") + CountryCodeBG = CountryCode("BG") + CountryCodeBF = CountryCode("BF") + CountryCodeBI = CountryCode("BI") + CountryCodeKH = CountryCode("KH") + CountryCodeCM = CountryCode("CM") + CountryCodeCA = CountryCode("CA") + CountryCodeCV = CountryCode("CV") + CountryCodeKY = CountryCode("KY") + CountryCodeCF = CountryCode("CF") + CountryCodeTD = CountryCode("TD") + CountryCodeCL = CountryCode("CL") + CountryCodeCN = CountryCode("CN") + CountryCodeCX = CountryCode("CX") + CountryCodeCC = CountryCode("CC") + CountryCodeCO = CountryCode("CO") + CountryCodeKM = CountryCode("KM") + CountryCodeCG = CountryCode("CG") + CountryCodeCD = CountryCode("CD") + CountryCodeCK = CountryCode("CK") + CountryCodeCR = CountryCode("CR") + CountryCodeCI = CountryCode("CI") + CountryCodeHR = CountryCode("HR") + CountryCodeCU = CountryCode("CU") + CountryCodeCW = CountryCode("CW") + CountryCodeCY = CountryCode("CY") + CountryCodeCZ = CountryCode("CZ") + CountryCodeDK = CountryCode("DK") + CountryCodeDJ = CountryCode("DJ") + CountryCodeDM = CountryCode("DM") + CountryCodeDO = CountryCode("DO") + CountryCodeEC = CountryCode("EC") + CountryCodeEG = CountryCode("EG") + CountryCodeSV = CountryCode("SV") + CountryCodeGQ = CountryCode("GQ") + CountryCodeER = CountryCode("ER") + CountryCodeEE = CountryCode("EE") + CountryCodeET = CountryCode("ET") + CountryCodeFK = CountryCode("FK") + CountryCodeFO = CountryCode("FO") + CountryCodeFJ = CountryCode("FJ") + CountryCodeFI = CountryCode("FI") + CountryCodeFR = CountryCode("FR") + CountryCodeGF = CountryCode("GF") + CountryCodePF = CountryCode("PF") + CountryCodeTF = CountryCode("TF") + CountryCodeGA = CountryCode("GA") + CountryCodeGM = CountryCode("GM") + CountryCodeGE = CountryCode("GE") + CountryCodeDE = CountryCode("DE") + CountryCodeGH = CountryCode("GH") + CountryCodeGI = CountryCode("GI") + CountryCodeGR = CountryCode("GR") + CountryCodeGL = CountryCode("GL") + CountryCodeGD = CountryCode("GD") + CountryCodeGP = CountryCode("GP") + CountryCodeGU = CountryCode("GU") + CountryCodeGT = CountryCode("GT") + CountryCodeGG = CountryCode("GG") + CountryCodeGN = CountryCode("GN") + CountryCodeGW = CountryCode("GW") + CountryCodeGY = CountryCode("GY") + CountryCodeHT = CountryCode("HT") + CountryCodeHM = CountryCode("HM") + CountryCodeVA = CountryCode("VA") + CountryCodeHN = CountryCode("HN") + CountryCodeHK = CountryCode("HK") + CountryCodeHU = CountryCode("HU") + CountryCodeIS = CountryCode("IS") + CountryCodeIN = CountryCode("IN") + CountryCodeID = CountryCode("ID") + CountryCodeIR = CountryCode("IR") + CountryCodeIQ = CountryCode("IQ") + CountryCodeIE = CountryCode("IE") + CountryCodeIM = CountryCode("IM") + CountryCodeIL = CountryCode("IL") + CountryCodeIT = CountryCode("IT") + CountryCodeJM = CountryCode("JM") + CountryCodeJP = CountryCode("JP") + CountryCodeJE = CountryCode("JE") + CountryCodeJO = CountryCode("JO") + CountryCodeKZ = CountryCode("KZ") + CountryCodeKE = CountryCode("KE") + CountryCodeKI = CountryCode("KI") + CountryCodeKP = CountryCode("KP") + CountryCodeKR = CountryCode("KR") + CountryCodeKW = CountryCode("KW") + CountryCodeKG = CountryCode("KG") + CountryCodeLA = CountryCode("LA") + CountryCodeLV = CountryCode("LV") + CountryCodeLB = CountryCode("LB") + CountryCodeLS = CountryCode("LS") + CountryCodeLR = CountryCode("LR") + CountryCodeLY = CountryCode("LY") + CountryCodeLI = CountryCode("LI") + CountryCodeLT = CountryCode("LT") + CountryCodeLU = CountryCode("LU") + CountryCodeMO = CountryCode("MO") + CountryCodeMK = CountryCode("MK") + CountryCodeMG = CountryCode("MG") + CountryCodeMW = CountryCode("MW") + CountryCodeMY = CountryCode("MY") + CountryCodeMV = CountryCode("MV") + CountryCodeML = CountryCode("ML") + CountryCodeMT = CountryCode("MT") + CountryCodeMH = CountryCode("MH") + CountryCodeMQ = CountryCode("MQ") + CountryCodeMR = CountryCode("MR") + CountryCodeMU = CountryCode("MU") + CountryCodeYT = CountryCode("YT") + CountryCodeMX = CountryCode("MX") + CountryCodeFM = CountryCode("FM") + CountryCodeMD = CountryCode("MD") + CountryCodeMC = CountryCode("MC") + CountryCodeMN = CountryCode("MN") + CountryCodeME = CountryCode("ME") + CountryCodeMS = CountryCode("MS") + CountryCodeMA = CountryCode("MA") + CountryCodeMZ = CountryCode("MZ") + CountryCodeMM = CountryCode("MM") + CountryCodeNA = CountryCode("NA") + CountryCodeNR = CountryCode("NR") + CountryCodeNP = CountryCode("NP") + CountryCodeNL = CountryCode("NL") + CountryCodeNC = CountryCode("NC") + CountryCodeNZ = CountryCode("NZ") + CountryCodeNI = CountryCode("NI") + CountryCodeNE = CountryCode("NE") + CountryCodeNG = CountryCode("NG") + CountryCodeNU = CountryCode("NU") + CountryCodeNF = CountryCode("NF") + CountryCodeMP = CountryCode("MP") + CountryCodeNO = CountryCode("NO") + CountryCodeOM = CountryCode("OM") + CountryCodePK = CountryCode("PK") + CountryCodePW = CountryCode("PW") + CountryCodePS = CountryCode("PS") + CountryCodePA = CountryCode("PA") + CountryCodePG = CountryCode("PG") + CountryCodePY = CountryCode("PY") + CountryCodePE = CountryCode("PE") + CountryCodePH = CountryCode("PH") + CountryCodePN = CountryCode("PN") + CountryCodePL = CountryCode("PL") + CountryCodePT = CountryCode("PT") + CountryCodePR = CountryCode("PR") + CountryCodeQA = CountryCode("QA") + CountryCodeRE = CountryCode("RE") + CountryCodeRO = CountryCode("RO") + CountryCodeRU = CountryCode("RU") + CountryCodeRW = CountryCode("RW") + CountryCodeBL = CountryCode("BL") + CountryCodeSH = CountryCode("SH") + CountryCodeKN = CountryCode("KN") + CountryCodeLC = CountryCode("LC") + CountryCodeMF = CountryCode("MF") + CountryCodePM = CountryCode("PM") + CountryCodeVC = CountryCode("VC") + CountryCodeWS = CountryCode("WS") + CountryCodeSM = CountryCode("SM") + CountryCodeST = CountryCode("ST") + CountryCodeSA = CountryCode("SA") + CountryCodeSN = CountryCode("SN") + CountryCodeRS = CountryCode("RS") + CountryCodeSC = CountryCode("SC") + CountryCodeSL = CountryCode("SL") + CountryCodeSG = CountryCode("SG") + CountryCodeSX = CountryCode("SX") + CountryCodeSK = CountryCode("SK") + CountryCodeSI = CountryCode("SI") + CountryCodeSB = CountryCode("SB") + CountryCodeSO = CountryCode("SO") + CountryCodeZA = CountryCode("ZA") + CountryCodeGS = CountryCode("GS") + CountryCodeSS = CountryCode("SS") + CountryCodeES = CountryCode("ES") + CountryCodeLK = CountryCode("LK") + CountryCodeSD = CountryCode("SD") + CountryCodeSR = CountryCode("SR") + CountryCodeSJ = CountryCode("SJ") + CountryCodeSZ = CountryCode("SZ") + CountryCodeSE = CountryCode("SE") + CountryCodeCH = CountryCode("CH") + CountryCodeSY = CountryCode("SY") + CountryCodeTW = CountryCode("TW") + CountryCodeTJ = CountryCode("TJ") + CountryCodeTZ = CountryCode("TZ") + CountryCodeTH = CountryCode("TH") + CountryCodeTL = CountryCode("TL") + CountryCodeTG = CountryCode("TG") + CountryCodeTK = CountryCode("TK") + CountryCodeTO = CountryCode("TO") + CountryCodeTT = CountryCode("TT") + CountryCodeTN = CountryCode("TN") + CountryCodeTR = CountryCode("TR") + CountryCodeTM = CountryCode("TM") + CountryCodeTC = CountryCode("TC") + CountryCodeTV = CountryCode("TV") + CountryCodeUG = CountryCode("UG") + CountryCodeUA = CountryCode("UA") + CountryCodeAE = CountryCode("AE") + CountryCodeGB = CountryCode("GB") + CountryCodeUS = CountryCode("US") + CountryCodeUM = CountryCode("UM") + CountryCodeUY = CountryCode("UY") + CountryCodeUZ = CountryCode("UZ") + CountryCodeVU = CountryCode("VU") + CountryCodeVE = CountryCode("VE") + CountryCodeVN = CountryCode("VN") + CountryCodeVG = CountryCode("VG") + CountryCodeVI = CountryCode("VI") + CountryCodeWF = CountryCode("WF") + CountryCodeEH = CountryCode("EH") + CountryCodeYE = CountryCode("YE") + CountryCodeZM = CountryCode("ZM") + CountryCodeZW = CountryCode("ZW") +) + +func (enum CountryCode) String() string { + if enum == "" { + // return default value if empty + return string(CountryCodeUnknownCountryCode) + } + return string(enum) +} + +func (enum CountryCode) Values() []CountryCode { + return []CountryCode{ + "unknown_country_code", + "AF", + "AX", + "AL", + "DZ", + "AS", + "AD", + "AO", + "AI", + "AQ", + "AG", + "AR", + "AM", + "AW", + "AU", + "AT", + "AZ", + "BS", + "BH", + "BD", + "BB", + "BY", + "BE", + "BZ", + "BJ", + "BM", + "BT", + "BO", + "BQ", + "BA", + "BW", + "BV", + "BR", + "IO", + "BN", + "BG", + "BF", + "BI", + "KH", + "CM", + "CA", + "CV", + "KY", + "CF", + "TD", + "CL", + "CN", + "CX", + "CC", + "CO", + "KM", + "CG", + "CD", + "CK", + "CR", + "CI", + "HR", + "CU", + "CW", + "CY", + "CZ", + "DK", + "DJ", + "DM", + "DO", + "EC", + "EG", + "SV", + "GQ", + "ER", + "EE", + "ET", + "FK", + "FO", + "FJ", + "FI", + "FR", + "GF", + "PF", + "TF", + "GA", + "GM", + "GE", + "DE", + "GH", + "GI", + "GR", + "GL", + "GD", + "GP", + "GU", + "GT", + "GG", + "GN", + "GW", + "GY", + "HT", + "HM", + "VA", + "HN", + "HK", + "HU", + "IS", + "IN", + "ID", + "IR", + "IQ", + "IE", + "IM", + "IL", + "IT", + "JM", + "JP", + "JE", + "JO", + "KZ", + "KE", + "KI", + "KP", + "KR", + "KW", + "KG", + "LA", + "LV", + "LB", + "LS", + "LR", + "LY", + "LI", + "LT", + "LU", + "MO", + "MK", + "MG", + "MW", + "MY", + "MV", + "ML", + "MT", + "MH", + "MQ", + "MR", + "MU", + "YT", + "MX", + "FM", + "MD", + "MC", + "MN", + "ME", + "MS", + "MA", + "MZ", + "MM", + "NA", + "NR", + "NP", + "NL", + "NC", + "NZ", + "NI", + "NE", + "NG", + "NU", + "NF", + "MP", + "NO", + "OM", + "PK", + "PW", + "PS", + "PA", + "PG", + "PY", + "PE", + "PH", + "PN", + "PL", + "PT", + "PR", + "QA", + "RE", + "RO", + "RU", + "RW", + "BL", + "SH", + "KN", + "LC", + "MF", + "PM", + "VC", + "WS", + "SM", + "ST", + "SA", + "SN", + "RS", + "SC", + "SL", + "SG", + "SX", + "SK", + "SI", + "SB", + "SO", + "ZA", + "GS", + "SS", + "ES", + "LK", + "SD", + "SR", + "SJ", + "SZ", + "SE", + "CH", + "SY", + "TW", + "TJ", + "TZ", + "TH", + "TL", + "TG", + "TK", + "TO", + "TT", + "TN", + "TR", + "TM", + "TC", + "TV", + "UG", + "UA", + "AE", + "GB", + "US", + "UM", + "UY", + "UZ", + "VU", + "VE", + "VN", + "VG", + "VI", + "WF", + "EH", + "YE", + "ZM", + "ZW", + } +} + +func (enum CountryCode) MarshalJSON() ([]byte, error) { + return []byte(fmt.Sprintf(`"%s"`, enum)), nil +} + +func (enum *CountryCode) UnmarshalJSON(data []byte) error { + tmp := "" + + if err := json.Unmarshal(data, &tmp); err != nil { + return err + } + + *enum = CountryCode(CountryCode(tmp).String()) + return nil +} + type LanguageCode string const ( diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/scw/client.go b/vendor/github.com/scaleway/scaleway-sdk-go/scw/client.go index 0f9a8a2..c509084 100644 --- a/vendor/github.com/scaleway/scaleway-sdk-go/scw/client.go +++ b/vendor/github.com/scaleway/scaleway-sdk-go/scw/client.go @@ -395,7 +395,7 @@ L: // We gather potential errors and return them all together for { select { case newErr := <-errChan: - err = errors.Wrap(err, newErr.Error()) + err = errors.Wrap(err, "%s", newErr.Error()) default: break L } @@ -556,6 +556,15 @@ func setInsecureMode(c httpClient) { logger.Warningf("client: cannot use insecure mode with HTTP client of type %T", c) return } + + altTransport, ok := standardHTTPClient.Transport.(interface { + SetInsecureTransport() + }) + if ok { + altTransport.SetInsecureTransport() + return + } + transportClient, ok := standardHTTPClient.Transport.(*http.Transport) if !ok { logger.Warningf("client: cannot use insecure mode with Transport client of type %T", standardHTTPClient.Transport) diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/validation/is.go b/vendor/github.com/scaleway/scaleway-sdk-go/validation/is.go index 616e96d..763b443 100644 --- a/vendor/github.com/scaleway/scaleway-sdk-go/validation/is.go +++ b/vendor/github.com/scaleway/scaleway-sdk-go/validation/is.go @@ -8,8 +8,8 @@ import ( var ( isUUIDRegexp = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") - isRegionRegex = regexp.MustCompile("^[a-z]{2}-[a-z]{3}$") - isZoneRegex = regexp.MustCompile("^[a-z]{2}-[a-z]{3}-[1-9]$") + isRegionRegex = regexp.MustCompile("^[a-z]{2}-[a-z]{3,7}$") + isZoneRegex = regexp.MustCompile("^[a-z]{2}-[a-z]{3,7}-[0-9]{1,2}$") isAccessKey = regexp.MustCompile("^SCW[A-Z0-9]{17}$") isEmailRegexp = regexp.MustCompile("^.+@.+$") ) diff --git a/vendor/golang.org/x/sync/errgroup/errgroup.go b/vendor/golang.org/x/sync/errgroup/errgroup.go index cb6bb9a..f69fd75 100644 --- a/vendor/golang.org/x/sync/errgroup/errgroup.go +++ b/vendor/golang.org/x/sync/errgroup/errgroup.go @@ -3,7 +3,7 @@ // license that can be found in the LICENSE file. // Package errgroup provides synchronization, error propagation, and Context -// cancelation for groups of goroutines working on subtasks of a common task. +// cancellation for groups of goroutines working on subtasks of a common task. // // [errgroup.Group] is related to [sync.WaitGroup] but adds handling of tasks // returning errors. @@ -12,8 +12,6 @@ package errgroup import ( "context" "fmt" - "runtime" - "runtime/debug" "sync" ) @@ -33,10 +31,6 @@ type Group struct { errOnce sync.Once err error - - mu sync.Mutex - panicValue any // = PanicError | PanicValue; non-nil if some Group.Go goroutine panicked. - abnormal bool // some Group.Go goroutine terminated abnormally (panic or goexit). } func (g *Group) done() { @@ -56,22 +50,13 @@ func WithContext(ctx context.Context) (*Group, context.Context) { return &Group{cancel: cancel}, ctx } -// Wait blocks until all function calls from the Go method have returned -// normally, then returns the first non-nil error (if any) from them. -// -// If any of the calls panics, Wait panics with a [PanicValue]; -// and if any of them calls [runtime.Goexit], Wait calls runtime.Goexit. +// Wait blocks until all function calls from the Go method have returned, then +// returns the first non-nil error (if any) from them. func (g *Group) Wait() error { g.wg.Wait() if g.cancel != nil { g.cancel(g.err) } - if g.panicValue != nil { - panic(g.panicValue) - } - if g.abnormal { - runtime.Goexit() - } return g.err } @@ -81,53 +66,31 @@ func (g *Group) Wait() error { // It blocks until the new goroutine can be added without the number of // goroutines in the group exceeding the configured limit. // -// The first goroutine in the group that returns a non-nil error, panics, or -// invokes [runtime.Goexit] will cancel the associated Context, if any. +// The first goroutine in the group that returns a non-nil error will +// cancel the associated Context, if any. The error will be returned +// by Wait. func (g *Group) Go(f func() error) { if g.sem != nil { g.sem <- token{} } - g.add(f) -} - -func (g *Group) add(f func() error) { g.wg.Add(1) go func() { defer g.done() - normalReturn := false - defer func() { - if normalReturn { - return - } - v := recover() - g.mu.Lock() - defer g.mu.Unlock() - if !g.abnormal { - if g.cancel != nil { - g.cancel(g.err) - } - g.abnormal = true - } - if v != nil && g.panicValue == nil { - switch v := v.(type) { - case error: - g.panicValue = PanicError{ - Recovered: v, - Stack: debug.Stack(), - } - default: - g.panicValue = PanicValue{ - Recovered: v, - Stack: debug.Stack(), - } - } - } - }() - err := f() - normalReturn = true - if err != nil { + // It is tempting to propagate panics from f() + // up to the goroutine that calls Wait, but + // it creates more problems than it solves: + // - it delays panics arbitrarily, + // making bugs harder to detect; + // - it turns f's panic stack into a mere value, + // hiding it from crash-monitoring tools; + // - it risks deadlocks that hide the panic entirely, + // if f's panic leaves the program in a state + // that prevents the Wait call from being reached. + // See #53757, #74275, #74304, #74306. + + if err := f(); err != nil { g.errOnce.Do(func() { g.err = err if g.cancel != nil { @@ -152,7 +115,19 @@ func (g *Group) TryGo(f func() error) bool { } } - g.add(f) + g.wg.Add(1) + go func() { + defer g.done() + + if err := f(); err != nil { + g.errOnce.Do(func() { + g.err = err + if g.cancel != nil { + g.cancel(g.err) + } + }) + } + }() return true } @@ -169,39 +144,8 @@ func (g *Group) SetLimit(n int) { g.sem = nil return } - if len(g.sem) != 0 { - panic(fmt.Errorf("errgroup: modify limit while %v goroutines in the group are still active", len(g.sem))) + if active := len(g.sem); active != 0 { + panic(fmt.Errorf("errgroup: modify limit while %v goroutines in the group are still active", active)) } g.sem = make(chan token, n) } - -// PanicError wraps an error recovered from an unhandled panic -// when calling a function passed to Go or TryGo. -type PanicError struct { - Recovered error - Stack []byte // result of call to [debug.Stack] -} - -func (p PanicError) Error() string { - if len(p.Stack) > 0 { - return fmt.Sprintf("recovered from errgroup.Group: %v\n%s", p.Recovered, p.Stack) - } - return fmt.Sprintf("recovered from errgroup.Group: %v", p.Recovered) -} - -func (p PanicError) Unwrap() error { return p.Recovered } - -// PanicValue wraps a value that does not implement the error interface, -// recovered from an unhandled panic when calling a function passed to Go or -// TryGo. -type PanicValue struct { - Recovered any - Stack []byte // result of call to [debug.Stack] -} - -func (p PanicValue) String() string { - if len(p.Stack) > 0 { - return fmt.Sprintf("recovered from errgroup.Group: %v\n%s", p.Recovered, p.Stack) - } - return fmt.Sprintf("recovered from errgroup.Group: %v", p.Recovered) -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 2f5ad75..4c06d4e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -105,8 +105,8 @@ github.com/pkg/errors github.com/planetscale/vtprotobuf/protohelpers # github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 ## explicit -# github.com/scaleway/scaleway-sdk-go v1.0.0-beta.34 -## explicit; go 1.23.0 +# github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36 +## explicit; go 1.24.0 github.com/scaleway/scaleway-sdk-go/api/account/v3 github.com/scaleway/scaleway-sdk-go/api/block/v1alpha1 github.com/scaleway/scaleway-sdk-go/api/instance/v1 @@ -144,8 +144,8 @@ golang.org/x/crypto/internal/poly1305 golang.org/x/crypto/ssh golang.org/x/crypto/ssh/agent golang.org/x/crypto/ssh/internal/bcrypt_pbkdf -# golang.org/x/sync v0.15.0 -## explicit; go 1.23.0 +# golang.org/x/sync v0.19.0 +## explicit; go 1.24.0 golang.org/x/sync/errgroup # golang.org/x/sys v0.33.0 ## explicit; go 1.23.0 @@ -156,8 +156,8 @@ golang.org/x/sys/windows # golang.org/x/term v0.32.0 ## explicit; go 1.23.0 golang.org/x/term -# golang.org/x/text v0.26.0 -## explicit; go 1.23.0 +# golang.org/x/text v0.32.0 +## explicit; go 1.24.0 golang.org/x/text/cases golang.org/x/text/internal golang.org/x/text/internal/language