Skip to content

Commit

Permalink
OMG goland do your go fmt thing
Browse files Browse the repository at this point in the history
Signed-off-by: Raffaele Di Fazio <raffo@github.com>
  • Loading branch information
Raffo committed Nov 22, 2020
1 parent 6803d57 commit 904bf83
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 35 deletions.
22 changes: 11 additions & 11 deletions plan/plan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -688,15 +688,15 @@ func TestNormalizeDNSName(t *testing.T) {
}

func TestShouldUpdateProviderSpecific(tt *testing.T) {
comparator := func (name, previous, current string) bool {
comparator := func(name, previous, current string) bool {
return previous == current
}
for _, test := range []struct {
name string
current *endpoint.Endpoint
desired *endpoint.Endpoint
name string
current *endpoint.Endpoint
desired *endpoint.Endpoint
propertyComparator func(name, previous, current string) bool
shouldUpdate bool
shouldUpdate bool
}{
{
name: "skip AWS target health",
Expand All @@ -713,7 +713,7 @@ func TestShouldUpdateProviderSpecific(tt *testing.T) {
},
},
propertyComparator: comparator,
shouldUpdate: false,
shouldUpdate: false,
},
{
name: "custom property unchanged",
Expand All @@ -728,7 +728,7 @@ func TestShouldUpdateProviderSpecific(tt *testing.T) {
},
},
propertyComparator: comparator,
shouldUpdate: false,
shouldUpdate: false,
},
{
name: "custom property value changed",
Expand All @@ -743,7 +743,7 @@ func TestShouldUpdateProviderSpecific(tt *testing.T) {
},
},
propertyComparator: comparator,
shouldUpdate: true,
shouldUpdate: true,
},
{
name: "custom property key changed",
Expand All @@ -758,7 +758,7 @@ func TestShouldUpdateProviderSpecific(tt *testing.T) {
},
},
propertyComparator: comparator,
shouldUpdate: true,
shouldUpdate: true,
},
{
name: "desired has same key and value as current but not comparator is set",
Expand Down Expand Up @@ -805,8 +805,8 @@ func TestShouldUpdateProviderSpecific(tt *testing.T) {
} {
tt.Run(test.name, func(t *testing.T) {
plan := &Plan{
Current: []*endpoint.Endpoint{test.current},
Desired: []*endpoint.Endpoint{test.desired},
Current: []*endpoint.Endpoint{test.current},
Desired: []*endpoint.Endpoint{test.desired},
PropertyComparator: test.propertyComparator,
}
b := plan.shouldUpdateProviderSpecific(test.desired, test.current)
Expand Down
1 change: 0 additions & 1 deletion provider/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ func NewAWSProvider(awsConfig AWSConfig) (*AWSProvider, error) {
return provider, nil
}


func (p *AWSProvider) PropertyValuesEqual(name string, previous string, current string) bool {
if name == "aws/evaluate-target-health" {
return true
Expand Down
20 changes: 10 additions & 10 deletions provider/aws/aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1101,41 +1101,41 @@ func TestAWSSuitableZones(t *testing.T) {
}

func TestAWSHealthTargetAnnotation(tt *testing.T) {
comparator := func (name, previous, current string) bool {
comparator := func(name, previous, current string) bool {
return previous == current
}
for _, test := range []struct {
name string
current *endpoint.Endpoint
desired *endpoint.Endpoint
name string
current *endpoint.Endpoint
desired *endpoint.Endpoint
propertyComparator func(name, previous, current string) bool
shouldUpdate bool
shouldUpdate bool
}{
{
name: "skip AWS target health",
current: &endpoint.Endpoint{
RecordType: "A",
DNSName: "foo.com",
DNSName: "foo.com",
ProviderSpecific: []endpoint.ProviderSpecificProperty{
{Name: "aws/evaluate-target-health", Value: "true"},
},
},
desired: &endpoint.Endpoint{
DNSName: "foo.com",
DNSName: "foo.com",
RecordType: "A",
ProviderSpecific: []endpoint.ProviderSpecificProperty{
{Name: "aws/evaluate-target-health", Value: "false"},
},
},
propertyComparator: comparator,
shouldUpdate: false,
shouldUpdate: false,
},
} {
tt.Run(test.name, func(t *testing.T) {
provider := &AWSProvider{}
plan := &plan.Plan{
Current: []*endpoint.Endpoint{test.current},
Desired: []*endpoint.Endpoint{test.desired},
Current: []*endpoint.Endpoint{test.current},
Desired: []*endpoint.Endpoint{test.desired},
PropertyComparator: provider.PropertyValuesEqual,
}
plan = plan.Calculate()
Expand Down
24 changes: 12 additions & 12 deletions source/ingress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -997,31 +997,31 @@ func testIngressEndpoints(t *testing.T) {
},
},
{
title: "ignore tls section",
targetNamespace: "",
ignoreIngressTLSSpec: true,
title: "ignore tls section",
targetNamespace: "",
ignoreIngressTLSSpec: true,
ingressItems: []fakeIngress{
{
name: "fake1",
namespace: namespace,
name: "fake1",
namespace: namespace,
tlsdnsnames: [][]string{{"example.org"}},
ips: []string{"1.2.3.4"},
},
},
},
expected: []*endpoint.Endpoint{},
},
{
title: "reading tls section",
targetNamespace: "",
ignoreIngressTLSSpec: false,
title: "reading tls section",
targetNamespace: "",
ignoreIngressTLSSpec: false,
ingressItems: []fakeIngress{
{
name: "fake1",
namespace: namespace,
name: "fake1",
namespace: namespace,
tlsdnsnames: [][]string{{"example.org"}},
ips: []string{"1.2.3.4"},
},
},
},
expected: []*endpoint.Endpoint{
{
DNSName: "example.org",
Expand Down
2 changes: 1 addition & 1 deletion source/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,5 +157,5 @@ func TestByNames(t *testing.T) {
}

var minimalConfig = &Config{
ContourLoadBalancerService: "heptio-contour/contour",
ContourLoadBalancerService: "heptio-contour/contour",
}

0 comments on commit 904bf83

Please sign in to comment.