Skip to content

Commit

Permalink
Add region param during assign/unassign
Browse files Browse the repository at this point in the history
Signed-off-by: Harsh Thakur <[email protected]>
  • Loading branch information
Harsh Thakur authored and RealHarshThakur committed Jul 15, 2022
1 parent 92d9fcb commit 3402db4
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 10 deletions.
4 changes: 2 additions & 2 deletions cloud-controller-manager/civo/loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (l *loadbalancer) updateLBConfig(civolb *civogo.LoadBalancer, service *v1.S

// this is so that we don't try to reassign the reserved IP to the loadbalancer
if rip.AssignedTo.ID != civolb.ID {
_, err = l.client.civoClient.AssignIP(rip.ID, civolb.ID, "loadbalancer")
_, err = l.client.civoClient.AssignIP(rip.ID, civolb.ID, "loadbalancer", Region)
if err != nil {
klog.Errorf("Unable to assign reserved IP, error: %v", err)
return nil, err
Expand All @@ -169,7 +169,7 @@ func (l *loadbalancer) updateLBConfig(civolb *civogo.LoadBalancer, service *v1.S
}

if ip != nil {
_, err = l.client.civoClient.UnassignIP(ip.ID)
_, err = l.client.civoClient.UnassignIP(ip.ID, Region)
if err != nil {
klog.Errorf("Unable to unassign IP, error: %v", err)
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/civo/civo-cloud-controller-manager
go 1.16

require (
github.com/civo/civogo v0.2.93
github.com/civo/civogo v0.2.96
github.com/emicklei/go-restful v2.11.1+incompatible // indirect
github.com/go-openapi/swag v0.19.7 // indirect
github.com/google/go-cmp v0.5.6 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/civo/civogo v0.2.93 h1:HE6p5K9yJ9+I1IlK70aMHHoBRn6VkmMQSnUAPPM+KOo=
github.com/civo/civogo v0.2.93/go.mod h1:7+GeeFwc4AYTULaEshpT2vIcl3Qq8HPoxA17viX3l6g=
github.com/civo/civogo v0.2.96 h1:GHaJ5PRH98psA4eBgQQxBGPp5OnWblbGWvL5S1vV1Gc=
github.com/civo/civogo v0.2.96/go.mod h1:7+GeeFwc4AYTULaEshpT2vIcl3Qq8HPoxA17viX3l6g=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa h1:OaNxuTZr7kxeODyLWsRMC+OD03aFUH+mW6r2d+MWa5Y=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
Expand Down
8 changes: 4 additions & 4 deletions vendor/github.com/civo/civogo/fake_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/github.com/civo/civogo/instance.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions vendor/github.com/civo/civogo/ip.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions vendor/github.com/civo/civogo/loadbalancer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions vendor/github.com/civo/civogo/network.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ github.com/beorn7/perks/quantile
github.com/blang/semver
# github.com/cespare/xxhash/v2 v2.1.1
github.com/cespare/xxhash/v2
# github.com/civo/civogo v0.2.93
# github.com/civo/civogo v0.2.96
## explicit
github.com/civo/civogo
github.com/civo/civogo/utils
Expand Down

0 comments on commit 3402db4

Please sign in to comment.