From 684e70b7ed29a537766f93888e7524087cab16d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Feb 2024 11:29:21 -0500 Subject: [PATCH] Bump github.com/vultr/govultr/v3 from 3.6.0 to 3.6.2 (#465) Bumps [github.com/vultr/govultr/v3](https://github.com/vultr/govultr) from 3.6.0 to 3.6.2. - [Release notes](https://github.com/vultr/govultr/releases) - [Changelog](https://github.com/vultr/govultr/blob/master/CHANGELOG.md) - [Commits](https://github.com/vultr/govultr/compare/v3.6.0...v3.6.2) --- updated-dependencies: - dependency-name: github.com/vultr/govultr/v3 dependency-type: direct:production update-type: version-update:semver-patch ... 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/vultr/govultr/v3/CHANGELOG.md | 8 +++ .../vultr/govultr/v3/bare_metal_server.go | 50 +++++++++++++++++++ vendor/github.com/vultr/govultr/v3/govultr.go | 2 +- .../github.com/vultr/govultr/v3/kubernetes.go | 40 ++++++++------- vendor/modules.txt | 2 +- 7 files changed, 84 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index 05a78b89..f88d19ff 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/hashicorp/terraform-plugin-log v0.9.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.31.0 - github.com/vultr/govultr/v3 v3.6.0 + github.com/vultr/govultr/v3 v3.6.2 golang.org/x/oauth2 v0.15.0 ) diff --git a/go.sum b/go.sum index 611a6525..08f03933 100644 --- a/go.sum +++ b/go.sum @@ -140,8 +140,8 @@ github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IU github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= -github.com/vultr/govultr/v3 v3.6.0 h1:WCXQwgdiZnGxG4CI+TTohE14V3jV6ikg/64fhDVdbIs= -github.com/vultr/govultr/v3 v3.6.0/go.mod h1:rt9v2x114jZmmLAE/h5N5jnxTmsK9ewwS2oQZ0UBQzM= +github.com/vultr/govultr/v3 v3.6.2 h1:BlEhb0F8iqQ0LZKF+yhGq8OznVLG6ZI8rhLIh4OkbIU= +github.com/vultr/govultr/v3 v3.6.2/go.mod h1:rt9v2x114jZmmLAE/h5N5jnxTmsK9ewwS2oQZ0UBQzM= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zclconf/go-cty v1.14.1 h1:t9fyA35fwjjUMcmL5hLER+e/rEPqrbCK1/OSE4SI9KA= diff --git a/vendor/github.com/vultr/govultr/v3/CHANGELOG.md b/vendor/github.com/vultr/govultr/v3/CHANGELOG.md index 3097611c..401641fc 100644 --- a/vendor/github.com/vultr/govultr/v3/CHANGELOG.md +++ b/vendor/github.com/vultr/govultr/v3/CHANGELOG.md @@ -1,4 +1,12 @@ # Change Log +## [v3.6.2](https://github.com/vultr/govultr/compare/v3.6.1...v3.6.2) (2024-02-20) +### Enhancement +* Kubernetes: add support for nodepool labels [PR 296](https://github.com/vultr/govultr/pull/296) + +## [v3.6.1](https://github.com/vultr/govultr/compare/v3.6.0...v3.6.1) (2024-01-16) +### Enhancement +* Bare Metal: add functions to allow VPC [PR 293](https://github.com/vultr/govultr/pull/293) + ## [v3.6.0](https://github.com/vultr/govultr/compare/v3.5.0...v3.6.0) (2023-12-15) ### Enhancement * Marketplace: add support for new API route [PR 291](https://github.com/vultr/govultr/pull/291) diff --git a/vendor/github.com/vultr/govultr/v3/bare_metal_server.go b/vendor/github.com/vultr/govultr/v3/bare_metal_server.go index 91247f7c..5d0acc6f 100644 --- a/vendor/github.com/vultr/govultr/v3/bare_metal_server.go +++ b/vendor/github.com/vultr/govultr/v3/bare_metal_server.go @@ -37,6 +37,10 @@ type BareMetalServerService interface { GetUpgrades(ctx context.Context, serverID string) (*Upgrades, *http.Response, error) + ListVPCInfo(ctx context.Context, serverID string) ([]VPCInfo, *http.Response, error) + AttachVPC(ctx context.Context, serverID, vpcID string) error + DetachVPC(ctx context.Context, serverID, vpcID string) error + ListVPC2Info(ctx context.Context, serverID string) ([]VPC2Info, *http.Response, error) AttachVPC2(ctx context.Context, serverID string, vpc2Req *AttachVPC2Req) error DetachVPC2(ctx context.Context, serverID, vpcID string) error @@ -446,6 +450,52 @@ func (b *BareMetalServerServiceHandler) GetUpgrades(ctx context.Context, serverI return upgrades.Upgrades, resp, nil } +// ListVPCInfo will list all currently attached VPC IP information for the +// given bare metal server. +func (b *BareMetalServerServiceHandler) ListVPCInfo(ctx context.Context, serverID string) ([]VPCInfo, *http.Response, error) { + uri := fmt.Sprintf("%s/%s/vpcs", bmPath, serverID) + req, err := b.client.NewRequest(ctx, http.MethodGet, uri, nil) + if err != nil { + return nil, nil, err + } + + vpcs := new(vpcInfoBase) + resp, err := b.client.DoWithContext(ctx, req, vpcs) + if err != nil { + return nil, resp, err + } + + return vpcs.VPCs, resp, nil +} + +// AttachVPC serves to attach a VPC to a bare metal server. +func (b *BareMetalServerServiceHandler) AttachVPC(ctx context.Context, serverID, vpcID string) error { + uri := fmt.Sprintf("%s/%s/vpcs/attach", bmPath, serverID) + body := RequestBody{"vpc_id": vpcID} + + req, err := b.client.NewRequest(ctx, http.MethodPost, uri, body) + if err != nil { + return err + } + + _, err = b.client.DoWithContext(ctx, req, nil) + return err +} + +// DetachVPC will detach a VPC from a bare metal server. +func (b *BareMetalServerServiceHandler) DetachVPC(ctx context.Context, serverID, vpcID string) error { + uri := fmt.Sprintf("%s/%s/vpc2/detach", bmPath, serverID) + body := RequestBody{"vpc_id": vpcID} + + req, err := b.client.NewRequest(ctx, http.MethodPost, uri, body) + if err != nil { + return err + } + + _, err = b.client.DoWithContext(ctx, req, nil) + return err +} + // ListVPC2Info currently attached to a Bare Metal server. func (b *BareMetalServerServiceHandler) ListVPC2Info(ctx context.Context, serverID string) ([]VPC2Info, *http.Response, error) { uri := fmt.Sprintf("%s/%s/vpc2", bmPath, serverID) diff --git a/vendor/github.com/vultr/govultr/v3/govultr.go b/vendor/github.com/vultr/govultr/v3/govultr.go index f79af10c..ebcbe932 100644 --- a/vendor/github.com/vultr/govultr/v3/govultr.go +++ b/vendor/github.com/vultr/govultr/v3/govultr.go @@ -19,7 +19,7 @@ import ( ) const ( - version = "3.6.0" + version = "3.6.2" defaultBase = "https://api.vultr.com" userAgent = "govultr/" + version rateLimit = 500 * time.Millisecond diff --git a/vendor/github.com/vultr/govultr/v3/kubernetes.go b/vendor/github.com/vultr/govultr/v3/kubernetes.go index 90ead5af..e6fae101 100644 --- a/vendor/github.com/vultr/govultr/v3/kubernetes.go +++ b/vendor/github.com/vultr/govultr/v3/kubernetes.go @@ -60,18 +60,19 @@ type Cluster struct { // NodePool represents a pool of nodes that are grouped by their label and plan type type NodePool struct { - ID string `json:"id"` - DateCreated string `json:"date_created"` - DateUpdated string `json:"date_updated"` - Label string `json:"label"` - Plan string `json:"plan"` - Status string `json:"status"` - NodeQuantity int `json:"node_quantity"` - MinNodes int `json:"min_nodes"` - MaxNodes int `json:"max_nodes"` - AutoScaler bool `json:"auto_scaler"` - Tag string `json:"tag"` - Nodes []Node `json:"nodes"` + ID string `json:"id"` + DateCreated string `json:"date_created"` + DateUpdated string `json:"date_updated"` + Label string `json:"label"` + Plan string `json:"plan"` + Status string `json:"status"` + NodeQuantity int `json:"node_quantity"` + MinNodes int `json:"min_nodes"` + MaxNodes int `json:"max_nodes"` + AutoScaler bool `json:"auto_scaler"` + Tag string `json:"tag"` + Labels map[string]string `json:"labels"` + Nodes []Node `json:"nodes"` } // Node represents a node that will live within a nodepool @@ -104,13 +105,14 @@ type ClusterReqUpdate struct { // NodePoolReq struct used to create a node pool type NodePoolReq struct { - NodeQuantity int `json:"node_quantity"` - Label string `json:"label"` - Plan string `json:"plan"` - Tag string `json:"tag"` - MinNodes int `json:"min_nodes,omitempty"` - MaxNodes int `json:"max_nodes,omitempty"` - AutoScaler *bool `json:"auto_scaler"` + NodeQuantity int `json:"node_quantity"` + Label string `json:"label"` + Plan string `json:"plan"` + Tag string `json:"tag"` + MinNodes int `json:"min_nodes,omitempty"` + MaxNodes int `json:"max_nodes,omitempty"` + AutoScaler *bool `json:"auto_scaler"` + Labels map[string]string `json:"labels,omitempty"` } // NodePoolReqUpdate struct used to update a node pool diff --git a/vendor/modules.txt b/vendor/modules.txt index 9748dd9a..96c34c3a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -230,7 +230,7 @@ github.com/vmihailenco/msgpack/v5/msgpcode github.com/vmihailenco/tagparser/v2 github.com/vmihailenco/tagparser/v2/internal github.com/vmihailenco/tagparser/v2/internal/parser -# github.com/vultr/govultr/v3 v3.6.0 +# github.com/vultr/govultr/v3 v3.6.2 ## explicit; go 1.20 github.com/vultr/govultr/v3 # github.com/zclconf/go-cty v1.14.1