Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ See updating [Changelog example here](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]

### Removed
- **Breaking**, Managed Load Balancer: remove deprecated `DNSName` and `NetworkUUID` fields.

## [8.0.0]

### Added
Expand Down
2 changes: 0 additions & 2 deletions upcloud/load_balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,7 @@ type LoadBalancer struct {
Name string `json:"name,omitempty"`
Zone string `json:"zone,omitempty"`
Plan string `json:"plan,omitempty"`
NetworkUUID string `json:"network_uuid,omitempty"` // deprecated
Networks []LoadBalancerNetwork `json:"networks,omitempty"`
DNSName string `json:"dns_name,omitempty"` // deprecated
Labels []Label `json:"labels,omitempty"`
ConfiguredStatus LoadBalancerConfiguredStatus `json:"configured_status,omitempty"`
OperationalState LoadBalancerOperationalState `json:"operational_state,omitempty"`
Expand Down
50 changes: 43 additions & 7 deletions upcloud/load_balancer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,27 @@ func TestMarshalLoadBalancer(t *testing.T) {
[
{
"name": "example-service",
"network_uuid": "03631160-d57a-4926-ad48-a2f828229dcb",
"networks": [
{
"created_at": "2024-02-29T13:18:56.608082Z",
"updated_at": "2024-02-29T13:19:36.163476Z",
"name": "public",
"type": "public",
"family": "IPv4"
},
{
"created_at": "2024-02-29T13:19:28.748406Z",
"updated_at": "2024-02-29T13:19:36.163476Z",
"name": "private",
"type": "private",
"family": "IPv4",
"uuid": "0302f263-a52e-48c9-aa46-711cfb57a6e7"
}
],
"operational_state": "running",
"plan": "development",
"configured_status": "started",
"created_at": "2021-12-07T13:58:30.817272Z",
"dns_name": "lb-0aff6dac143c43009b33ee2756f6592d.upcloudlb.com",
"updated_at": "2022-02-11T17:33:59.898714Z",
"uuid": "0aff6dac-143c-4300-9b33-ee2756f6592d",
"zone": "fi-hel1",
Expand Down Expand Up @@ -79,6 +94,11 @@ func TestMarshalLoadBalancer(t *testing.T) {
"default_backend": "example-backend-1",
"mode": "http",
"name": "example-frontend",
"networks": [
{
"name": "public"
}
],
"port": 443,
"created_at": "2021-12-07T13:58:30.817272Z",
"updated_at": "2022-02-11T17:33:08.490581Z",
Expand Down Expand Up @@ -118,7 +138,7 @@ func TestMarshalLoadBalancer(t *testing.T) {
}
],
"nodes": [
{
{
"operational_state": "running",
"networks": [
{
Expand All @@ -141,12 +161,27 @@ func TestMarshalLoadBalancer(t *testing.T) {
}
]`
lbs := []LoadBalancer{{
UUID: "0aff6dac-143c-4300-9b33-ee2756f6592d",
Name: "example-service",
UUID: "0aff6dac-143c-4300-9b33-ee2756f6592d",
Name: "example-service",
Networks: []LoadBalancerNetwork{
{
Name: "public",
Type: "public",
Family: "IPv4",
CreatedAt: timeParse("2024-02-29T13:18:56.608082Z"),
UpdatedAt: timeParse("2024-02-29T13:19:36.163476Z"),
},
{
Name: "private",
Type: "private",
Family: "IPv4",
UUID: "0302f263-a52e-48c9-aa46-711cfb57a6e7",
CreatedAt: timeParse("2024-02-29T13:19:28.748406Z"),
UpdatedAt: timeParse("2024-02-29T13:19:36.163476Z"),
},
},
Zone: "fi-hel1",
Plan: "development",
NetworkUUID: "03631160-d57a-4926-ad48-a2f828229dcb",
DNSName: "lb-0aff6dac143c43009b33ee2756f6592d.upcloudlb.com",
ConfiguredStatus: LoadBalancerConfiguredStatusStarted,
OperationalState: LoadBalancerOperationalStateRunning,
CreatedAt: timeParse("2021-12-07T13:58:30.817272Z"),
Expand All @@ -162,6 +197,7 @@ func TestMarshalLoadBalancer(t *testing.T) {
Frontends: []LoadBalancerFrontend{
{
Name: "example-frontend",
Networks: []LoadBalancerFrontendNetwork{{Name: "public"}},
Mode: LoadBalancerModeHTTP,
Port: 443,
DefaultBackend: "example-backend-1",
Expand Down
1 change: 0 additions & 1 deletion upcloud/request/load_balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ type CreateLoadBalancerRequest struct {
Name string `json:"name,omitempty"`
Plan string `json:"plan,omitempty"`
Zone string `json:"zone,omitempty"`
NetworkUUID string `json:"network_uuid,omitempty"`
Networks []LoadBalancerNetwork `json:"networks,omitempty"`
ConfiguredStatus upcloud.LoadBalancerConfiguredStatus `json:"configured_status,omitempty"`
Frontends []LoadBalancerFrontend `json:"frontends"`
Expand Down
5 changes: 0 additions & 5 deletions upcloud/request/load_balancer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ func TestCreateLoadBalancerRequest(t *testing.T) {
"name": "example-service",
"plan": "development",
"zone": "fi-hel1",
"network_uuid": "03631160-d57a-4926-ad48-a2f828229dcb",
"configured_status": "started",
"frontends": [
{
Expand Down Expand Up @@ -101,7 +100,6 @@ func TestCreateLoadBalancerRequest(t *testing.T) {
Name: "example-service",
Plan: "development",
Zone: "fi-hel1",
NetworkUUID: "03631160-d57a-4926-ad48-a2f828229dcb",
ConfiguredStatus: upcloud.LoadBalancerConfiguredStatusStarted,
Frontends: []LoadBalancerFrontend{{
Name: "example-frontend",
Expand Down Expand Up @@ -1338,7 +1336,6 @@ func ExampleCreateLoadBalancerRequest() {
Name: "example-service",
Plan: "development",
Zone: "fi-hel1",
NetworkUUID: "03631160-d57a-4926-ad48-a2f828229dcb",
ConfiguredStatus: upcloud.LoadBalancerConfiguredStatusStarted,
Frontends: []LoadBalancerFrontend{{
Name: "example-frontend",
Expand Down Expand Up @@ -1392,7 +1389,6 @@ func TestCreateLoadBalancerLabelsRequest(t *testing.T) {
"name": "example-service",
"plan": "development",
"zone": "fi-hel1",
"network_uuid": "03631160-d57a-4926-ad48-a2f828229dcb",
"configured_status": "started",
"frontends": [],
"backends": [],
Expand All @@ -1409,7 +1405,6 @@ func TestCreateLoadBalancerLabelsRequest(t *testing.T) {
Name: "example-service",
Plan: "development",
Zone: "fi-hel1",
NetworkUUID: "03631160-d57a-4926-ad48-a2f828229dcb",
ConfiguredStatus: upcloud.LoadBalancerConfiguredStatusStarted,
Frontends: []LoadBalancerFrontend{},
Backends: []LoadBalancerBackend{},
Expand Down
Loading