From b2d0e8800c633ef22acbac256479ede2840e56a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Feb 2025 20:15:51 +0100 Subject: [PATCH] build(deps): bump github.com/digitalocean/godo from 1.134.0 to 1.136.0 (#800) Bumps [github.com/digitalocean/godo](https://github.com/digitalocean/godo) from 1.134.0 to 1.136.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.134.0...v1.136.0) --- updated-dependencies: - dependency-name: github.com/digitalocean/godo dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 +- .../github.com/digitalocean/godo/CHANGELOG.md | 10 +++ .../github.com/digitalocean/godo/apps.gen.go | 2 + .../digitalocean/godo/apps_accessors.go | 8 ++ .../github.com/digitalocean/godo/databases.go | 75 +++++++++++++++++++ vendor/github.com/digitalocean/godo/godo.go | 2 +- .../digitalocean/godo/kubernetes.go | 39 ++++++---- .../digitalocean/godo/load_balancers.go | 7 ++ .../godo/partner_interconnect_attachments.go | 34 ++++++++- vendor/modules.txt | 2 +- 11 files changed, 164 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index 84ecd38a7..58dec6e2b 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.23.4 require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc - github.com/digitalocean/godo v1.134.0 + github.com/digitalocean/godo v1.136.0 github.com/go-logr/logr v1.4.2 github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.6.0 diff --git a/go.sum b/go.sum index ae8a1dc02..a419bdb87 100644 --- a/go.sum +++ b/go.sum @@ -27,8 +27,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.134.0 h1:dT7aQR9jxNOQEZwzP+tAYcxlj5szFZScC33+PAYGQVM= -github.com/digitalocean/godo v1.134.0/go.mod h1:PU8JB6I1XYkQIdHFop8lLAY9ojp6M0XcU0TWaQSxbrc= +github.com/digitalocean/godo v1.136.0 h1:DTxugljFJSMBPfEGq4KeXpnKeAHicggNqogcrw/YdZw= +github.com/digitalocean/godo v1.136.0/go.mod h1:PU8JB6I1XYkQIdHFop8lLAY9ojp6M0XcU0TWaQSxbrc= 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.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU= diff --git a/vendor/github.com/digitalocean/godo/CHANGELOG.md b/vendor/github.com/digitalocean/godo/CHANGELOG.md index 091f2ec8a..8f926be62 100644 --- a/vendor/github.com/digitalocean/godo/CHANGELOG.md +++ b/vendor/github.com/digitalocean/godo/CHANGELOG.md @@ -1,5 +1,15 @@ # Change Log +## [v1.136.0] - 2025-01-28 + +- #776 - @danaelhe - Databases: Support online-migrations +- #777 - @apinonformoso - update bgp to be a pointer + +## [v1.135.0] - 2025-01-27 +- #766 - @dhij - kubernetes: add cluster autoscaler config +- #775 - @jvasilevsky - LBASA-3620: add network_stack field to load balancers model +- #773 - @blesswinsamuel - Add field to customize the offline page during app maintenance + ## [v1.134.0] - 2025-01-15 - #771 - @d-honeybadger - add ID field to KubernetesClusterUser response - #768 - @lee-aaron - support Spaces Keys API diff --git a/vendor/github.com/digitalocean/godo/apps.gen.go b/vendor/github.com/digitalocean/godo/apps.gen.go index 63457cda4..7b9f057d1 100644 --- a/vendor/github.com/digitalocean/godo/apps.gen.go +++ b/vendor/github.com/digitalocean/godo/apps.gen.go @@ -470,6 +470,8 @@ type AppMaintenanceSpec struct { Enabled bool `json:"enabled,omitempty"` // Indicates whether the app should be archived. Setting this to true implies that enabled is set to true. Note that this feature is currently in closed beta. Archive bool `json:"archive,omitempty"` + // A custom offline page to display when maintenance mode is enabled or the app is archived. + OfflinePageURL string `json:"offline_page_url,omitempty"` } // AppRouteSpec struct for AppRouteSpec diff --git a/vendor/github.com/digitalocean/godo/apps_accessors.go b/vendor/github.com/digitalocean/godo/apps_accessors.go index 4d9a214ae..9a5bf6012 100644 --- a/vendor/github.com/digitalocean/godo/apps_accessors.go +++ b/vendor/github.com/digitalocean/godo/apps_accessors.go @@ -1453,6 +1453,14 @@ func (a *AppMaintenanceSpec) GetEnabled() bool { return a.Enabled } +// GetOfflinePageURL returns the OfflinePageURL field. +func (a *AppMaintenanceSpec) GetOfflinePageURL() string { + if a == nil { + return "" + } + return a.OfflinePageURL +} + // GetAppID returns the AppID field. func (a *AppProposeRequest) GetAppID() string { if a == nil { diff --git a/vendor/github.com/digitalocean/godo/databases.go b/vendor/github.com/digitalocean/godo/databases.go index 1217ef05e..ed4b4f8ba 100644 --- a/vendor/github.com/digitalocean/godo/databases.go +++ b/vendor/github.com/digitalocean/godo/databases.go @@ -42,6 +42,8 @@ const ( databaseIndexPath = databaseBasePath + "/%s/indexes/%s" databaseLogsinkPath = databaseBasePath + "/%s/logsink/%s" databaseLogsinksPath = databaseBasePath + "/%s/logsink" + databaseOnlineMigrationsPath = databaseBasePath + "/%s/online-migration" + databaseOnlineMigrationPath = databaseBasePath + "/%s/online-migration/%s" ) // SQL Mode constants allow for MySQL-specific SQL flavor configuration. @@ -179,6 +181,9 @@ type DatabasesService interface { ListLogsinks(ctx context.Context, databaseID string, opts *ListOptions) ([]DatabaseLogsink, *Response, error) UpdateLogsink(ctx context.Context, databaseID string, logsinkID string, updateLogsink *DatabaseUpdateLogsinkRequest) (*Response, error) DeleteLogsink(ctx context.Context, databaseID, logsinkID string) (*Response, error) + StartOnlineMigration(ctx context.Context, databaseID string, onlineMigrationRequest *DatabaseStartOnlineMigrationRequest) (*DatabaseOnlineMigrationStatus, *Response, error) + StopOnlineMigration(ctx context.Context, databaseID, migrationID string) (*Response, error) + GetOnlineMigrationStatus(ctx context.Context, databaseID string) (*DatabaseOnlineMigrationStatus, *Response, error) } // DatabasesServiceOp handles communication with the Databases related methods @@ -366,6 +371,13 @@ type DatabaseLogsink struct { Config *DatabaseLogsinkConfig `json:"config,omitempty"` } +// DatabaseOnlineMigrationStatus represents an online migration status +type DatabaseOnlineMigrationStatus struct { + ID string `json:"id"` + Status string `json:"status"` + CreatedAt string `json:"created_at"` +} + // TopicPartition represents the state of a Kafka topic partition type TopicPartition struct { EarliestOffset uint64 `json:"earliest_offset,omitempty"` @@ -515,6 +527,13 @@ type DatabaseFirewallRule struct { CreatedAt time.Time `json:"created_at"` } +// DatabaseStartOnlineMigrationRequest is used to start an online migration for a database cluster +type DatabaseStartOnlineMigrationRequest struct { + Source *DatabaseOnlineMigrationConfig `json:"source"` + DisableSSL bool `json:"disable_ssl,omitempty"` + IgnoreDBs []string `json:"ignore_dbs,omitempty"` +} + // DatabaseCreateLogsinkRequest is used to create logsink for a database cluster type DatabaseCreateLogsinkRequest struct { Name string `json:"sink_name"` @@ -544,6 +563,15 @@ type DatabaseLogsinkConfig struct { Cert string `json:"cert,omitempty"` } +// DatabaseOnlineMigrationConfig represents the configuration options for database online migrations. +type DatabaseOnlineMigrationConfig struct { + Host string `json:"host,omitempty"` + Port int `json:"port,omitempty"` + DatabaseName string `json:"dbname,omitempty"` + Username string `json:"username,omitempty"` + Password string `json:"password,omitempty"` +} + // PostgreSQLConfig holds advanced configurations for PostgreSQL database clusters. type PostgreSQLConfig struct { AutovacuumFreezeMaxAge *int `json:"autovacuum_freeze_max_age,omitempty"` @@ -1975,3 +2003,50 @@ func (svc *DatabasesServiceOp) DeleteLogsink(ctx context.Context, databaseID, lo } return resp, nil } + +// StartOnlineMigration starts an online migration for a database. Migrating a cluster establishes a connection with an existing cluster +// and replicates its contents to the target cluster. Online migration is only available for MySQL, PostgreSQL, and Redis clusters. +func (svc *DatabasesServiceOp) StartOnlineMigration(ctx context.Context, databaseID string, onlineMigration *DatabaseStartOnlineMigrationRequest) (*DatabaseOnlineMigrationStatus, *Response, error) { + path := fmt.Sprintf(databaseOnlineMigrationsPath, databaseID) + req, err := svc.client.NewRequest(ctx, http.MethodPut, path, onlineMigration) + if err != nil { + return nil, nil, err + } + + root := new(DatabaseOnlineMigrationStatus) + resp, err := svc.client.Do(ctx, req, root) + if err != nil { + return nil, resp, err + } + return root, resp, nil +} + +// GetOnlineMigrationStatus retrieves the status of the most recent online migration +func (svc *DatabasesServiceOp) GetOnlineMigrationStatus(ctx context.Context, databaseID string) (*DatabaseOnlineMigrationStatus, *Response, error) { + path := fmt.Sprintf(databaseOnlineMigrationsPath, databaseID) + req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil) + if err != nil { + return nil, nil, err + } + + root := new(DatabaseOnlineMigrationStatus) + resp, err := svc.client.Do(ctx, req, root) + if err != nil { + return nil, resp, err + } + return root, resp, nil +} + +// StopOnlineMigration stops an online migration +func (svc *DatabasesServiceOp) StopOnlineMigration(ctx context.Context, databaseID, migrationID string) (*Response, error) { + path := fmt.Sprintf(databaseOnlineMigrationPath, databaseID, migrationID) + req, err := svc.client.NewRequest(ctx, http.MethodDelete, path, nil) + if err != nil { + return nil, err + } + resp, err := svc.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + return resp, nil +} diff --git a/vendor/github.com/digitalocean/godo/godo.go b/vendor/github.com/digitalocean/godo/godo.go index f3bdca9be..ff4c04e1e 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.134.0" + libraryVersion = "1.136.0" defaultBaseURL = "https://api.digitalocean.com/" userAgent = "godo/" + libraryVersion mediaType = "application/json" diff --git a/vendor/github.com/digitalocean/godo/kubernetes.go b/vendor/github.com/digitalocean/godo/kubernetes.go index 8a4085a07..8353e78c1 100644 --- a/vendor/github.com/digitalocean/godo/kubernetes.go +++ b/vendor/github.com/digitalocean/godo/kubernetes.go @@ -78,20 +78,22 @@ type KubernetesClusterCreateRequest struct { NodePools []*KubernetesNodePoolCreateRequest `json:"node_pools,omitempty"` - MaintenancePolicy *KubernetesMaintenancePolicy `json:"maintenance_policy"` - AutoUpgrade bool `json:"auto_upgrade"` - SurgeUpgrade bool `json:"surge_upgrade"` - ControlPlaneFirewall *KubernetesControlPlaneFirewall `json:"control_plane_firewall,omitempty"` + MaintenancePolicy *KubernetesMaintenancePolicy `json:"maintenance_policy"` + AutoUpgrade bool `json:"auto_upgrade"` + SurgeUpgrade bool `json:"surge_upgrade"` + ControlPlaneFirewall *KubernetesControlPlaneFirewall `json:"control_plane_firewall,omitempty"` + ClusterAutoscalerConfiguration *KubernetesClusterAutoscalerConfiguration `json:"cluster_autoscaler_configuration,omitempty"` } // KubernetesClusterUpdateRequest represents a request to update a Kubernetes cluster. type KubernetesClusterUpdateRequest struct { - Name string `json:"name,omitempty"` - Tags []string `json:"tags,omitempty"` - MaintenancePolicy *KubernetesMaintenancePolicy `json:"maintenance_policy,omitempty"` - AutoUpgrade *bool `json:"auto_upgrade,omitempty"` - SurgeUpgrade bool `json:"surge_upgrade,omitempty"` - ControlPlaneFirewall *KubernetesControlPlaneFirewall `json:"control_plane_firewall,omitempty"` + Name string `json:"name,omitempty"` + Tags []string `json:"tags,omitempty"` + MaintenancePolicy *KubernetesMaintenancePolicy `json:"maintenance_policy,omitempty"` + AutoUpgrade *bool `json:"auto_upgrade,omitempty"` + SurgeUpgrade bool `json:"surge_upgrade,omitempty"` + ControlPlaneFirewall *KubernetesControlPlaneFirewall `json:"control_plane_firewall,omitempty"` + ClusterAutoscalerConfiguration *KubernetesClusterAutoscalerConfiguration `json:"cluster_autoscaler_configuration,omitempty"` // Convert cluster to run highly available control plane HA *bool `json:"ha,omitempty"` @@ -205,11 +207,12 @@ type KubernetesCluster struct { NodePools []*KubernetesNodePool `json:"node_pools,omitempty"` - MaintenancePolicy *KubernetesMaintenancePolicy `json:"maintenance_policy,omitempty"` - AutoUpgrade bool `json:"auto_upgrade,omitempty"` - SurgeUpgrade bool `json:"surge_upgrade,omitempty"` - RegistryEnabled bool `json:"registry_enabled,omitempty"` - ControlPlaneFirewall *KubernetesControlPlaneFirewall `json:"control_plane_firewall,omitempty"` + MaintenancePolicy *KubernetesMaintenancePolicy `json:"maintenance_policy,omitempty"` + AutoUpgrade bool `json:"auto_upgrade,omitempty"` + SurgeUpgrade bool `json:"surge_upgrade,omitempty"` + RegistryEnabled bool `json:"registry_enabled,omitempty"` + ControlPlaneFirewall *KubernetesControlPlaneFirewall `json:"control_plane_firewall,omitempty"` + ClusterAutoscalerConfiguration *KubernetesClusterAutoscalerConfiguration `json:"cluster_autoscaler_configuration,omitempty"` Status *KubernetesClusterStatus `json:"status,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` @@ -252,6 +255,12 @@ type KubernetesControlPlaneFirewall struct { AllowedAddresses []string `json:"allowed_addresses"` } +// KubernetesClusterAutoscalerConfiguration represents Kubernetes cluster autoscaler configuration. +type KubernetesClusterAutoscalerConfiguration struct { + ScaleDownUtilizationThreshold *float64 `json:"scale_down_utilization_threshold"` + ScaleDownUnneededTime *string `json:"scale_down_unneeded_time"` +} + // KubernetesMaintenancePolicyDay represents the possible days of a maintenance // window type KubernetesMaintenancePolicyDay int diff --git a/vendor/github.com/digitalocean/godo/load_balancers.go b/vendor/github.com/digitalocean/godo/load_balancers.go index a12729dd6..54bec0c4f 100644 --- a/vendor/github.com/digitalocean/godo/load_balancers.go +++ b/vendor/github.com/digitalocean/godo/load_balancers.go @@ -22,6 +22,10 @@ const ( // Load Balancer network types LoadBalancerNetworkTypeExternal = "EXTERNAL" LoadBalancerNetworkTypeInternal = "INTERNAL" + + // Load Balancer network_stack types + LoadBalancerNetworkStackIPv4 = "IPV4" + LoadBalancerNetworkStackDualstack = "DUALSTACK" ) // LoadBalancersService is an interface for managing load balancers with the DigitalOcean API. @@ -74,6 +78,7 @@ type LoadBalancer struct { GLBSettings *GLBSettings `json:"glb_settings,omitempty"` TargetLoadBalancerIDs []string `json:"target_load_balancer_ids,omitempty"` Network string `json:"network,omitempty"` + NetworkStack string `json:"network_stack,omitempty"` } // String creates a human-readable description of a LoadBalancer. @@ -108,6 +113,7 @@ func (l LoadBalancer) AsRequest() *LoadBalancerRequest { HTTPIdleTimeoutSeconds: l.HTTPIdleTimeoutSeconds, TargetLoadBalancerIDs: append([]string(nil), l.TargetLoadBalancerIDs...), Network: l.Network, + NetworkStack: l.NetworkStack, } if l.DisableLetsEncryptDNSRecords != nil { @@ -247,6 +253,7 @@ type LoadBalancerRequest struct { GLBSettings *GLBSettings `json:"glb_settings,omitempty"` TargetLoadBalancerIDs []string `json:"target_load_balancer_ids,omitempty"` Network string `json:"network,omitempty"` + NetworkStack string `json:"network_stack,omitempty"` } // String creates a human-readable description of a LoadBalancerRequest. diff --git a/vendor/github.com/digitalocean/godo/partner_interconnect_attachments.go b/vendor/github.com/digitalocean/godo/partner_interconnect_attachments.go index 87a0e9ed6..df21c9292 100644 --- a/vendor/github.com/digitalocean/godo/partner_interconnect_attachments.go +++ b/vendor/github.com/digitalocean/godo/partner_interconnect_attachments.go @@ -46,6 +46,37 @@ type PartnerInterconnectAttachmentCreateRequest struct { BGP BGP `json:"bgp,omitempty"` } +type partnerInterconnectAttachmentRequestBody struct { + // Name is the name of the Partner Interconnect Attachment + Name string `json:"name,omitempty"` + // ConnectionBandwidthInMbps is the bandwidth of the connection in Mbps + ConnectionBandwidthInMbps int `json:"connection_bandwidth_in_mbps,omitempty"` + // Region is the region where the Partner Interconnect Attachment is created + Region string `json:"region,omitempty"` + // NaaSProvider is the name of the Network as a Service provider + NaaSProvider string `json:"naas_provider,omitempty"` + // VPCIDs is the IDs of the VPCs to which the Partner Interconnect Attachment is connected + VPCIDs []string `json:"vpc_ids,omitempty"` + // BGP is the BGP configuration of the Partner Interconnect Attachment + BGP *BGP `json:"bgp,omitempty"` +} + +func (req *PartnerInterconnectAttachmentCreateRequest) buildReq() *partnerInterconnectAttachmentRequestBody { + request := &partnerInterconnectAttachmentRequestBody{ + Name: req.Name, + ConnectionBandwidthInMbps: req.ConnectionBandwidthInMbps, + Region: req.Region, + NaaSProvider: req.NaaSProvider, + VPCIDs: req.VPCIDs, + } + + if req.BGP != (BGP{}) { + request.BGP = &req.BGP + } + + return request +} + // PartnerInterconnectAttachmentUpdateRequest represents a request to update a Partner Interconnect Attachment. type PartnerInterconnectAttachmentUpdateRequest struct { // Name is the name of the Partner Interconnect Attachment @@ -154,7 +185,8 @@ func (s *PartnerInterconnectAttachmentsServiceOp) List(ctx context.Context, opt // Create creates a new Partner Interconnect Attachment. func (s *PartnerInterconnectAttachmentsServiceOp) Create(ctx context.Context, create *PartnerInterconnectAttachmentCreateRequest) (*PartnerInterconnectAttachment, *Response, error) { path := partnerInterconnectAttachmentsBasePath - req, err := s.client.NewRequest(ctx, http.MethodPost, path, create) + + req, err := s.client.NewRequest(ctx, http.MethodPost, path, create.buildReq()) if err != nil { return nil, nil, err } diff --git a/vendor/modules.txt b/vendor/modules.txt index ede1f2334..0abf0bcfd 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -36,7 +36,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.134.0 +# github.com/digitalocean/godo v1.136.0 ## explicit; go 1.22 github.com/digitalocean/godo github.com/digitalocean/godo/metrics