diff --git a/go.mod b/go.mod index 0de693c53..c3fb8f96a 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22 require ( github.com/blang/semver v3.5.1+incompatible github.com/creack/pty v1.1.21 - github.com/digitalocean/godo v1.131.1 + github.com/digitalocean/godo v1.134.0 github.com/docker/cli v24.0.5+incompatible github.com/docker/docker v25.0.6+incompatible github.com/docker/docker-credential-helpers v0.7.0 // indirect @@ -30,7 +30,7 @@ require ( github.com/stretchr/testify v1.8.4 golang.org/x/crypto v0.22.0 golang.org/x/net v0.24.0 // indirect - golang.org/x/oauth2 v0.24.0 + golang.org/x/oauth2 v0.25.0 golang.org/x/sys v0.25.0 gopkg.in/yaml.v2 v2.4.0 k8s.io/api v0.26.2 @@ -122,7 +122,7 @@ require ( go.opentelemetry.io/otel/trace v1.19.0 // indirect golang.org/x/mod v0.11.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/time v0.8.0 // indirect + golang.org/x/time v0.9.0 // indirect golang.org/x/tools v0.10.0 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/go.sum b/go.sum index 45f5e393f..7cd3d7559 100644 --- a/go.sum +++ b/go.sum @@ -91,8 +91,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.131.1 h1:2QsRwjNukKgOQbflMxOsTDoC05o5UKBpqQMFKXegYKE= -github.com/digitalocean/godo v1.131.1/go.mod h1:PU8JB6I1XYkQIdHFop8lLAY9ojp6M0XcU0TWaQSxbrc= +github.com/digitalocean/godo v1.134.0 h1:dT7aQR9jxNOQEZwzP+tAYcxlj5szFZScC33+PAYGQVM= +github.com/digitalocean/godo v1.134.0/go.mod h1:PU8JB6I1XYkQIdHFop8lLAY9ojp6M0XcU0TWaQSxbrc= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/docker/cli v24.0.5+incompatible h1:WeBimjvS0eKdH4Ygx+ihVq1Q++xg36M/rMi4aXAvodc= @@ -517,8 +517,8 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= -golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70= +golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -599,8 +599,8 @@ golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= -golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= +golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= diff --git a/vendor/github.com/digitalocean/godo/CHANGELOG.md b/vendor/github.com/digitalocean/godo/CHANGELOG.md index 8b177989d..091f2ec8a 100644 --- a/vendor/github.com/digitalocean/godo/CHANGELOG.md +++ b/vendor/github.com/digitalocean/godo/CHANGELOG.md @@ -1,5 +1,16 @@ # Change Log +## [v1.134.0] - 2025-01-15 +- #771 - @d-honeybadger - add ID field to KubernetesClusterUser response +- #768 - @lee-aaron - support Spaces Keys API + +## [v1.133.0] - 2025-01-10 +- #769 - @guptado - support partner interconnect attachment operations +- #767 - @loosla - [kubernetes]: make kubernetes maintenance_policy day case insensitive + +## [v1.132.0] - 2024-12-17 +- #764 - @greeshmapill - APPS-9365: Add bitbucket source to App Spec + ## [v1.131.1] - 2024-12-10 - #762 - @imaskm - Updated list ipv6 response diff --git a/vendor/github.com/digitalocean/godo/apps.gen.go b/vendor/github.com/digitalocean/godo/apps.gen.go index 6fc029cb9..63457cda4 100644 --- a/vendor/github.com/digitalocean/godo/apps.gen.go +++ b/vendor/github.com/digitalocean/godo/apps.gen.go @@ -285,10 +285,11 @@ const ( // AppFunctionsSpec struct for AppFunctionsSpec type AppFunctionsSpec struct { // The name. Must be unique across all components within the same app. - Name string `json:"name"` - Git *GitSourceSpec `json:"git,omitempty"` - GitHub *GitHubSourceSpec `json:"github,omitempty"` - GitLab *GitLabSourceSpec `json:"gitlab,omitempty"` + Name string `json:"name"` + Git *GitSourceSpec `json:"git,omitempty"` + GitHub *GitHubSourceSpec `json:"github,omitempty"` + GitLab *GitLabSourceSpec `json:"gitlab,omitempty"` + Bitbucket *BitbucketSourceSpec `json:"bitbucket,omitempty"` // An optional path to the working directory to use for the build. Must be relative to the root of the repo. SourceDir string `json:"source_dir,omitempty"` // A list of environment variables made available to the component. @@ -365,11 +366,12 @@ type AppIngressSpecRuleStringMatch struct { // AppJobSpec struct for AppJobSpec type AppJobSpec struct { // The name. Must be unique across all components within the same app. - Name string `json:"name"` - Git *GitSourceSpec `json:"git,omitempty"` - GitHub *GitHubSourceSpec `json:"github,omitempty"` - Image *ImageSourceSpec `json:"image,omitempty"` - GitLab *GitLabSourceSpec `json:"gitlab,omitempty"` + Name string `json:"name"` + Git *GitSourceSpec `json:"git,omitempty"` + GitHub *GitHubSourceSpec `json:"github,omitempty"` + Image *ImageSourceSpec `json:"image,omitempty"` + GitLab *GitLabSourceSpec `json:"gitlab,omitempty"` + Bitbucket *BitbucketSourceSpec `json:"bitbucket,omitempty"` // The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks. DockerfilePath string `json:"dockerfile_path,omitempty"` // An optional build command to run while building this component from source. @@ -481,11 +483,12 @@ type AppRouteSpec struct { // AppServiceSpec struct for AppServiceSpec type AppServiceSpec struct { // The name. Must be unique across all components within the same app. - Name string `json:"name"` - Git *GitSourceSpec `json:"git,omitempty"` - GitHub *GitHubSourceSpec `json:"github,omitempty"` - Image *ImageSourceSpec `json:"image,omitempty"` - GitLab *GitLabSourceSpec `json:"gitlab,omitempty"` + Name string `json:"name"` + Git *GitSourceSpec `json:"git,omitempty"` + GitHub *GitHubSourceSpec `json:"github,omitempty"` + Image *ImageSourceSpec `json:"image,omitempty"` + GitLab *GitLabSourceSpec `json:"gitlab,omitempty"` + Bitbucket *BitbucketSourceSpec `json:"bitbucket,omitempty"` // The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks. DockerfilePath string `json:"dockerfile_path,omitempty"` // An optional build command to run while building this component from source. @@ -578,10 +581,11 @@ type AppSpec struct { // AppStaticSiteSpec struct for AppStaticSiteSpec type AppStaticSiteSpec struct { // The name. Must be unique across all components within the same app. - Name string `json:"name"` - Git *GitSourceSpec `json:"git,omitempty"` - GitHub *GitHubSourceSpec `json:"github,omitempty"` - GitLab *GitLabSourceSpec `json:"gitlab,omitempty"` + Name string `json:"name"` + Git *GitSourceSpec `json:"git,omitempty"` + GitHub *GitHubSourceSpec `json:"github,omitempty"` + GitLab *GitLabSourceSpec `json:"gitlab,omitempty"` + Bitbucket *BitbucketSourceSpec `json:"bitbucket,omitempty"` // The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks. DockerfilePath string `json:"dockerfile_path,omitempty"` // An optional build command to run while building this component from source. @@ -617,11 +621,12 @@ type AppVariableDefinition struct { // AppWorkerSpec struct for AppWorkerSpec type AppWorkerSpec struct { // The name. Must be unique across all components within the same app. - Name string `json:"name"` - Git *GitSourceSpec `json:"git,omitempty"` - GitHub *GitHubSourceSpec `json:"github,omitempty"` - Image *ImageSourceSpec `json:"image,omitempty"` - GitLab *GitLabSourceSpec `json:"gitlab,omitempty"` + Name string `json:"name"` + Git *GitSourceSpec `json:"git,omitempty"` + GitHub *GitHubSourceSpec `json:"github,omitempty"` + Image *ImageSourceSpec `json:"image,omitempty"` + GitLab *GitLabSourceSpec `json:"gitlab,omitempty"` + Bitbucket *BitbucketSourceSpec `json:"bitbucket,omitempty"` // The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks. DockerfilePath string `json:"dockerfile_path,omitempty"` // An optional build command to run while building this component from source. @@ -651,6 +656,13 @@ type AppWorkerSpecTermination struct { GracePeriodSeconds int32 `json:"grace_period_seconds,omitempty"` } +// BitbucketSourceSpec struct for BitbucketSourceSpec +type BitbucketSourceSpec struct { + Repo string `json:"repo,omitempty"` + Branch string `json:"branch,omitempty"` + DeployOnPush bool `json:"deploy_on_push,omitempty"` +} + // Buildpack struct for Buildpack type Buildpack struct { // The ID of the buildpack. @@ -702,12 +714,13 @@ type DeploymentCauseDetailsDOCRPush struct { // DeploymentCauseDetailsGitPush struct for DeploymentCauseDetailsGitPush type DeploymentCauseDetailsGitPush struct { - GitHub *GitHubSourceSpec `json:"github,omitempty"` - GitLab *GitLabSourceSpec `json:"gitlab,omitempty"` - Username string `json:"username,omitempty"` - CommitAuthor string `json:"commit_author,omitempty"` - CommitSHA string `json:"commit_sha,omitempty"` - CommitMessage string `json:"commit_message,omitempty"` + GitHub *GitHubSourceSpec `json:"github,omitempty"` + GitLab *GitLabSourceSpec `json:"gitlab,omitempty"` + Bitbucket *BitbucketSourceSpec `json:"bitbucket,omitempty"` + Username string `json:"username,omitempty"` + CommitAuthor string `json:"commit_author,omitempty"` + CommitSHA string `json:"commit_sha,omitempty"` + CommitMessage string `json:"commit_message,omitempty"` } // AppCORSPolicy struct for AppCORSPolicy @@ -911,9 +924,10 @@ type DeploymentWorker struct { // DetectRequest struct for DetectRequest type DetectRequest struct { - Git *GitSourceSpec `json:"git,omitempty"` - GitHub *GitHubSourceSpec `json:"github,omitempty"` - GitLab *GitLabSourceSpec `json:"gitlab,omitempty"` + Git *GitSourceSpec `json:"git,omitempty"` + GitHub *GitHubSourceSpec `json:"github,omitempty"` + GitLab *GitLabSourceSpec `json:"gitlab,omitempty"` + Bitbucket *BitbucketSourceSpec `json:"bitbucket,omitempty"` // An optional commit hash to use instead of the branch specified in the source spec. CommitSHA string `json:"commit_sha,omitempty"` // An optional path to the working directory for the detection process. diff --git a/vendor/github.com/digitalocean/godo/apps.go b/vendor/github.com/digitalocean/godo/apps.go index 97b0cbd73..f6b78d904 100644 --- a/vendor/github.com/digitalocean/godo/apps.go +++ b/vendor/github.com/digitalocean/godo/apps.go @@ -689,6 +689,7 @@ type AppBuildableComponentSpec interface { GetGit() *GitSourceSpec GetGitHub() *GitHubSourceSpec GetGitLab() *GitLabSourceSpec + GetBitbucket() *BitbucketSourceSpec GetSourceDir() string @@ -731,10 +732,11 @@ type AppRoutableComponentSpec interface { type AppSourceType string const ( - AppSourceTypeGitHub AppSourceType = "github" - AppSourceTypeGitLab AppSourceType = "gitlab" - AppSourceTypeGit AppSourceType = "git" - AppSourceTypeImage AppSourceType = "image" + AppSourceTypeBitbucket AppSourceType = "bitbucket" + AppSourceTypeGitHub AppSourceType = "github" + AppSourceTypeGitLab AppSourceType = "gitlab" + AppSourceTypeGit AppSourceType = "git" + AppSourceTypeImage AppSourceType = "image" ) // SourceSpec represents a source. @@ -742,6 +744,11 @@ type SourceSpec interface { GetType() AppSourceType } +// GetType returns the Bitbucket source type. +func (s *BitbucketSourceSpec) GetType() AppSourceType { + return AppSourceTypeBitbucket +} + // GetType returns the GitHub source type. func (s *GitHubSourceSpec) GetType() AppSourceType { return AppSourceTypeGitHub diff --git a/vendor/github.com/digitalocean/godo/apps_accessors.go b/vendor/github.com/digitalocean/godo/apps_accessors.go index 02e7c4b15..4d9a214ae 100644 --- a/vendor/github.com/digitalocean/godo/apps_accessors.go +++ b/vendor/github.com/digitalocean/godo/apps_accessors.go @@ -805,6 +805,14 @@ func (a *AppFunctionsSpec) GetAlerts() []*AppAlertSpec { return a.Alerts } +// GetBitbucket returns the Bitbucket field. +func (a *AppFunctionsSpec) GetBitbucket() *BitbucketSourceSpec { + if a == nil { + return nil + } + return a.Bitbucket +} + // GetCORS returns the CORS field. func (a *AppFunctionsSpec) GetCORS() *AppCORSPolicy { if a == nil { @@ -1141,6 +1149,14 @@ func (a *AppJobSpec) GetAlerts() []*AppAlertSpec { return a.Alerts } +// GetBitbucket returns the Bitbucket field. +func (a *AppJobSpec) GetBitbucket() *BitbucketSourceSpec { + if a == nil { + return nil + } + return a.Bitbucket +} + // GetBuildCommand returns the BuildCommand field. func (a *AppJobSpec) GetBuildCommand() string { if a == nil { @@ -1645,6 +1661,14 @@ func (a *AppServiceSpec) GetAutoscaling() *AppAutoscalingSpec { return a.Autoscaling } +// GetBitbucket returns the Bitbucket field. +func (a *AppServiceSpec) GetBitbucket() *BitbucketSourceSpec { + if a == nil { + return nil + } + return a.Bitbucket +} + // GetBuildCommand returns the BuildCommand field. func (a *AppServiceSpec) GetBuildCommand() string { if a == nil { @@ -2013,6 +2037,14 @@ func (a *AppSpec) GetWorkers() []*AppWorkerSpec { return a.Workers } +// GetBitbucket returns the Bitbucket field. +func (a *AppStaticSiteSpec) GetBitbucket() *BitbucketSourceSpec { + if a == nil { + return nil + } + return a.Bitbucket +} + // GetBuildCommand returns the BuildCommand field. func (a *AppStaticSiteSpec) GetBuildCommand() string { if a == nil { @@ -2237,6 +2269,14 @@ func (a *AppWorkerSpec) GetAutoscaling() *AppAutoscalingSpec { return a.Autoscaling } +// GetBitbucket returns the Bitbucket field. +func (a *AppWorkerSpec) GetBitbucket() *BitbucketSourceSpec { + if a == nil { + return nil + } + return a.Bitbucket +} + // GetBuildCommand returns the BuildCommand field. func (a *AppWorkerSpec) GetBuildCommand() string { if a == nil { @@ -2365,6 +2405,30 @@ func (a *AppWorkerSpecTermination) GetGracePeriodSeconds() int32 { return a.GracePeriodSeconds } +// GetBranch returns the Branch field. +func (b *BitbucketSourceSpec) GetBranch() string { + if b == nil { + return "" + } + return b.Branch +} + +// GetDeployOnPush returns the DeployOnPush field. +func (b *BitbucketSourceSpec) GetDeployOnPush() bool { + if b == nil { + return false + } + return b.DeployOnPush +} + +// GetRepo returns the Repo field. +func (b *BitbucketSourceSpec) GetRepo() string { + if b == nil { + return "" + } + return b.Repo +} + // GetDescription returns the Description field. func (b *Buildpack) GetDescription() []string { if b == nil { @@ -2701,6 +2765,14 @@ func (d *DeploymentCauseDetailsDOCRPush) GetTag() string { return d.Tag } +// GetBitbucket returns the Bitbucket field. +func (d *DeploymentCauseDetailsGitPush) GetBitbucket() *BitbucketSourceSpec { + if d == nil { + return nil + } + return d.Bitbucket +} + // GetCommitAuthor returns the CommitAuthor field. func (d *DeploymentCauseDetailsGitPush) GetCommitAuthor() string { if d == nil { @@ -3077,6 +3149,14 @@ func (d *DeployTemplate) GetSpec() *AppSpec { return d.Spec } +// GetBitbucket returns the Bitbucket field. +func (d *DetectRequest) GetBitbucket() *BitbucketSourceSpec { + if d == nil { + return nil + } + return d.Bitbucket +} + // GetCommitSHA returns the CommitSHA field. func (d *DetectRequest) GetCommitSHA() string { if d == nil { diff --git a/vendor/github.com/digitalocean/godo/godo.go b/vendor/github.com/digitalocean/godo/godo.go index 94d31631a..f3bdca9be 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.131.1" + libraryVersion = "1.134.0" defaultBaseURL = "https://api.digitalocean.com/" userAgent = "godo/" + libraryVersion mediaType = "application/json" @@ -54,45 +54,47 @@ type Client struct { ratemtx sync.Mutex // Services used for communicating with the API - Account AccountService - Actions ActionsService - Apps AppsService - Balance BalanceService - BillingHistory BillingHistoryService - CDNs CDNService - Certificates CertificatesService - Databases DatabasesService - Domains DomainsService - Droplets DropletsService - DropletActions DropletActionsService - DropletAutoscale DropletAutoscaleService - Firewalls FirewallsService - FloatingIPs FloatingIPsService - FloatingIPActions FloatingIPActionsService - Functions FunctionsService - Images ImagesService - ImageActions ImageActionsService - Invoices InvoicesService - Keys KeysService - Kubernetes KubernetesService - LoadBalancers LoadBalancersService - Monitoring MonitoringService - OneClick OneClickService - Projects ProjectsService - Regions RegionsService - Registry RegistryService - Registries RegistriesService - ReservedIPs ReservedIPsService - ReservedIPV6s ReservedIPV6sService - ReservedIPActions ReservedIPActionsService - ReservedIPV6Actions ReservedIPV6ActionsService - Sizes SizesService - Snapshots SnapshotsService - Storage StorageService - StorageActions StorageActionsService - Tags TagsService - UptimeChecks UptimeChecksService - VPCs VPCsService + Account AccountService + Actions ActionsService + Apps AppsService + Balance BalanceService + BillingHistory BillingHistoryService + CDNs CDNService + Certificates CertificatesService + Databases DatabasesService + Domains DomainsService + Droplets DropletsService + DropletActions DropletActionsService + DropletAutoscale DropletAutoscaleService + Firewalls FirewallsService + FloatingIPs FloatingIPsService + FloatingIPActions FloatingIPActionsService + Functions FunctionsService + Images ImagesService + ImageActions ImageActionsService + Invoices InvoicesService + Keys KeysService + Kubernetes KubernetesService + LoadBalancers LoadBalancersService + Monitoring MonitoringService + OneClick OneClickService + Projects ProjectsService + Regions RegionsService + Registry RegistryService + Registries RegistriesService + ReservedIPs ReservedIPsService + ReservedIPV6s ReservedIPV6sService + ReservedIPActions ReservedIPActionsService + ReservedIPV6Actions ReservedIPV6ActionsService + Sizes SizesService + Snapshots SnapshotsService + SpacesKeys SpacesKeysService + Storage StorageService + StorageActions StorageActionsService + Tags TagsService + UptimeChecks UptimeChecksService + VPCs VPCsService + PartnerInterconnectAttachments PartnerInterconnectAttachmentsService // Optional function called after every successful request made to the DO APIs onRequestCompleted RequestCompletionCallback @@ -302,11 +304,13 @@ func NewClient(httpClient *http.Client) *Client { c.ReservedIPV6Actions = &ReservedIPV6ActionsServiceOp{client: c} c.Sizes = &SizesServiceOp{client: c} c.Snapshots = &SnapshotsServiceOp{client: c} + c.SpacesKeys = &SpacesKeysServiceOp{client: c} c.Storage = &StorageServiceOp{client: c} c.StorageActions = &StorageActionsServiceOp{client: c} c.Tags = &TagsServiceOp{client: c} c.UptimeChecks = &UptimeChecksServiceOp{client: c} c.VPCs = &VPCsServiceOp{client: c} + c.PartnerInterconnectAttachments = &PartnerInterconnectAttachmentsServiceOp{client: c} c.headers = make(map[string]string) diff --git a/vendor/github.com/digitalocean/godo/kubernetes.go b/vendor/github.com/digitalocean/godo/kubernetes.go index 9b3bcfa1a..8a4085a07 100644 --- a/vendor/github.com/digitalocean/godo/kubernetes.go +++ b/vendor/github.com/digitalocean/godo/kubernetes.go @@ -223,6 +223,7 @@ func (kc KubernetesCluster) URN() string { // KubernetesClusterUser represents a Kubernetes cluster user. type KubernetesClusterUser struct { + ID string `json:"id,omitempty"` Username string `json:"username,omitempty"` Groups []string `json:"groups,omitempty"` } @@ -315,7 +316,7 @@ var ( // KubernetesMaintenanceToDay returns the appropriate KubernetesMaintenancePolicyDay for the given string. func KubernetesMaintenanceToDay(day string) (KubernetesMaintenancePolicyDay, error) { - d, ok := toDay[day] + d, ok := toDay[strings.ToLower(day)] if !ok { return 0, fmt.Errorf("unknown day: %q", day) } diff --git a/vendor/github.com/digitalocean/godo/partner_interconnect_attachments.go b/vendor/github.com/digitalocean/godo/partner_interconnect_attachments.go new file mode 100644 index 000000000..87a0e9ed6 --- /dev/null +++ b/vendor/github.com/digitalocean/godo/partner_interconnect_attachments.go @@ -0,0 +1,278 @@ +package godo + +import ( + "context" + "fmt" + "net/http" + "time" +) + +const partnerInterconnectAttachmentsBasePath = "/v2/partner_interconnect/attachments" + +// PartnerInterconnectAttachmentsService is an interface for managing Partner Interconnect Attachments with the +// DigitalOcean API. +// See: https://docs.digitalocean.com/reference/api/api-reference/#tag/PartnerInterconnectAttachments +type PartnerInterconnectAttachmentsService interface { + List(context.Context, *ListOptions) ([]*PartnerInterconnectAttachment, *Response, error) + Create(context.Context, *PartnerInterconnectAttachmentCreateRequest) (*PartnerInterconnectAttachment, *Response, error) + Get(context.Context, string) (*PartnerInterconnectAttachment, *Response, error) + Update(context.Context, string, *PartnerInterconnectAttachmentUpdateRequest) (*PartnerInterconnectAttachment, *Response, error) + Delete(context.Context, string) (*Response, error) + GetServiceKey(context.Context, string) (*ServiceKey, *Response, error) + SetRoutes(context.Context, string, *PartnerInterconnectAttachmentSetRoutesRequest) (*PartnerInterconnectAttachment, *Response, error) + ListRoutes(context.Context, string, *ListOptions) ([]*RemoteRoute, *Response, error) +} + +var _ PartnerInterconnectAttachmentsService = &PartnerInterconnectAttachmentsServiceOp{} + +// PartnerInterconnectAttachmentsServiceOp interfaces with the Partner Interconnect Attachment endpoints in the DigitalOcean API. +type PartnerInterconnectAttachmentsServiceOp struct { + client *Client +} + +// PartnerInterconnectAttachmentCreateRequest represents a request to create a Partner Interconnect Attachment. +type PartnerInterconnectAttachmentCreateRequest 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"` +} + +// PartnerInterconnectAttachmentUpdateRequest represents a request to update a Partner Interconnect Attachment. +type PartnerInterconnectAttachmentUpdateRequest struct { + // Name is the name of the Partner Interconnect Attachment + Name string `json:"name,omitempty"` + //VPCIDs is the IDs of the VPCs to which the Partner Interconnect Attachment is connected + VPCIDs []string `json:"vpc_ids,omitempty"` +} + +type PartnerInterconnectAttachmentSetRoutesRequest struct { + // Routes is the list of routes to be used for the Partner Interconnect Attachment + Routes []string `json:"routes,omitempty"` +} + +// BGP represents the BGP configuration of a Partner Interconnect Attachment. +type BGP struct { + // LocalASN is the local ASN + LocalASN int `json:"local_asn,omitempty"` + // LocalRouterIP is the local router IP + LocalRouterIP string `json:"local_router_ip,omitempty"` + // PeerASN is the peer ASN + PeerASN int `json:"peer_asn,omitempty"` + // PeerRouterIP is the peer router IP + PeerRouterIP string `json:"peer_router_ip,omitempty"` +} + +// ServiceKey represents the service key of a Partner Interconnect Attachment. +type ServiceKey struct { + ServiceKey string `json:"service_key,omitempty"` +} + +// RemoteRoute represents a route for a Partner Interconnect Attachment. +type RemoteRoute struct { + // ID is the generated ID of the Route + ID string `json:"id,omitempty"` + // Cidr is the CIDR of the route + Cidr string `json:"cidr,omitempty"` +} + +// PartnerInterconnectAttachment represents a DigitalOcean Partner Interconnect Attachment. +type PartnerInterconnectAttachment struct { + // ID is the generated ID of the Partner Interconnect Attachment + ID string `json:"id,omitempty"` + // Name is the name of the Partner Interconnect Attachment + Name string `json:"name,omitempty"` + // State is the state of the Partner Interconnect Attachment + State string `json:"state,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"` + // CreatedAt is time when this Partner Interconnect Attachment was first created + CreatedAt time.Time `json:"created_at,omitempty"` +} + +type partnerInterconnectAttachmentRoot struct { + PartnerInterconnectAttachment *PartnerInterconnectAttachment `json:"partner_interconnect_attachment"` +} + +type partnerInterconnectAttachmentsRoot struct { + PartnerInterconnectAttachments []*PartnerInterconnectAttachment `json:"partner_interconnect_attachments"` + Links *Links `json:"links"` + Meta *Meta `json:"meta"` +} + +type serviceKeyRoot struct { + ServiceKey *ServiceKey `json:"service_key"` +} + +type remoteRoutesRoot struct { + RemoteRoutes []*RemoteRoute `json:"remote_routes"` + Links *Links `json:"links"` + Meta *Meta `json:"meta"` +} + +// List returns a list of all Partner Interconnect Attachments, with optional pagination. +func (s *PartnerInterconnectAttachmentsServiceOp) List(ctx context.Context, opt *ListOptions) ([]*PartnerInterconnectAttachment, *Response, error) { + path, err := addOptions(partnerInterconnectAttachmentsBasePath, opt) + 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(partnerInterconnectAttachmentsRoot) + resp, err := s.client.Do(ctx, req, root) + if err != nil { + return nil, resp, err + } + if l := root.Links; l != nil { + resp.Links = l + } + if m := root.Meta; m != nil { + resp.Meta = m + } + return root.PartnerInterconnectAttachments, resp, nil +} + +// 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) + if err != nil { + return nil, nil, err + } + + root := new(partnerInterconnectAttachmentRoot) + resp, err := s.client.Do(ctx, req, root) + if err != nil { + return nil, resp, err + } + + return root.PartnerInterconnectAttachment, resp, nil +} + +// Get returns the details of a Partner Interconnect Attachment. +func (s *PartnerInterconnectAttachmentsServiceOp) Get(ctx context.Context, id string) (*PartnerInterconnectAttachment, *Response, error) { + path := fmt.Sprintf("%s/%s", partnerInterconnectAttachmentsBasePath, id) + req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) + if err != nil { + return nil, nil, err + } + + root := new(partnerInterconnectAttachmentRoot) + resp, err := s.client.Do(ctx, req, root) + if err != nil { + return nil, resp, err + } + + return root.PartnerInterconnectAttachment, resp, nil +} + +// Update updates a Partner Interconnect Attachment properties. +func (s *PartnerInterconnectAttachmentsServiceOp) Update(ctx context.Context, id string, update *PartnerInterconnectAttachmentUpdateRequest) (*PartnerInterconnectAttachment, *Response, error) { + path := fmt.Sprintf("%s/%s", partnerInterconnectAttachmentsBasePath, id) + req, err := s.client.NewRequest(ctx, http.MethodPatch, path, update) + if err != nil { + return nil, nil, err + } + + root := new(partnerInterconnectAttachmentRoot) + resp, err := s.client.Do(ctx, req, root) + if err != nil { + return nil, resp, err + } + + return root.PartnerInterconnectAttachment, resp, nil +} + +// Delete deletes a Partner Interconnect Attachment. +func (s *PartnerInterconnectAttachmentsServiceOp) Delete(ctx context.Context, id string) (*Response, error) { + path := fmt.Sprintf("%s/%s", partnerInterconnectAttachmentsBasePath, id) + 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 +} + +func (s *PartnerInterconnectAttachmentsServiceOp) GetServiceKey(ctx context.Context, id string) (*ServiceKey, *Response, error) { + path := fmt.Sprintf("%s/%s/service_key", partnerInterconnectAttachmentsBasePath, id) + req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil) + if err != nil { + return nil, nil, err + } + + root := new(serviceKeyRoot) + resp, err := s.client.Do(ctx, req, root) + if err != nil { + return nil, resp, err + } + + return root.ServiceKey, resp, nil +} + +// ListRoutes lists all routes for a Partner Interconnect Attachment. +func (s *PartnerInterconnectAttachmentsServiceOp) ListRoutes(ctx context.Context, id string, opt *ListOptions) ([]*RemoteRoute, *Response, error) { + path, err := addOptions(fmt.Sprintf("%s/%s/remote_routes", partnerInterconnectAttachmentsBasePath, id), opt) + 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(remoteRoutesRoot) + resp, err := s.client.Do(ctx, req, root) + if err != nil { + return nil, resp, err + } + if l := root.Links; l != nil { + resp.Links = l + } + if m := root.Meta; m != nil { + resp.Meta = m + } + + return root.RemoteRoutes, resp, nil +} + +// SetRoutes updates specific properties of a Partner Interconnect Attachment. +func (s *PartnerInterconnectAttachmentsServiceOp) SetRoutes(ctx context.Context, id string, set *PartnerInterconnectAttachmentSetRoutesRequest) (*PartnerInterconnectAttachment, *Response, error) { + path := fmt.Sprintf("%s/%s/remote_routes", partnerInterconnectAttachmentsBasePath, id) + req, err := s.client.NewRequest(ctx, http.MethodPut, path, set) + if err != nil { + return nil, nil, err + } + + root := new(partnerInterconnectAttachmentRoot) + resp, err := s.client.Do(ctx, req, root) + if err != nil { + return nil, resp, err + } + + return root.PartnerInterconnectAttachment, resp, nil +} diff --git a/vendor/github.com/digitalocean/godo/spaces_keys.go b/vendor/github.com/digitalocean/godo/spaces_keys.go new file mode 100644 index 000000000..371d8a142 --- /dev/null +++ b/vendor/github.com/digitalocean/godo/spaces_keys.go @@ -0,0 +1,165 @@ +package godo + +import ( + "context" + "fmt" + "net/http" +) + +const spacesKeysBasePath = "v2/spaces/keys" + +// SpacesKeysService is an interface for managing Spaces keys with the DigitalOcean API. +type SpacesKeysService interface { + List(context.Context, *ListOptions) ([]*SpacesKey, *Response, error) + Update(context.Context, string, *SpacesKeyUpdateRequest) (*SpacesKey, *Response, error) + Create(context.Context, *SpacesKeyCreateRequest) (*SpacesKey, *Response, error) + Delete(context.Context, string) (*Response, error) +} + +// SpacesKeysServiceOp handles communication with the Spaces key related methods of the +// DigitalOcean API. +type SpacesKeysServiceOp struct { + client *Client +} + +var _ SpacesKeysService = &SpacesKeysServiceOp{} + +// SpacesKeyPermission represents a permission for a Spaces grant +type SpacesKeyPermission string + +const ( + // SpacesKeyRead grants read-only access to the Spaces bucket + SpacesKeyRead SpacesKeyPermission = "read" + // SpacesKeyReadWrite grants read and write access to the Spaces bucket + SpacesKeyReadWrite SpacesKeyPermission = "readwrite" + // SpacesKeyFullAccess grants full access to the Spaces bucket + SpacesKeyFullAccess SpacesKeyPermission = "fullaccess" +) + +// Grant represents a Grant for a Spaces key +type Grant struct { + Bucket string `json:"bucket"` + Permission SpacesKeyPermission `json:"permission"` +} + +// SpacesKey represents a DigitalOcean Spaces key +type SpacesKey struct { + Name string `json:"name"` + AccessKey string `json:"access_key"` + SecretKey string `json:"secret_key"` + Grants []*Grant `json:"grants"` + CreatedAt string `json:"created_at"` +} + +// SpacesKeyRoot represents a response from the DigitalOcean API +type spacesKeyRoot struct { + Key *SpacesKey `json:"key"` +} + +// SpacesKeyCreateRequest represents a request to create a Spaces key. +type SpacesKeyCreateRequest struct { + Name string `json:"name"` + Grants []*Grant `json:"grants"` +} + +// SpacesKeyUpdateRequest represents a request to update a Spaces key. +type SpacesKeyUpdateRequest struct { + Name string `json:"name"` + Grants []*Grant `json:"grants"` +} + +// spacesListKeysRoot represents a response from the DigitalOcean API +type spacesListKeysRoot struct { + Keys []*SpacesKey `json:"keys,omitempty"` + Links *Links `json:"links,omitempty"` + Meta *Meta `json:"meta"` +} + +// Create creates a new Spaces key. +func (s *SpacesKeysServiceOp) Create(ctx context.Context, createRequest *SpacesKeyCreateRequest) (*SpacesKey, *Response, error) { + if createRequest == nil { + return nil, nil, NewArgError("createRequest", "cannot be nil") + } + + req, err := s.client.NewRequest(ctx, http.MethodPost, spacesKeysBasePath, createRequest) + if err != nil { + return nil, nil, err + } + + root := new(spacesKeyRoot) + resp, err := s.client.Do(ctx, req, root) + if err != nil { + return nil, resp, err + } + + return root.Key, resp, nil +} + +// Delete deletes a Spaces key. +func (s *SpacesKeysServiceOp) Delete(ctx context.Context, accessKey string) (*Response, error) { + if accessKey == "" { + return nil, NewArgError("accessKey", "cannot be empty") + } + + path := fmt.Sprintf("%s/%s", spacesKeysBasePath, accessKey) + 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 +} + +// Update updates a Spaces key. +func (s *SpacesKeysServiceOp) Update(ctx context.Context, accessKey string, updateRequest *SpacesKeyUpdateRequest) (*SpacesKey, *Response, error) { + if accessKey == "" { + return nil, nil, NewArgError("accessKey", "cannot be empty") + } + if updateRequest == nil { + return nil, nil, NewArgError("updateRequest", "cannot be nil") + } + + path := fmt.Sprintf("%s/%s", spacesKeysBasePath, accessKey) + req, err := s.client.NewRequest(ctx, http.MethodPut, path, updateRequest) + if err != nil { + return nil, nil, err + } + root := new(spacesKeyRoot) + resp, err := s.client.Do(ctx, req, root) + if err != nil { + return nil, resp, err + } + + return root.Key, resp, nil +} + +// List returns a list of Spaces keys. +func (s *SpacesKeysServiceOp) List(ctx context.Context, opts *ListOptions) ([]*SpacesKey, *Response, error) { + path, err := addOptions(spacesKeysBasePath, opts) + 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(spacesListKeysRoot) + 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.Keys, resp, nil +} diff --git a/vendor/golang.org/x/oauth2/oauth2.go b/vendor/golang.org/x/oauth2/oauth2.go index 09f6a49b8..74f052aa9 100644 --- a/vendor/golang.org/x/oauth2/oauth2.go +++ b/vendor/golang.org/x/oauth2/oauth2.go @@ -56,7 +56,7 @@ type Config struct { // the OAuth flow, after the resource owner's URLs. RedirectURL string - // Scope specifies optional requested permissions. + // Scopes specifies optional requested permissions. Scopes []string // authStyleCache caches which auth style to use when Endpoint.AuthStyle is diff --git a/vendor/modules.txt b/vendor/modules.txt index db1c338c1..24574b911 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -61,7 +61,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.131.1 +# github.com/digitalocean/godo v1.134.0 ## explicit; go 1.22 github.com/digitalocean/godo github.com/digitalocean/godo/metrics @@ -439,7 +439,7 @@ golang.org/x/net/http2/hpack golang.org/x/net/idna golang.org/x/net/internal/socks golang.org/x/net/proxy -# golang.org/x/oauth2 v0.24.0 +# golang.org/x/oauth2 v0.25.0 ## explicit; go 1.18 golang.org/x/oauth2 golang.org/x/oauth2/internal @@ -462,7 +462,7 @@ golang.org/x/text/secure/bidirule golang.org/x/text/transform golang.org/x/text/unicode/bidi golang.org/x/text/unicode/norm -# golang.org/x/time v0.8.0 +# golang.org/x/time v0.9.0 ## explicit; go 1.18 golang.org/x/time/rate # golang.org/x/tools v0.10.0