Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename user_given_name to service_name for loadbalancer #184

Merged
merged 1 commit into from
Feb 29, 2024
Merged
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
6 changes: 3 additions & 3 deletions loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type LoadBalancerBackendConfig struct {
type LoadBalancer struct {
ID string `json:"id"`
Name string `json:"name"`
UserGivenName string `json:"user_given_name,omitempty"`
ServiceName string `json:"service_name,omitempty"`
Algorithm string `json:"algorithm"`
Backends []LoadBalancerBackend `json:"backends"`
ExternalTrafficPolicy string `json:"external_traffic_policy,omitempty"`
Expand All @@ -52,7 +52,7 @@ type LoadBalancer struct {
type LoadBalancerConfig struct {
Region string `json:"region"`
Name string `json:"name"`
UserGivenName string `json:"user_given_name,omitempty"`
ServiceName string `json:"service_name,omitempty"`
NetworkID string `json:"network_id,omitempty"`
Algorithm string `json:"algorithm,omitempty"`
Backends []LoadBalancerBackendConfig `json:"backends"`
Expand All @@ -77,7 +77,7 @@ type LoadBalancerOptions struct {
type LoadBalancerUpdateConfig struct {
Region string `json:"region"`
Name string `json:"name,omitempty"`
UserGivenName string `json:"user_given_name,omitempty"`
ServiceName string `json:"service_name,omitempty"`
Algorithm string `json:"algorithm,omitempty"`
Backends []LoadBalancerBackendConfig `json:"backends,omitempty"`
ExternalTrafficPolicy string `json:"external_traffic_policy,omitempty"`
Expand Down
18 changes: 9 additions & 9 deletions loadbalancer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func TestCreateLoadBalancer(t *testing.T) {
"/v2/loadbalancers": `{
"id": "56dca3ae-ea3f-480f-9b25-abf90b439729",
"name": "test-default-lb",
"user_given_name": "lb",
"service_name": "lb",
"network_id": "b064d568-5869-427c-827a-77d48cde6a2e",
"algorithm": "round_robin",
"backends": [
Expand Down Expand Up @@ -143,10 +143,10 @@ func TestCreateLoadBalancer(t *testing.T) {
}

expected := &LoadBalancer{
ID: "56dca3ae-ea3f-480f-9b25-abf90b439729",
Name: "test-default-lb",
UserGivenName: "lb",
Algorithm: "round_robin",
ID: "56dca3ae-ea3f-480f-9b25-abf90b439729",
Name: "test-default-lb",
ServiceName: "lb",
Algorithm: "round_robin",
Backends: []LoadBalancerBackend{
{
IP: "192.168.1.3",
Expand Down Expand Up @@ -174,7 +174,7 @@ func TestUpdateLoadBalancer(t *testing.T) {
"/v2/loadbalancers/a1bd123c-b7e2-4d4f-9fda-7940c7e06b38": `{
"id": "a1bd123c-b7e2-4d4f-9fda-7940c7e06b38",
"name": "test-lb-updated",
"user_given_name": "updated",
"service_name": "updated",
"network_id": "b064d568-5869-427c-827a-77d48cde6a2e",
"algorithm": "round_robin",
"external_traffic_policy": "Cluster",
Expand Down Expand Up @@ -209,7 +209,7 @@ func TestUpdateLoadBalancer(t *testing.T) {
expected := &LoadBalancer{
ID: "a1bd123c-b7e2-4d4f-9fda-7940c7e06b38",
Name: "test-lb-updated",
UserGivenName: "updated",
ServiceName: "updated",
Algorithm: "round_robin",
ExternalTrafficPolicy: "Cluster",
Backends: []LoadBalancerBackend{
Expand Down Expand Up @@ -239,7 +239,7 @@ func TestGetLoadBalancer(t *testing.T) {
"/v2/loadbalancers/a1bd123c-b7e2-4d4f-9fda-7940c7e06b38": `{
"id": "a1bd123c-b7e2-4d4f-9fda-7940c7e06b38",
"name": "test-lb-updated",
"user_given_name": "updated",
"service_name": "updated",
"network_id": "b064d568-5869-427c-827a-77d48cde6a2e",
"algorithm": "round_robin",
"external_traffic_policy": "Cluster",
Expand Down Expand Up @@ -271,7 +271,7 @@ func TestGetLoadBalancer(t *testing.T) {
expected := &LoadBalancer{
ID: "a1bd123c-b7e2-4d4f-9fda-7940c7e06b38",
Name: "test-lb-updated",
UserGivenName: "updated",
ServiceName: "updated",
Algorithm: "round_robin",
ExternalTrafficPolicy: "Cluster",
Backends: []LoadBalancerBackend{
Expand Down
Loading