Skip to content

Commit eb4f1cd

Browse files
authored
LBAAS: display LBs IPv6 (#1620)
1 parent 8f46e97 commit eb4f1cd

16 files changed

+285
-66
lines changed

commands/displayers/load_balancer.go

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func (lb *LoadBalancer) Cols() []string {
3636
return []string{
3737
"ID",
3838
"IP",
39+
"IPv6",
3940
"Name",
4041
"Status",
4142
"Created",
@@ -57,6 +58,7 @@ func (lb *LoadBalancer) ColMap() map[string]string {
5758
return map[string]string{
5859
"ID": "ID",
5960
"IP": "IP",
61+
"IPv6": "IPv6",
6062
"Name": "Name",
6163
"Status": "Status",
6264
"Created": "Created At",
@@ -86,6 +88,7 @@ func (lb *LoadBalancer) KV() []map[string]any {
8688
o := map[string]any{
8789
"ID": l.ID,
8890
"IP": l.IP,
91+
"IPv6": l.IPv6,
8992
"Name": l.Name,
9093
"Status": l.Status,
9194
"Created": l.Created,

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.22
55
require (
66
github.com/blang/semver v3.5.1+incompatible
77
github.com/creack/pty v1.1.21
8-
github.com/digitalocean/godo v1.130.1-0.20241119155329-45ad288c38bd
8+
github.com/digitalocean/godo v1.131.0
99
github.com/docker/cli v24.0.5+incompatible
1010
github.com/docker/docker v25.0.6+incompatible
1111
github.com/docker/docker-credential-helpers v0.7.0 // indirect

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1
9393
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
9494
github.com/digitalocean/godo v1.130.1-0.20241119155329-45ad288c38bd h1:3TCd+SNAbaRHQSiWmMJWtPitvZt2lTq3th87CxMl9Xo=
9595
github.com/digitalocean/godo v1.130.1-0.20241119155329-45ad288c38bd/go.mod h1:PU8JB6I1XYkQIdHFop8lLAY9ojp6M0XcU0TWaQSxbrc=
96+
github.com/digitalocean/godo v1.131.0 h1:0WHymufAV5avpodT0h5/pucUVfO4v7biquOIqhLeROY=
97+
github.com/digitalocean/godo v1.131.0/go.mod h1:PU8JB6I1XYkQIdHFop8lLAY9ojp6M0XcU0TWaQSxbrc=
9698
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
9799
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
98100
github.com/docker/cli v24.0.5+incompatible h1:WeBimjvS0eKdH4Ygx+ihVq1Q++xg36M/rMi4aXAvodc=

integration/glb_create_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ const (
178178
}`
179179
glbCreateOutput = `
180180
Notice: Load balancer created
181-
ID IP Name Status Created At Region Size Size Unit VPC UUID Tag Droplet IDs SSL Sticky Sessions Health Check Forwarding Rules Disable Lets Encrypt DNS Records
182-
cf9f1aa1-e1f8-4f3a-ad71-124c45e204b8 my-glb-name new 2024-04-09T16:10:11Z <nil> lb-small 1 false type:none,cookie_name:,cookie_ttl_seconds:0 protocol:http,port:80,path:/,check_interval_seconds:10,response_timeout_seconds:5,healthy_threshold:5,unhealthy_threshold:3,proxy_protocol:<nil> false
181+
ID IP IPv6 Name Status Created At Region Size Size Unit VPC UUID Tag Droplet IDs SSL Sticky Sessions Health Check Forwarding Rules Disable Lets Encrypt DNS Records
182+
cf9f1aa1-e1f8-4f3a-ad71-124c45e204b8 my-glb-name new 2024-04-09T16:10:11Z <nil> lb-small 1 false type:none,cookie_name:,cookie_ttl_seconds:0 protocol:http,port:80,path:/,check_interval_seconds:10,response_timeout_seconds:5,healthy_threshold:5,unhealthy_threshold:3,proxy_protocol:<nil> false
183183
`
184184
)

integration/glb_update_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,6 @@ const (
174174
}
175175
}`
176176
glbUpdateOutput = `
177-
ID IP Name Status Created At Region Size Size Unit VPC UUID Tag Droplet IDs SSL Sticky Sessions Health Check Forwarding Rules Disable Lets Encrypt DNS Records
178-
updated-lb-id my-glb-name new 2024-04-09T16:10:11Z <nil> lb-small 1 false type:none,cookie_name:,cookie_ttl_seconds:0 protocol:http,port:80,path:/,check_interval_seconds:10,response_timeout_seconds:5,healthy_threshold:5,unhealthy_threshold:3,proxy_protocol:<nil> false`
177+
ID IP IPv6 Name Status Created At Region Size Size Unit VPC UUID Tag Droplet IDs SSL Sticky Sessions Health Check Forwarding Rules Disable Lets Encrypt DNS Records
178+
updated-lb-id my-glb-name new 2024-04-09T16:10:11Z <nil> lb-small 1 false type:none,cookie_name:,cookie_ttl_seconds:0 protocol:http,port:80,path:/,check_interval_seconds:10,response_timeout_seconds:5,healthy_threshold:5,unhealthy_threshold:3,proxy_protocol:<nil> false`
179179
)

integration/lb_create_test.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,15 @@ var _ = suite("compute/load-balancer/create", func(t *testing.T, when spec.G, it
127127
const (
128128
lbCreateOutput = `
129129
Notice: Load balancer created
130-
ID IP Name Status Created At Region Size Size Unit VPC UUID Tag Droplet IDs SSL Sticky Sessions Health Check Forwarding Rules Disable Lets Encrypt DNS Records
131-
4de7ac8b-495b-4884-9a69-1050c6793cd6 example-lb-01 new 2017-02-01T22:22:58Z nyc3 lb-small <nil> 00000000-0000-4000-8000-000000000000 3164444,3164445 true type:none,cookie_name:,cookie_ttl_seconds:0 protocol:,port:0,path:,check_interval_seconds:0,response_timeout_seconds:0,healthy_threshold:0,unhealthy_threshold:0,proxy_protocol:<nil> true
130+
ID IP IPv6 Name Status Created At Region Size Size Unit VPC UUID Tag Droplet IDs SSL Sticky Sessions Health Check Forwarding Rules Disable Lets Encrypt DNS Records
131+
4de7ac8b-495b-4884-9a69-1050c6793cd6 example-lb-01 new 2017-02-01T22:22:58Z nyc3 lb-small <nil> 00000000-0000-4000-8000-000000000000 3164444,3164445 true type:none,cookie_name:,cookie_ttl_seconds:0 protocol:,port:0,path:,check_interval_seconds:0,response_timeout_seconds:0,healthy_threshold:0,unhealthy_threshold:0,proxy_protocol:<nil> true
132132
`
133133

134134
lbWaitCreateOutput = `
135135
Notice: Load balancer creation is in progress, waiting for load balancer to become active
136136
Notice: Load balancer created
137-
ID IP Name Status Created At Region Size Size Unit VPC UUID Tag Droplet IDs SSL Sticky Sessions Health Check Forwarding Rules Disable Lets Encrypt DNS Records
138-
4de7ac8b-495b-4884-9a69-1050c6793cd6 example-lb-01 active 2017-02-01T22:22:58Z nyc3 lb-small <nil> 00000000-0000-4000-8000-000000000000 3164444,3164445 true type:none,cookie_name:,cookie_ttl_seconds:0 protocol:,port:0,path:,check_interval_seconds:0,response_timeout_seconds:0,healthy_threshold:0,unhealthy_threshold:0,proxy_protocol:<nil> true
137+
ID IP IPv6 Name Status Created At Region Size Size Unit VPC UUID Tag Droplet IDs SSL Sticky Sessions Health Check Forwarding Rules Disable Lets Encrypt DNS Records
138+
4de7ac8b-495b-4884-9a69-1050c6793cd6 example-lb-01 active 2017-02-01T22:22:58Z nyc3 lb-small <nil> 00000000-0000-4000-8000-000000000000 3164444,3164445 true type:none,cookie_name:,cookie_ttl_seconds:0 protocol:,port:0,path:,check_interval_seconds:0,response_timeout_seconds:0,healthy_threshold:0,unhealthy_threshold:0,proxy_protocol:<nil> true
139139
`
140140

141141
lbCreateResponse = `
@@ -144,6 +144,7 @@ ID IP Name Status Created
144144
"id": "4de7ac8b-495b-4884-9a69-1050c6793cd6",
145145
"name": "example-lb-01",
146146
"ip": "",
147+
"ipv6": "",
147148
"algorithm": "round_robin",
148149
"status": "new",
149150
"created_at": "2017-02-01T22:22:58Z",

integration/lb_get_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,16 @@ var _ = suite("compute/load-balancer/get", func(t *testing.T, when spec.G, it sp
8686

8787
const (
8888
lbGetOutput = `
89-
ID IP Name Status Created At Region Size Size Unit VPC UUID Tag Droplet IDs SSL Sticky Sessions Health Check Forwarding Rules Disable Lets Encrypt DNS Records
90-
find-lb-id 104.131.186.241 example-lb-01 new 2017-02-01T22:22:58Z nyc3 lb-small <nil> 00000000-0000-4000-8000-000000000000 3164445 false type:none,cookie_name:,cookie_ttl_seconds:0 protocol:,port:0,path:,check_interval_seconds:0,response_timeout_seconds:0,healthy_threshold:0,unhealthy_threshold:0,proxy_protocol:<nil> false
89+
ID IP IPv6 Name Status Created At Region Size Size Unit VPC UUID Tag Droplet IDs SSL Sticky Sessions Health Check Forwarding Rules Disable Lets Encrypt DNS Records
90+
find-lb-id 104.131.186.241 2001:db8::1234:5678 example-lb-01 new 2017-02-01T22:22:58Z nyc3 lb-small <nil> 00000000-0000-4000-8000-000000000000 3164445 false type:none,cookie_name:,cookie_ttl_seconds:0 protocol:,port:0,path:,check_interval_seconds:0,response_timeout_seconds:0,healthy_threshold:0,unhealthy_threshold:0,proxy_protocol:<nil> false
9191
`
9292
lbGetResponse = `
9393
{
9494
"load_balancer": {
9595
"id": "find-lb-id",
9696
"name": "example-lb-01",
9797
"ip": "104.131.186.241",
98+
"ipv6": "2001:db8::1234:5678",
9899
"algorithm": "round_robin",
99100
"status": "new",
100101
"created_at": "2017-02-01T22:22:58Z",

integration/lb_list_test.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ var _ = suite("compute/load-balancer/list", func(t *testing.T, when spec.G, it s
8080

8181
const (
8282
lbListOutput = `
83-
ID IP Name Status Created At Region Size Size Unit VPC UUID Tag Droplet IDs SSL Sticky Sessions Health Check Forwarding Rules Disable Lets Encrypt DNS Records
84-
lb-one 104.131.186.241 example-lb-01 new 2017-02-01T22:22:58Z venus3 lb-small <nil> 00000000-0000-4000-8000-000000000000 3164444 false type:none,cookie_name:,cookie_ttl_seconds:0 protocol:http,port:80,path:/,check_interval_seconds:10,response_timeout_seconds:5,healthy_threshold:5,unhealthy_threshold:3,proxy_protocol:<nil> entry_protocol:http,entry_port:80,target_protocol:http,target_port:80,certificate_id:,tls_passthrough:false true
85-
lb-two 104.131.188.204 example-lb-02 new 2017-02-01T20:44:58Z mars1 lb-medium <nil> 00000000-0000-4000-8000-000000000000 3164445 false type:none,cookie_name:,cookie_ttl_seconds:0 protocol:http,port:80,path:/,check_interval_seconds:10,response_timeout_seconds:5,healthy_threshold:5,unhealthy_threshold:3,proxy_protocol:<nil> entry_protocol:http,entry_port:80,target_protocol:http,target_port:80,certificate_id:,tls_passthrough:false false
83+
ID IP IPv6 Name Status Created At Region Size Size Unit VPC UUID Tag Droplet IDs SSL Sticky Sessions Health Check Forwarding Rules Disable Lets Encrypt DNS Records
84+
lb-one 104.131.186.241 2001:db8::1234:5678 example-lb-01 new 2017-02-01T22:22:58Z venus3 lb-small <nil> 00000000-0000-4000-8000-000000000000 3164444 false type:none,cookie_name:,cookie_ttl_seconds:0 protocol:http,port:80,path:/,check_interval_seconds:10,response_timeout_seconds:5,healthy_threshold:5,unhealthy_threshold:3,proxy_protocol:<nil> entry_protocol:http,entry_port:80,target_protocol:http,target_port:80,certificate_id:,tls_passthrough:false true
85+
lb-two 104.131.188.204 2001:db8::1234:5679 example-lb-02 new 2017-02-01T20:44:58Z mars1 lb-medium <nil> 00000000-0000-4000-8000-000000000000 3164445 false type:none,cookie_name:,cookie_ttl_seconds:0 protocol:http,port:80,path:/,check_interval_seconds:10,response_timeout_seconds:5,healthy_threshold:5,unhealthy_threshold:3,proxy_protocol:<nil> entry_protocol:http,entry_port:80,target_protocol:http,target_port:80,certificate_id:,tls_passthrough:false false
8686
`
8787
lbListResponse = `
8888
{
@@ -91,6 +91,7 @@ lb-two 104.131.188.204 example-lb-02 new 2017-02-01T20:44:58Z
9191
"id": "lb-one",
9292
"name": "example-lb-01",
9393
"ip": "104.131.186.241",
94+
"ipv6": "2001:db8::1234:5678",
9495
"algorithm": "round_robin",
9596
"status": "new",
9697
"created_at": "2017-02-01T22:22:58Z",
@@ -135,6 +136,7 @@ lb-two 104.131.188.204 example-lb-02 new 2017-02-01T20:44:58Z
135136
"id": "lb-two",
136137
"name": "example-lb-02",
137138
"ip": "104.131.188.204",
139+
"ipv6": "2001:db8::1234:5679",
138140
"algorithm": "round_robin",
139141
"status": "new",
140142
"created_at": "2017-02-01T20:44:58Z",

integration/projects_resources_get_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,8 @@ IP Region Droplet ID Droplet Name Project ID
261261
}
262262
`
263263
projectsResourcesGetLoadbalancerOutput = `
264-
ID IP Name Status Created At Region Size Size Unit VPC UUID Tag Droplet IDs SSL Sticky Sessions Health Check Forwarding Rules Disable Lets Encrypt DNS Records
265-
4de7ac8b-495b-4884-9a69-1050c6793cd6 104.131.186.241 example-lb-01 new 2017-02-01T22:22:58Z nyc3 lb-small <nil> 00000000-0000-4000-8000-000000000000 3164445 false type:none,cookie_name:,cookie_ttl_seconds:0 protocol:,port:0,path:,check_interval_seconds:0,response_timeout_seconds:0,healthy_threshold:0,unhealthy_threshold:0,proxy_protocol:<nil> entry_protocol:https,entry_port:444,target_protocol:https,target_port:443,certificate_id:,tls_passthrough:true false
264+
ID IP IPv6 Name Status Created At Region Size Size Unit VPC UUID Tag Droplet IDs SSL Sticky Sessions Health Check Forwarding Rules Disable Lets Encrypt DNS Records
265+
4de7ac8b-495b-4884-9a69-1050c6793cd6 104.131.186.241 example-lb-01 new 2017-02-01T22:22:58Z nyc3 lb-small <nil> 00000000-0000-4000-8000-000000000000 3164445 false type:none,cookie_name:,cookie_ttl_seconds:0 protocol:,port:0,path:,check_interval_seconds:0,response_timeout_seconds:0,healthy_threshold:0,unhealthy_threshold:0,proxy_protocol:<nil> entry_protocol:https,entry_port:444,target_protocol:https,target_port:443,certificate_id:,tls_passthrough:true false
266266
`
267267
projectsResourcesGetLoadbalancerResponse = `
268268
{

vendor/github.com/digitalocean/godo/CHANGELOG.md

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)