diff --git a/commands/billing_history_test.go b/commands/billing_history_test.go index 62b4f3931..59bdd9056 100644 --- a/commands/billing_history_test.go +++ b/commands/billing_history_test.go @@ -28,8 +28,8 @@ var testBillingHistoryList = &do.BillingHistory{ { Description: "Invoice for May 2018", Amount: "12.34", - InvoiceID: godo.String("123"), - InvoiceUUID: godo.String("example-uuid"), + InvoiceID: godo.PtrTo("123"), + InvoiceUUID: godo.PtrTo("example-uuid"), Date: time.Date(2018, 6, 1, 8, 44, 38, 0, time.UTC), Type: "Invoice", }, diff --git a/commands/registry.go b/commands/registry.go index 035b3a8c6..6cfcb9f51 100644 --- a/commands/registry.go +++ b/commands/registry.go @@ -405,10 +405,10 @@ func RunRegistryLogin(c *CmdConfig) error { regCredReq := godo.RegistryDockerCredentialsRequest{ ReadWrite: !readOnly, - ExpirySeconds: godo.Int(defaultRegistryAPITokenExpirySeconds), + ExpirySeconds: godo.PtrTo(defaultRegistryAPITokenExpirySeconds), } if expirySeconds != 0 { - regCredReq.ExpirySeconds = godo.Int(expirySeconds) + regCredReq.ExpirySeconds = godo.PtrTo(expirySeconds) } if neverExpire { regCredReq.ExpirySeconds = nil @@ -548,7 +548,7 @@ func RunDockerConfig(c *CmdConfig) error { ReadWrite: readWrite, } if expirySeconds != 0 { - regCredReq.ExpirySeconds = godo.Int(expirySeconds) + regCredReq.ExpirySeconds = godo.PtrTo(expirySeconds) } dockerCreds, err := c.Registry().DockerCredentials(®CredReq) diff --git a/commands/registry_test.go b/commands/registry_test.go index fac7e0b1b..2008b1717 100644 --- a/commands/registry_test.go +++ b/commands/registry_test.go @@ -247,7 +247,7 @@ func TestDockerConfig(t *testing.T) { expect: func(m *mocks.MockRegistryService) { m.EXPECT().DockerCredentials(&godo.RegistryDockerCredentialsRequest{ ReadWrite: false, - ExpirySeconds: godo.Int(3600), + ExpirySeconds: godo.PtrTo(3600), }).Return(testDockerCredentials, nil) }, }, @@ -258,7 +258,7 @@ func TestDockerConfig(t *testing.T) { expect: func(m *mocks.MockRegistryService) { m.EXPECT().DockerCredentials(&godo.RegistryDockerCredentialsRequest{ ReadWrite: true, - ExpirySeconds: godo.Int(3600), + ExpirySeconds: godo.PtrTo(3600), }).Return(testDockerCredentials, nil) }, }, @@ -662,7 +662,7 @@ func TestRegistryLogin(t *testing.T) { m.EXPECT().Endpoint().Return(do.RegistryHostname) m.EXPECT().DockerCredentials(&godo.RegistryDockerCredentialsRequest{ ReadWrite: true, - ExpirySeconds: godo.Int(3600), + ExpirySeconds: godo.PtrTo(3600), }).Return(testDockerCredentials, nil) }, }, @@ -674,7 +674,7 @@ func TestRegistryLogin(t *testing.T) { m.EXPECT().Endpoint().Return(do.RegistryHostname) m.EXPECT().DockerCredentials(&godo.RegistryDockerCredentialsRequest{ ReadWrite: false, - ExpirySeconds: godo.Int(defaultRegistryAPITokenExpirySeconds), + ExpirySeconds: godo.PtrTo(defaultRegistryAPITokenExpirySeconds), }).Return(testDockerCredentials, nil) }, }, diff --git a/go.mod b/go.mod index 1b940a4d8..f1938384a 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.103.0 + github.com/digitalocean/godo v1.104.0 github.com/docker/cli v24.0.5+incompatible github.com/docker/docker v24.0.5+incompatible github.com/docker/docker-credential-helpers v0.7.0 // indirect diff --git a/go.sum b/go.sum index a9cb9a524..a4d81f799 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.103.0 h1:ynhlulyoBN+VvQ/yquIsh93DlY3lZxmcwgiw3XrsAyQ= -github.com/digitalocean/godo v1.103.0/go.mod h1:rUTTOeu4ozN+i3BnyQasMpDyhIVIefANbc4dYe6v6N0= +github.com/digitalocean/godo v1.104.0 h1:bIOKADMS9hKn/qqgbquCmCAUIrZ5dkthdyy9MsdPx8E= +github.com/digitalocean/godo v1.104.0/go.mod h1:rUTTOeu4ozN+i3BnyQasMpDyhIVIefANbc4dYe6v6N0= 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 8062f7b93..1c292f4c4 100644 --- a/vendor/github.com/digitalocean/godo/CHANGELOG.md +++ b/vendor/github.com/digitalocean/godo/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## [v1.104.0] - 2023-10-10 + +- #637 - @mikesmithgh - chore: change uptime alert comparison type +- #638 - @markusthoemmes - APPS-7700 Add ability to specify digest for an image + ## [v1.103.0] - 2023-10-03 - #635 - @andrewsomething - Bump github.com/stretchr/testify to v1.8.4 diff --git a/vendor/github.com/digitalocean/godo/apps.gen.go b/vendor/github.com/digitalocean/godo/apps.gen.go index 8bb88858d..a3c89faee 100644 --- a/vendor/github.com/digitalocean/godo/apps.gen.go +++ b/vendor/github.com/digitalocean/godo/apps.gen.go @@ -975,14 +975,16 @@ type ImageSourceSpec struct { Registry string `json:"registry,omitempty"` // The repository name. Repository string `json:"repository,omitempty"` - // The repository tag. Defaults to `latest` if not provided. - Tag string `json:"tag,omitempty"` + // 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"` } // ImageSourceSpecDeployOnPush struct for ImageSourceSpecDeployOnPush type ImageSourceSpecDeployOnPush struct { - // Automatically deploy new images. Only for DOCR images. + // Automatically deploy new images. Only for DOCR images. Can't be enabled when a specific digest is specified. Enabled bool `json:"enabled,omitempty"` } diff --git a/vendor/github.com/digitalocean/godo/apps_accessors.go b/vendor/github.com/digitalocean/godo/apps_accessors.go index 82bba4347..85a34638e 100644 --- a/vendor/github.com/digitalocean/godo/apps_accessors.go +++ b/vendor/github.com/digitalocean/godo/apps_accessors.go @@ -3094,6 +3094,14 @@ func (i *ImageSourceSpec) GetDeployOnPush() *ImageSourceSpecDeployOnPush { return i.DeployOnPush } +// GetDigest returns the Digest field. +func (i *ImageSourceSpec) GetDigest() string { + if i == nil { + return "" + } + return i.Digest +} + // GetRegistry returns the Registry field. func (i *ImageSourceSpec) GetRegistry() string { if i == nil { diff --git a/vendor/github.com/digitalocean/godo/uptime.go b/vendor/github.com/digitalocean/godo/uptime.go index 915d6c713..f312e0e88 100644 --- a/vendor/github.com/digitalocean/godo/uptime.go +++ b/vendor/github.com/digitalocean/godo/uptime.go @@ -7,7 +7,13 @@ import ( "path" ) -const uptimeChecksBasePath = "/v2/uptime/checks" +const ( + uptimeChecksBasePath = "/v2/uptime/checks" + // UptimeAlertGreaterThan is the comparison > + UptimeAlertGreaterThan UptimeAlertComp = "greater_than" + // UptimeAlertLessThan is the comparison < + UptimeAlertLessThan UptimeAlertComp = "less_than" +) // UptimeChecksService is an interface for creating and managing Uptime checks with the DigitalOcean API. // See: https://docs.digitalocean.com/reference/api/api-reference/#tag/Uptime @@ -42,13 +48,13 @@ type UptimeCheck struct { // UptimeAlert represents a DigitalOcean Uptime Alert configuration. type UptimeAlert struct { - ID string `json:"id"` - Name string `json:"name"` - Type string `json:"type"` - Threshold int `json:"threshold"` - Comparison string `json:"comparison"` - Notifications *Notifications `json:"notifications"` - Period string `json:"period"` + ID string `json:"id"` + Name string `json:"name"` + Type string `json:"type"` + Threshold int `json:"threshold"` + Comparison UptimeAlertComp `json:"comparison"` + Notifications *Notifications `json:"notifications"` + Period string `json:"period"` } // Notifications represents a DigitalOcean Notifications configuration. @@ -97,24 +103,27 @@ type UpdateUptimeCheckRequest struct { // CreateUptimeUptimeAlertRequest represents the request to create a new Uptime Alert. type CreateUptimeAlertRequest struct { - Name string `json:"name"` - Type string `json:"type"` - Threshold int `json:"threshold"` - Comparison string `json:"comparison"` - Notifications *Notifications `json:"notifications"` - Period string `json:"period"` + Name string `json:"name"` + Type string `json:"type"` + Threshold int `json:"threshold"` + Comparison UptimeAlertComp `json:"comparison"` + Notifications *Notifications `json:"notifications"` + Period string `json:"period"` } -// UpdateUptimeAlertRequest represents the request to create a new alert. +// UpdateUptimeAlertRequest represents the request to update an alert. type UpdateUptimeAlertRequest struct { - Name string `json:"name"` - Type string `json:"type"` - Threshold int `json:"threshold"` - Comparison string `json:"comparison"` - Notifications *Notifications `json:"notifications"` - Period string `json:"period"` + Name string `json:"name"` + Type string `json:"type"` + Threshold int `json:"threshold"` + Comparison UptimeAlertComp `json:"comparison"` + Notifications *Notifications `json:"notifications"` + Period string `json:"period"` } +// UptimeAlertComp represents an uptime alert comparison operation +type UptimeAlertComp string + type uptimeChecksRoot struct { UptimeChecks []UptimeCheck `json:"checks"` Links *Links `json:"links"` diff --git a/vendor/modules.txt b/vendor/modules.txt index 9a4a0dc04..e34f4c516 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.103.0 +# github.com/digitalocean/godo v1.104.0 ## explicit; go 1.21 github.com/digitalocean/godo github.com/digitalocean/godo/metrics