Skip to content

Commit

Permalink
Merge branch 'main' into webhook-package
Browse files Browse the repository at this point in the history
  • Loading branch information
loosla authored Nov 25, 2024
2 parents aa468f8 + 73ff37f commit aca056d
Show file tree
Hide file tree
Showing 50 changed files with 10,283 additions and 2,814 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
test:
strategy:
matrix:
go-version: [ 1.18.x, 1.19.x ]
go-version: [ 1.22.x, 1.23.x ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
Expand Down
196 changes: 196 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,201 @@
# Change Log

## [v1.130.0] - 2024-11-14

- #755 - @vsharma6855 - Add Missing Database Configs for Postgresql and MYSQL
- #754 - @blesswinsamuel - APPS-9858 Add method to obtain websocket URL to get console access into components

## [v1.129.0] - 2024-11-06

- #752 - @andrewsomething - Support maps in Stringify
- #749 - @loosla - [droplets]: add droplet backup policies
- #730 - @rak16 - DOCR-1201: Add new RegistriesService to support methods for multiple-registry open beta
- #748 - @andrewsomething - Support Droplet GPU information

## [v1.128.0] - 2024-10-24

- #746 - @blesswinsamuel - Add archive field to AppSpec to archive/restore apps
- #745 - @asaha2 - Add load balancer monitoring endpoints
- #744 - @asaha2 - Adjust delete dangerous
- #743 - @asaha2 - Introduce droplet autoscale godo methods
- #740 - @blesswinsamuel - Add maintenance field to AppSpec to enable/disable maintenance mode
- #739 - @markusthoemmes - Add protocol to AppSpec and pending to detect responses

## [v1.127.0] - 2024-10-18

- #737 - @loosla - [databases]: change Opensearch ism_history_max_docs type to int64 to …
- #735 - @loosla - [databases]: add a missing field to Opensearch advanced configuration
- #729 - @loosla - [databases]: add support for Opensearch advanced configuration

## [v1.126.0] - 2024-09-25

- #732 - @gottwald - DOKS: add custom CIDR fields
- #727 - @loosla - [databases]: add support for Kafka advanced configuration

## [v1.125.0] - 2024-09-17

- #726 - @loosla - [databases]: add support for MongoDB advanced configuration
- #724 - @andrewsomething - Bump go version to 1.22
- #723 - @jauderho - Update Go dependencies and remove replace statements

## [v1.124.0] - 2024-09-10

- #721 - @vsharma6855 - [DBAAS] | Add API endpoint for applying cluster patches

## [v1.123.0] - 2024-09-06

- #719 - @andrewsomething - apps: mark ListTiers and GetTier as deprecated

## [v1.122.0] - 2024-09-04

- #717 - @danaelhe - DB: Fix Logsink Attribute Types
- #716 - @bhardwajRahul - Databases: Add support for OpenSearch ACL

## [v1.121.0] - 2024-08-20

- #715 - @danaelhe - Databases: Bring back Logsink Support
- #710 - @bhardwajRahul - Update GODO to include new Openseach index crud changes
- #712 - @danaelhe - Database: Namespace logsink
- #711 - @danaelhe - Databases: Add Logsinks CRUD support

## [v1.120.0] - 2024-08-08

- #708 - @markusthoemmes - APPS-9201 Add `UpdateAllSourceVersions` parameter to update app calls
- #706 - @andrewsomething - database: Add Size to DatabaseReplica struct

## [v1.119.0] - 2024-07-24

- #704 - @ElanHasson - APPS-9133 - Add support for OPENSEARCH as a database engine option
- #703 - @dependabot[bot] - Bump github.com/hashicorp/go-retryablehttp from 0.7.4 to 0.7.7
- #699 - @ElanHasson - APPS-8790 Add support to App Platform Log Forwarding for an OpenSearch DBaaS cluster destination.

## [v1.118.0] - 2024-06-04

**Note**: This release contains features in closed beta (#700).

- #701 - @llDrLove - Rename control plane permission to control plane firewall
- #700 - @bbassingthwaite - Add ProxyProtocol to LoadBalancer HealthCheck

## [v1.117.0] - 2024-06-04

- #696 - @llDrLove - Support specifying control plane firewall rules when creating or updating DOKS clusters
- #697 - @asaha2 - Add support for lb internal network type
- #695 - @ElanHasson - APPS-8732 - Update documentation on App Platform OpenSearch endpoint structure.
- #692 - @ElanHasson - APPS-8732 - Add OpenSearch as a Log Destination for App Platform.

## [v1.116.0] - 2024-05-16

- #693 - @guptado - Introduce VPC peering methods

## [v1.115.0] - 2024-05-08

- #688 - @asaha2 - load balancers: support glb active-passive fail-over settings, currently in closed beta

## [v1.114.0] - 2024-04-12

- #686 - @greeshmapill - APPS-8386: Add comments to mark deprecation of unused instance size fields
- #685 - @jcodybaker - APPS-8711: container termination controls
- #682 - @dependabot[bot] - Bump golang.org/x/net from 0.17.0 to 0.23.0

## [v1.113.0] - 2024-04-12

- #679 - @bhardwajRahul - Enable ui_connection parameter for Opensearch
- #678 - @bhardwajRahul - Enable Opensearch option in Godo

## [v1.112.0] - 2024-04-08

- #672 - @dependabot[bot] - Bump google.golang.org/protobuf from 1.28.0 to 1.33.0
- #675 - @bhardwajRahul - Add ListDatabaseEvents to Godo

## [v1.111.0] - 2024-04-02

- #674 - @asaha2 - load balancers: introduce glb settings in godo, currently in closed beta

## [v1.110.0] - 2024-03-14

- #667 - @dwilsondo - Include DBaaS metrics credential endpoint operations
- #670 - @guptado - [NETPROD-3583] Added name param in ListOption to get resource by name
- #671 - @greeshmapill - APPS-8383: Add deprecation intent and bandwidth allowance to app instance size spec

## [v1.109.0] - 2024-02-09

- #668 - @greeshmapill - APPS-8315: Update app instance size spec
- #665 - @jcodybaker - APPS-8263: methods for managing App Platform dev DBs
- #663 - @dwilsondo - Include replica connection info on DBaaS clusters & DBaaS PG pools
- #662 - @ddatta-do - load balancer : add regional network as new LB type

## [v1.108.0] - 2024-01-17

- #660 - @dweinshenker - Enable CRUD operations for replicas with storage_size_mib

## [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
- #641 - @dweinshenker - Fix Kafka Partition Count
- #645 - @gregmankes - APPS-7325 - update app godo spec
- #642 - @dependabot[bot] - Bump golang.org/x/net from 0.7.0 to 0.17.0

## [v1.104.1] - 2023-10-10

* #640 - @andrewsomething - Drop required Go version to 1.20 and document policy.
* #640 - @andrewsomething - Fix library version.

## [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
- #634 - @andrewsomething - Bump Go version to v1.21.0
- #632 - @danaelhe - Make Retrys by Default for NewFromToken()
- #633 - @dwilsondo - Add DBaaS engine Kafka
- #621 - @testwill - chore: use fmt.Fprintf instead of fmt.Fprint(fmt.Sprintf(...))

## [v1.102.1] - 2023-08-17

- #629 - @andrewsomething - Provide a custom retryablehttp.ErrorHandler for more consistent returns using retries.

## [v1.102.0] - 2023-08-14

- #624 - @danaelhe - Update README.md with Retryable Info
- #626 - @andrewsomething - Allow configuring go-retryablehttp.Logger
- #625 - @andrewsomething - Export the HTTP client

## [v1.101.0] - 2023-08-09

- #619 - @danaelhe - Add retryablehttp Client Option

## [v1.100.0] - 2023-07-20

- #618 - @asaha - load balancers: introduce new type field
- #620 - @andrewsomething - account: add name field.

## [v1.99.0] - 2023-04-24

- #616 - @bentranter - Bump CI version for Go 1.20
- #615 - @bentranter - Remove beta support for tokens API
- #604 - @dvigueras - Add support for "Validate a Container Registry Name"
- #613 - @ibilalkayy - updated the README file by showing up the build status icon

## [v1.98.0] - 2023-03-09

- #608 - @anitgandhi - client: don't process body upon 204 response
Expand Down
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,11 @@ github-changelog-generator -org digitalocean -repo godo
5. Update the `Tag version` and `Release title` field with the new godo version. Be sure the version has a `v` prefixed in both places. Ex `v1.8.0`.
6. Copy the changelog bullet points to the description field.
7. Publish the release.

## Go Version Support

This project follows the support [policy of Go](https://go.dev/doc/devel/release#policy)
as its support policy. The two latest major releases of Go are supported by the project.
[CI workflows](.github/workflows/ci.yml) should test against both supported versions.
[go.mod](./go.mod) should specify the oldest of the supported versions to give
downstream users of godo flexibility.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,31 @@ func ListRepositoriesV2(ctx context.Context, client *godo.Client, registryName s
}
```

### Automatic Retries and Exponential Backoff

The Godo client can be configured to use automatic retries and exponentional backoff for requests that fail with 429 or 500-level response codes via [go-retryablehttp](https://github.com/hashicorp/go-retryablehttp). To configure Godo to enable usage of go-retryablehttp, the `RetryConfig.RetryMax` must be set.

```go
tokenSrc := oauth2.StaticTokenSource(&oauth2.Token{
AccessToken: "dop_v1_xxxxxx",
})

oauth_client := oauth2.NewClient(oauth2.NoContext, tokenSrc)

waitMax := godo.PtrTo(6.0)
waitMin := godo.PtrTo(3.0)

retryConfig := godo.RetryConfig{
RetryMax: 3,
RetryWaitMin: waitMin,
RetryWaitMax: waitMax,
}

client, err := godo.New(oauth_client, godo.WithRetryAndBackoffs(retryConfig))
```

Please refer to the [RetryConfig Godo documentation](https://pkg.go.dev/github.com/digitalocean/godo#RetryConfig) for more information.

## Versioning

Each version of the client is tagged and the version is updated accordingly.
Expand Down
1 change: 1 addition & 0 deletions account.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type Account struct {
ReservedIPLimit int `json:"reserved_ip_limit,omitempty"`
VolumeLimit int `json:"volume_limit,omitempty"`
Email string `json:"email,omitempty"`
Name string `json:"name,omitempty"`
UUID string `json:"uuid,omitempty"`
EmailVerified bool `json:"email_verified,omitempty"`
Status string `json:"status,omitempty"`
Expand Down
21 changes: 17 additions & 4 deletions account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func TestAccountGet(t *testing.T) {
"reserved_ip_limit": 25,
"volume_limit": 22,
"email": "[email protected]",
"name": "Sammy the Shark",
"uuid": "b6fr89dbf6d9156cace5f3c78dc9851d957381ef",
"email_verified": true
}
Expand All @@ -34,8 +35,16 @@ func TestAccountGet(t *testing.T) {
t.Errorf("Account.Get returned error: %v", err)
}

expected := &Account{DropletLimit: 25, FloatingIPLimit: 25, ReservedIPLimit: 25, Email: "[email protected]",
UUID: "b6fr89dbf6d9156cace5f3c78dc9851d957381ef", EmailVerified: true, VolumeLimit: 22}
expected := &Account{
DropletLimit: 25,
FloatingIPLimit: 25,
ReservedIPLimit: 25,
Email: "[email protected]",
Name: "Sammy the Shark",
UUID: "b6fr89dbf6d9156cace5f3c78dc9851d957381ef",
EmailVerified: true,
VolumeLimit: 22,
}
if !reflect.DeepEqual(acct, expected) {
t.Errorf("Account.Get returned %+v, expected %+v", acct, expected)
}
Expand All @@ -48,14 +57,15 @@ func TestAccountString(t *testing.T) {
ReservedIPLimit: 25,
VolumeLimit: 22,
Email: "[email protected]",
Name: "Sammy the Shark",
UUID: "b6fr89dbf6d9156cace5f3c78dc9851d957381ef",
EmailVerified: true,
Status: "active",
StatusMessage: "message",
}

stringified := acct.String()
expected := `godo.Account{DropletLimit:25, FloatingIPLimit:25, ReservedIPLimit:25, VolumeLimit:22, Email:"[email protected]", UUID:"b6fr89dbf6d9156cace5f3c78dc9851d957381ef", EmailVerified:true, Status:"active", StatusMessage:"message"}`
expected := `godo.Account{DropletLimit:25, FloatingIPLimit:25, ReservedIPLimit:25, VolumeLimit:22, Email:"[email protected]", Name:"Sammy the Shark", UUID:"b6fr89dbf6d9156cace5f3c78dc9851d957381ef", EmailVerified:true, Status:"active", StatusMessage:"message"}`
if expected != stringified {
t.Errorf("\n got %+v\nexpected %+v", stringified, expected)
}
Expand All @@ -75,6 +85,7 @@ func TestAccountGetWithTeam(t *testing.T) {
"floating_ip_limit": 25,
"volume_limit": 22,
"email": "[email protected]",
"name": "Sammy the Shark",
"uuid": "b6fr89dbf6d9156cace5f3c78dc9851d957381ef",
"email_verified": true,
"team": {
Expand All @@ -96,6 +107,7 @@ func TestAccountGetWithTeam(t *testing.T) {
DropletLimit: 25,
FloatingIPLimit: 25,
Email: "[email protected]",
Name: "Sammy the Shark",
UUID: "b6fr89dbf6d9156cace5f3c78dc9851d957381ef",
EmailVerified: true,
VolumeLimit: 22,
Expand All @@ -116,6 +128,7 @@ func TestAccountStringWithTeam(t *testing.T) {
ReservedIPLimit: 25,
VolumeLimit: 22,
Email: "[email protected]",
Name: "Sammy the Shark",
UUID: "b6fr89dbf6d9156cace5f3c78dc9851d957381ef",
EmailVerified: true,
Status: "active",
Expand All @@ -127,7 +140,7 @@ func TestAccountStringWithTeam(t *testing.T) {
}

stringified := acct.String()
expected := `godo.Account{DropletLimit:25, FloatingIPLimit:25, ReservedIPLimit:25, VolumeLimit:22, Email:"[email protected]", UUID:"b6fr89dbf6d9156cace5f3c78dc9851d957381ef", EmailVerified:true, Status:"active", StatusMessage:"message", Team:godo.TeamInfo{Name:"My Team", UUID:"b6fr89dbf6d9156cace5f3c78dc9851d957381ef"}}`
expected := `godo.Account{DropletLimit:25, FloatingIPLimit:25, ReservedIPLimit:25, VolumeLimit:22, Email:"[email protected]", Name:"Sammy the Shark", UUID:"b6fr89dbf6d9156cace5f3c78dc9851d957381ef", EmailVerified:true, Status:"active", StatusMessage:"message", Team:godo.TeamInfo{Name:"My Team", UUID:"b6fr89dbf6d9156cace5f3c78dc9851d957381ef"}}`
if expected != stringified {
t.Errorf("\n got %+v\nexpected %+v", stringified, expected)
}
Expand Down
Loading

0 comments on commit aca056d

Please sign in to comment.