diff --git a/go.mod b/go.mod index d57b5b1e2..41aa37d55 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.21 require ( github.com/blang/semver v3.5.1+incompatible github.com/creack/pty v1.1.11 - github.com/digitalocean/godo v1.105.0 + github.com/digitalocean/godo v1.107.0 github.com/docker/cli v24.0.5+incompatible github.com/docker/docker v24.0.7+incompatible github.com/docker/docker-credential-helpers v0.7.0 // indirect diff --git a/go.sum b/go.sum index 29bad1197..5bfb2a932 100644 --- a/go.sum +++ b/go.sum @@ -103,8 +103,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.105.0 h1:bUfWVsyQCYZ7OQLK+p2EBFYWD5BoOgpyq/PMSQHEeMg= -github.com/digitalocean/godo v1.105.0/go.mod h1:R6EmmWI8CT1+fCtjWY9UCB+L5uufuZH13wk3YhxycCs= +github.com/digitalocean/godo v1.107.0 h1:P72IbmGFQvKOvyjVLyT59bmHxilA4E5hWi40rF4zNQc= +github.com/digitalocean/godo v1.107.0/go.mod h1:R6EmmWI8CT1+fCtjWY9UCB+L5uufuZH13wk3YhxycCs= github.com/docker/cli v24.0.5+incompatible h1:WeBimjvS0eKdH4Ygx+ihVq1Q++xg36M/rMi4aXAvodc= github.com/docker/cli v24.0.5+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= diff --git a/vendor/github.com/digitalocean/godo/CHANGELOG.md b/vendor/github.com/digitalocean/godo/CHANGELOG.md index 74f07c142..8177eb196 100644 --- a/vendor/github.com/digitalocean/godo/CHANGELOG.md +++ b/vendor/github.com/digitalocean/godo/CHANGELOG.md @@ -1,5 +1,22 @@ # Change Log +## [v1.107.0] - 2023-12-07 + +- #658 - @markusthoemmes - APPS-8033 Add the RUN_RESTARTED log type +- #656 - @dweinshenker - Enhancement: add database user update +- #657 - @markusthoemmes - apps: Add registry_credentials field, GHCR registry type and the egress spec + +## [v1.106.0] - 2023-11-14 + +- #654 - @dweinshenker - Remove unclean_leader_election_enable for topic configuration + +## [v1.105.1] - 2023-11-07 + +- #652 - @andrewsomething - Retry on HTTP/2 internal errors. +- #648 - @alexandear - test: use fmt.Fprintf instead of fmt.Fprintf(fmt.Sprintf(...)) +- #651 - @alexandear - test: Replace deprecated io/ioutil with io +- #647 - @alexandear - test: add missing error check + ## [v1.105.0] - 2023-10-16 - #643 - @dweinshenker - Add support for scalable storage on database clusters diff --git a/vendor/github.com/digitalocean/godo/apps.gen.go b/vendor/github.com/digitalocean/godo/apps.gen.go index 8b01dbb7b..7ec24c334 100644 --- a/vendor/github.com/digitalocean/godo/apps.gen.go +++ b/vendor/github.com/digitalocean/godo/apps.gen.go @@ -244,6 +244,20 @@ const ( AppDomainSpecType_Alias AppDomainSpecType = "ALIAS" ) +// AppEgressSpec Specification for app egress configurations. +type AppEgressSpec struct { + Type AppEgressSpecType `json:"type,omitempty"` +} + +// AppEgressSpecType the model 'AppEgressSpecType' +type AppEgressSpecType string + +// List of AppEgressSpecType +const ( + APPEGRESSSPECTYPE_Autoassign AppEgressSpecType = "AUTOASSIGN" + APPEGRESSSPECTYPE_DedicatedIp AppEgressSpecType = "DEDICATED_IP" +) + // AppFunctionsSpec struct for AppFunctionsSpec type AppFunctionsSpec struct { // The name. Must be unique across all components within the same app. @@ -495,6 +509,7 @@ type AppSpec struct { // A list of alerts which apply to the app. Alerts []*AppAlertSpec `json:"alerts,omitempty"` Ingress *AppIngressSpec `json:"ingress,omitempty"` + Egress *AppEgressSpec `json:"egress,omitempty"` Features []string `json:"features,omitempty"` } @@ -1012,8 +1027,10 @@ type ImageSourceSpec struct { // The repository tag. Defaults to `latest` if not provided and no digest is provided. Cannot be specified if digest is provided. Tag string `json:"tag,omitempty"` // The image digest. Cannot be specified if tag is provided. - Digest string `json:"digest,omitempty"` - DeployOnPush *ImageSourceSpecDeployOnPush `json:"deploy_on_push,omitempty"` + Digest string `json:"digest,omitempty"` + // The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value should be used. - \"$username:$access_token\" for registries of type `DOCKER_HUB`. - \"$username:$access_token\" for registries of type `GHCR`. + RegistryCredentials string `json:"registry_credentials,omitempty"` + DeployOnPush *ImageSourceSpecDeployOnPush `json:"deploy_on_push,omitempty"` } // ImageSourceSpecDeployOnPush struct for ImageSourceSpecDeployOnPush @@ -1022,7 +1039,7 @@ type ImageSourceSpecDeployOnPush struct { Enabled bool `json:"enabled,omitempty"` } -// ImageSourceSpecRegistryType - DOCR: The DigitalOcean container registry type. - DOCKER_HUB: The DockerHub container registry type. +// ImageSourceSpecRegistryType - DOCR: The DigitalOcean container registry type. - DOCKER_HUB: The DockerHub container registry type. - GHCR: The GitHub container registry type. type ImageSourceSpecRegistryType string // List of ImageSourceSpecRegistryType @@ -1030,6 +1047,7 @@ const ( ImageSourceSpecRegistryType_Unspecified ImageSourceSpecRegistryType = "UNSPECIFIED" ImageSourceSpecRegistryType_DOCR ImageSourceSpecRegistryType = "DOCR" ImageSourceSpecRegistryType_DockerHub ImageSourceSpecRegistryType = "DOCKER_HUB" + ImageSourceSpecRegistryType_Ghcr ImageSourceSpecRegistryType = "GHCR" ) // AppInstanceSize struct for AppInstanceSize diff --git a/vendor/github.com/digitalocean/godo/apps.go b/vendor/github.com/digitalocean/godo/apps.go index 422b48acc..880ce0921 100644 --- a/vendor/github.com/digitalocean/godo/apps.go +++ b/vendor/github.com/digitalocean/godo/apps.go @@ -21,6 +21,8 @@ const ( AppLogTypeDeploy AppLogType = "DEPLOY" // AppLogTypeRun represents run logs. AppLogTypeRun AppLogType = "RUN" + // AppLogTypeRunRestarted represents logs of crashed/restarted instances during runtime. + AppLogTypeRunRestarted AppLogType = "RUN_RESTARTED" ) // AppsService is an interface for interfacing with the App Platform endpoints diff --git a/vendor/github.com/digitalocean/godo/apps_accessors.go b/vendor/github.com/digitalocean/godo/apps_accessors.go index 486c75973..059d64731 100644 --- a/vendor/github.com/digitalocean/godo/apps_accessors.go +++ b/vendor/github.com/digitalocean/godo/apps_accessors.go @@ -757,6 +757,14 @@ func (a *AppDomainValidation) GetTXTValue() string { return a.TXTValue } +// GetType returns the Type field. +func (a *AppEgressSpec) GetType() AppEgressSpecType { + if a == nil { + return "" + } + return a.Type +} + // GetAlerts returns the Alerts field. func (a *AppFunctionsSpec) GetAlerts() []*AppAlertSpec { if a == nil { @@ -1733,6 +1741,14 @@ func (a *AppSpec) GetDomains() []*AppDomainSpec { return a.Domains } +// GetEgress returns the Egress field. +func (a *AppSpec) GetEgress() *AppEgressSpec { + if a == nil { + return nil + } + return a.Egress +} + // GetEnvs returns the Envs field. func (a *AppSpec) GetEnvs() []*AppVariableDefinition { if a == nil { @@ -3189,6 +3205,14 @@ func (i *ImageSourceSpec) GetRegistry() string { return i.Registry } +// GetRegistryCredentials returns the RegistryCredentials field. +func (i *ImageSourceSpec) GetRegistryCredentials() string { + if i == nil { + return "" + } + return i.RegistryCredentials +} + // GetRegistryType returns the RegistryType field. func (i *ImageSourceSpec) GetRegistryType() ImageSourceSpecRegistryType { if i == nil { diff --git a/vendor/github.com/digitalocean/godo/databases.go b/vendor/github.com/digitalocean/godo/databases.go index 4b3749978..54d80e99b 100644 --- a/vendor/github.com/digitalocean/godo/databases.go +++ b/vendor/github.com/digitalocean/godo/databases.go @@ -118,6 +118,7 @@ type DatabasesService interface { GetUser(context.Context, string, string) (*DatabaseUser, *Response, error) ListUsers(context.Context, string, *ListOptions) ([]DatabaseUser, *Response, error) CreateUser(context.Context, string, *DatabaseCreateUserRequest) (*DatabaseUser, *Response, error) + UpdateUser(context.Context, string, string, *DatabaseUpdateUserRequest) (*DatabaseUser, *Response, error) DeleteUser(context.Context, string, string) (*Response, error) ResetUserAuth(context.Context, string, string, *DatabaseResetUserAuthRequest) (*DatabaseUser, *Response, error) ListDBs(context.Context, string, *ListOptions) ([]DatabaseDB, *Response, error) @@ -347,7 +348,6 @@ type TopicConfig struct { SegmentIndexBytes *uint64 `json:"segment_index_bytes,omitempty"` SegmentJitterMS *uint64 `json:"segment_jitter_ms,omitempty"` SegmentMS *uint64 `json:"segment_ms,omitempty"` - UncleanLeaderElectionEnable *bool `json:"unclean_leader_election_enable,omitempty"` } // DatabaseCreateTopicRequest is used to create a new topic within a kafka cluster @@ -413,6 +413,11 @@ type DatabaseCreateUserRequest struct { Settings *DatabaseUserSettings `json:"settings,omitempty"` } +// DatabaseUpdateUserRequest is used to update an existing database user +type DatabaseUpdateUserRequest struct { + Settings *DatabaseUserSettings `json:"settings,omitempty"` +} + // DatabaseResetUserAuthRequest is used to reset a users DB auth type DatabaseResetUserAuthRequest struct { MySQLSettings *DatabaseMySQLUserSettings `json:"mysql_settings,omitempty"` @@ -871,6 +876,21 @@ func (svc *DatabasesServiceOp) CreateUser(ctx context.Context, databaseID string return root.User, resp, nil } +// UpdateUser will update an existing database user +func (svc *DatabasesServiceOp) UpdateUser(ctx context.Context, databaseID, userID string, updateUser *DatabaseUpdateUserRequest) (*DatabaseUser, *Response, error) { + path := fmt.Sprintf(databaseUserPath, databaseID, userID) + req, err := svc.client.NewRequest(ctx, http.MethodPut, path, updateUser) + if err != nil { + return nil, nil, err + } + root := new(databaseUserRoot) + resp, err := svc.client.Do(ctx, req, root) + if err != nil { + return nil, resp, err + } + return root.User, resp, nil +} + // ResetUserAuth will reset user authentication func (svc *DatabasesServiceOp) ResetUserAuth(ctx context.Context, databaseID, userID string, resetAuth *DatabaseResetUserAuthRequest) (*DatabaseUser, *Response, error) { path := fmt.Sprintf(databaseResetUserAuthPath, databaseID, userID) diff --git a/vendor/github.com/digitalocean/godo/godo.go b/vendor/github.com/digitalocean/godo/godo.go index e3f2ec2c5..e73738976 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.105.0" + libraryVersion = "1.107.0" defaultBaseURL = "https://api.digitalocean.com/" userAgent = "godo/" + libraryVersion mediaType = "application/json" @@ -348,6 +348,16 @@ func New(httpClient *http.Client, opts ...ClientOpt) (*Client, error) { return resp, err } + retryableClient.CheckRetry = func(ctx context.Context, resp *http.Response, err error) (bool, error) { + // In addition to the default retry policy, we also retry HTTP/2 INTERNAL_ERROR errors. + // See: https://github.com/golang/go/issues/51323 + if err != nil && strings.Contains(err.Error(), "INTERNAL_ERROR") && strings.Contains(reflect.TypeOf(err).String(), "http2") { + return true, nil + } + + return retryablehttp.DefaultRetryPolicy(ctx, resp, err) + } + var source *oauth2.Transport if _, ok := c.HTTPClient.Transport.(*oauth2.Transport); ok { source = c.HTTPClient.Transport.(*oauth2.Transport) diff --git a/vendor/modules.txt b/vendor/modules.txt index bd6e847cb..1f7eedbb0 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -55,7 +55,7 @@ github.com/creack/pty # github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc ## explicit github.com/davecgh/go-spew/spew -# github.com/digitalocean/godo v1.105.0 +# github.com/digitalocean/godo v1.107.0 ## explicit; go 1.20 github.com/digitalocean/godo github.com/digitalocean/godo/metrics