From 67f765ab09a8ba4a3baacd673acfab8ae051e8c2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Oct 2025 14:34:16 +0000 Subject: [PATCH] build(deps): bump github.com/digitalocean/godo from 1.165.1 to 1.166.0 Bumps [github.com/digitalocean/godo](https://github.com/digitalocean/godo) from 1.165.1 to 1.166.0. - [Release notes](https://github.com/digitalocean/godo/releases) - [Changelog](https://github.com/digitalocean/godo/blob/main/CHANGELOG.md) - [Commits](https://github.com/digitalocean/godo/compare/v1.165.1...v1.166.0) --- updated-dependencies: - dependency-name: github.com/digitalocean/godo dependency-version: 1.166.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 +- .../github.com/digitalocean/godo/CHANGELOG.md | 6 + .../github.com/digitalocean/godo/droplets.go | 42 ++++ vendor/github.com/digitalocean/godo/godo.go | 4 +- vendor/github.com/digitalocean/godo/nfs.go | 194 ++++++++++++++++++ .../digitalocean/godo/vpc_nat_gateways.go | 2 + vendor/modules.txt | 2 +- 8 files changed, 251 insertions(+), 5 deletions(-) create mode 100644 vendor/github.com/digitalocean/godo/nfs.go diff --git a/go.mod b/go.mod index 40b1f0571..5ce0a5fc2 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.25 require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc - github.com/digitalocean/godo v1.165.1 + github.com/digitalocean/godo v1.166.0 github.com/go-logr/logr v1.4.3 github.com/google/go-cmp v0.7.0 github.com/google/uuid v1.6.0 diff --git a/go.sum b/go.sum index 4a04bb1ba..4efdd5f0c 100644 --- a/go.sum +++ b/go.sum @@ -25,8 +25,8 @@ 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/digitalocean/godo v1.165.1 h1:H37+W7TaGFOVH+HpMW4ZeW/hrq3AGNxg+B/K8/dZ9mQ= -github.com/digitalocean/godo v1.165.1/go.mod h1:xQsWpVCCbkDrWisHA72hPzPlnC+4W5w/McZY5ij9uvU= +github.com/digitalocean/godo v1.166.0 h1:vD/RqJnvRPk5w7eknJE53PhphoTsZBDyu9pjWOD1BtM= +github.com/digitalocean/godo v1.166.0/go.mod h1:xQsWpVCCbkDrWisHA72hPzPlnC+4W5w/McZY5ij9uvU= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes= diff --git a/vendor/github.com/digitalocean/godo/CHANGELOG.md b/vendor/github.com/digitalocean/godo/CHANGELOG.md index 46800438d..99d592fc4 100644 --- a/vendor/github.com/digitalocean/godo/CHANGELOG.md +++ b/vendor/github.com/digitalocean/godo/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## [1.166.0] - 2025-10-13 + +- #912 - @sreeram-venkitesh - MNFS-164: Added NFS APIs +- #913 - @fyzanshaik - Add ListAssociatedResourcesForDeletion for Droplets +- #909 - @jvasilevsky - LBAAS-3995: add project ID to nat gateway + ## [1.165.1] - 2025-09-24 - #906 - @do-joe - Fix Database Logsink API Response Parsing and TLS Field Marshaling diff --git a/vendor/github.com/digitalocean/godo/droplets.go b/vendor/github.com/digitalocean/godo/droplets.go index 2ddd7d6b7..61a3fb6e5 100644 --- a/vendor/github.com/digitalocean/godo/droplets.go +++ b/vendor/github.com/digitalocean/godo/droplets.go @@ -33,6 +33,7 @@ type DropletsService interface { GetBackupPolicy(context.Context, int) (*DropletBackupPolicy, *Response, error) ListBackupPolicies(context.Context, *ListOptions) (map[int]*DropletBackupPolicy, *Response, error) ListSupportedBackupPolicies(context.Context) ([]*SupportedBackupPolicy, *Response, error) + ListAssociatedResourcesForDeletion(context.Context, int) (*DropletAssociatedResources, *Response, error) } // DropletsServiceOp handles communication with the Droplet related methods of the @@ -263,6 +264,26 @@ type DropletBackupPolicyRequest struct { Hour *int `json:"hour,omitempty"` } +// DropletAssociatedResource represents a billable resource associated with a Droplet. +type DropletAssociatedResource struct { + ID string `json:"id"` + Name string `json:"name"` + Cost string `json:"cost"` +} + +// DropletAssociatedResources represents the associated billable resources that can be destroyed along with a Droplet. +type DropletAssociatedResources struct { + ReservedIPs []*DropletAssociatedResource `json:"reserved_ips"` + FloatingIPs []*DropletAssociatedResource `json:"floating_ips"` + Snapshots []*DropletAssociatedResource `json:"snapshots"` + Volumes []*DropletAssociatedResource `json:"volumes"` + VolumeSnapshots []*DropletAssociatedResource `json:"volume_snapshots"` +} + +func (a DropletAssociatedResources) String() string { + return Stringify(a) +} + func (d DropletCreateRequest) String() string { return Stringify(d) } @@ -621,6 +642,27 @@ func (s *DropletsServiceOp) Neighbors(ctx context.Context, dropletID int) ([]Dro return root.Droplets, resp, err } +// ListAssociatedResourcesForDeletion lists a Droplet's associated resources that can be destroyed along with the Droplet. +// Associated resources include reserved IPs, floating IPs, snapshots, volumes, and volume snapshots. +func (s *DropletsServiceOp) ListAssociatedResourcesForDeletion(ctx context.Context, dropletID int) (*DropletAssociatedResources, *Response, error) { + if dropletID < 1 { + return nil, nil, NewArgError("dropletID", "cannot be less than 1") + } + path := fmt.Sprintf("%s/%d/destroy_with_associated_resources", dropletBasePath, dropletID) + req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) + if err != nil { + return nil, nil, err + } + + root := new(DropletAssociatedResources) + resp, err := s.client.Do(ctx, req, root) + if err != nil { + return nil, resp, err + } + + return root, resp, nil +} + func (s *DropletsServiceOp) dropletActionStatus(ctx context.Context, uri string) (string, error) { action, _, err := s.client.DropletActions.GetByURI(ctx, uri) diff --git a/vendor/github.com/digitalocean/godo/godo.go b/vendor/github.com/digitalocean/godo/godo.go index a72cfc075..5c69a7af1 100644 --- a/vendor/github.com/digitalocean/godo/godo.go +++ b/vendor/github.com/digitalocean/godo/godo.go @@ -21,7 +21,7 @@ import ( ) const ( - libraryVersion = "1.165.1" + libraryVersion = "1.166.0" defaultBaseURL = "https://api.digitalocean.com/" userAgent = "godo/" + libraryVersion mediaType = "application/json" @@ -78,6 +78,7 @@ type Client struct { Kubernetes KubernetesService LoadBalancers LoadBalancersService Monitoring MonitoringService + Nfs NfsService OneClick OneClickService Projects ProjectsService Regions RegionsService @@ -304,6 +305,7 @@ func NewClient(httpClient *http.Client) *Client { c.Kubernetes = &KubernetesServiceOp{client: c} c.LoadBalancers = &LoadBalancersServiceOp{client: c} c.Monitoring = &MonitoringServiceOp{client: c} + c.Nfs = &NfsServiceOp{client: c} c.VPCNATGateways = &VPCNATGatewaysServiceOp{client: c} c.OneClick = &OneClickServiceOp{client: c} c.Projects = &ProjectsServiceOp{client: c} diff --git a/vendor/github.com/digitalocean/godo/nfs.go b/vendor/github.com/digitalocean/godo/nfs.go new file mode 100644 index 000000000..b563e1999 --- /dev/null +++ b/vendor/github.com/digitalocean/godo/nfs.go @@ -0,0 +1,194 @@ +package godo + +import ( + "context" + "fmt" + "net/http" +) + +const nfsBasePath = "v2/nfs" + +type NfsService interface { + // List retrieves a list of NFS shares with optional filtering via ListOptions and region + List(context.Context, *ListOptions, string) ([]*Nfs, *Response, error) + // Create creates a new NFS share with the provided configuration + Create(context.Context, *NfsCreateRequest) (*Nfs, *Response, error) + // Delete removes an NFS share by its ID and region + Delete(context.Context, string, string) (*Response, error) + // Get retrieves a specific NFS share by its ID and region + Get(context.Context, string, string) (*Nfs, *Response, error) +} + +// NfsServiceOp handles communication with the NFS related methods of the +// DigitalOcean API. +type NfsServiceOp struct { + client *Client +} + +var _ NfsService = &NfsServiceOp{} + +// Nfs represents a DigitalOcean NFS share +type Nfs struct { + // ID is the unique identifier for the NFS share + ID string `json:"id"` + // Name is the human-readable name for the NFS share + Name string `json:"name"` + // SizeGib is the size of the NFS share in gibibytes + SizeGib int `json:"size_gib"` + // Region is the datacenter region where the NFS share is located + Region string `json:"region"` + // Status represents the current state of the NFS share + Status string `json:"status"` + // CreatedAt is the timestamp when the NFS share was created + CreatedAt string `json:"created_at"` + // VpcIDs is a list of VPC IDs that have access to the NFS share + VpcIDs []string `json:"vpc_ids"` +} + +// NfsCreateRequest represents a request to create an NFS share. +type NfsCreateRequest struct { + Name string `json:"name"` + SizeGib int `json:"size_gib"` + Region string `json:"region"` + VpcIDs []string `json:"vpc_ids,omitempty"` +} + +// nfsRoot represents a response from the DigitalOcean API +type nfsRoot struct { + Share *Nfs `json:"share"` +} + +// nfsListRoot represents a response from the DigitalOcean API +type nfsListRoot struct { + Shares []*Nfs `json:"shares,omitempty"` + Links *Links `json:"links,omitempty"` + Meta *Meta `json:"meta"` +} + +// nfsOptions represents the query param options for NFS operations +type nfsOptions struct { + Region string `url:"region"` +} + +// Create creates a new NFS share. +func (s *NfsServiceOp) Create(ctx context.Context, createRequest *NfsCreateRequest) (*Nfs, *Response, error) { + if createRequest == nil { + return nil, nil, NewArgError("createRequest", "cannot be nil") + } + + if createRequest.SizeGib < 50 { + return nil, nil, NewArgError("size_gib", "it cannot be less than 50Gib") + } + + req, err := s.client.NewRequest(ctx, http.MethodPost, nfsBasePath, createRequest) + if err != nil { + return nil, nil, err + } + + root := new(nfsRoot) + resp, err := s.client.Do(ctx, req, root) + if err != nil { + return nil, resp, err + } + + return root.Share, resp, nil +} + +// Get retrieves an NFS share by ID and region. +func (s *NfsServiceOp) Get(ctx context.Context, id string, region string) (*Nfs, *Response, error) { + if id == "" { + return nil, nil, NewArgError("id", "cannot be empty") + } + if region == "" { + return nil, nil, NewArgError("region", "cannot be empty") + } + + path := fmt.Sprintf("%s/%s", nfsBasePath, id) + + getOpts := &nfsOptions{Region: region} + path, err := addOptions(path, getOpts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) + if err != nil { + return nil, nil, err + } + + root := new(nfsRoot) + resp, err := s.client.Do(ctx, req, root) + if err != nil { + return nil, resp, err + } + + return root.Share, resp, nil +} + +// List returns a list of NFS shares. +func (s *NfsServiceOp) List(ctx context.Context, opts *ListOptions, region string) ([]*Nfs, *Response, error) { + if region == "" { + return nil, nil, NewArgError("region", "cannot be empty") + } + + path, err := addOptions(nfsBasePath, opts) + if err != nil { + return nil, nil, err + } + + listOpts := &nfsOptions{Region: region} + path, err = addOptions(path, listOpts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) + if err != nil { + return nil, nil, err + } + + root := new(nfsListRoot) + resp, err := s.client.Do(ctx, req, root) + if err != nil { + return nil, resp, err + } + + if root.Links != nil { + resp.Links = root.Links + } + if root.Meta != nil { + resp.Meta = root.Meta + } + + return root.Shares, resp, nil +} + +// Delete deletes an NFS share by ID and region. +func (s *NfsServiceOp) Delete(ctx context.Context, id string, region string) (*Response, error) { + if id == "" { + return nil, NewArgError("id", "cannot be empty") + } + if region == "" { + return nil, NewArgError("region", "cannot be empty") + } + + path := fmt.Sprintf("%s/%s", nfsBasePath, id) + + deleteOpts := &nfsOptions{Region: region} + path, err := addOptions(path, deleteOpts) + if err != nil { + return nil, err + } + + req, err := s.client.NewRequest(ctx, http.MethodDelete, path, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} diff --git a/vendor/github.com/digitalocean/godo/vpc_nat_gateways.go b/vendor/github.com/digitalocean/godo/vpc_nat_gateways.go index 55d75ce6e..8c454621b 100644 --- a/vendor/github.com/digitalocean/godo/vpc_nat_gateways.go +++ b/vendor/github.com/digitalocean/godo/vpc_nat_gateways.go @@ -30,6 +30,7 @@ type VPCNATGatewayRequest struct { UDPTimeoutSeconds uint32 `json:"udp_timeout_seconds,omitempty"` ICMPTimeoutSeconds uint32 `json:"icmp_timeout_seconds,omitempty"` TCPTimeoutSeconds uint32 `json:"tcp_timeout_seconds,omitempty"` + ProjectID string `json:"project_id,omitempty"` } // VPCNATGateway represents a DigitalOcean VPC NAT Gateway resource @@ -47,6 +48,7 @@ type VPCNATGateway struct { TCPTimeoutSeconds uint32 `json:"tcp_timeout_seconds,omitempty"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` + ProjectID string `json:"project_id,omitempty"` } // IngressVPC defines the ingress configs supported by a VPC NAT Gateway diff --git a/vendor/modules.txt b/vendor/modules.txt index 21ea44927..3f3cd68b8 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -33,7 +33,7 @@ github.com/coreos/go-systemd/v22/journal # github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc ## explicit github.com/davecgh/go-spew/spew -# github.com/digitalocean/godo v1.165.1 +# github.com/digitalocean/godo v1.166.0 ## explicit; go 1.23.0 github.com/digitalocean/godo github.com/digitalocean/godo/metrics