From 1fe7076f69d834a01dc106aebc83090a3a0a7dd8 Mon Sep 17 00:00:00 2001 From: Bill Gale Date: Tue, 28 Nov 2023 10:33:28 +0000 Subject: [PATCH] feat(load-balancer-rule): add load balancer ref (#148) --- core/load_balancer_rule.go | 1 + core/load_balancer_rule_test.go | 3 +++ .../TestLoadBalancerRule_JSONMarshalling/full.golden | 5 ++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/core/load_balancer_rule.go b/core/load_balancer_rule.go index 4062843..682b87e 100644 --- a/core/load_balancer_rule.go +++ b/core/load_balancer_rule.go @@ -51,6 +51,7 @@ type LoadBalancerRule struct { CheckRise int `json:"check_rise,omitempty"` CheckTimeout int `json:"check_timeout,omitempty"` CheckHTTPStatuses HTTPStatuses `json:"check_http_statuses,omitempty"` + LoadBalancer *LoadBalancerRef `json:"load_balancer,omitempty"` } func (lbr *LoadBalancerRule) Ref() LoadBalancerRuleRef { diff --git a/core/load_balancer_rule_test.go b/core/load_balancer_rule_test.go index 8bcc7ab..81e9813 100644 --- a/core/load_balancer_rule_test.go +++ b/core/load_balancer_rule_test.go @@ -75,6 +75,9 @@ func TestLoadBalancerRule_JSONMarshalling(t *testing.T) { CheckRise: 12, CheckTimeout: 3, CheckHTTPStatuses: HTTPStatusesAll2xx, + LoadBalancer: &LoadBalancerRef{ + ID: "yet another abitrary string", + }, }, }, } diff --git a/core/testdata/TestLoadBalancerRule_JSONMarshalling/full.golden b/core/testdata/TestLoadBalancerRule_JSONMarshalling/full.golden index 2c2432f..ddd27c4 100644 --- a/core/testdata/TestLoadBalancerRule_JSONMarshalling/full.golden +++ b/core/testdata/TestLoadBalancerRule_JSONMarshalling/full.golden @@ -20,5 +20,8 @@ "check_protocol": "HTTP", "check_rise": 12, "check_timeout": 3, - "check_http_statuses": "2" + "check_http_statuses": "2", + "load_balancer": { + "id": "yet another abitrary string" + } }