-
Notifications
You must be signed in to change notification settings - Fork 193
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
OCPBUGS-16728: Require Service Deletion for LB Type Updates #1142
base: master
Are you sure you want to change the base?
Changes from all commits
c25c6c1
3dcff76
0d249ce
5862310
1a57afd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -652,20 +652,6 @@ func TestSetDefaultPublishingStrategyHandlesUpdates(t *testing.T) { | |||||
expectedIC: makeIC(spec(elb()), status(elbWithNullParameters())), | ||||||
domainMatchesBaseDomain: true, | ||||||
}, | ||||||
{ | ||||||
name: "loadbalancer type changed from ELB to NLB, with old ELB parameters removal", | ||||||
ic: makeIC(spec(nlb()), status(elbWithNullParameters())), | ||||||
expectedResult: true, | ||||||
expectedIC: makeIC(spec(nlb()), status(nlbWithNullParameters())), | ||||||
domainMatchesBaseDomain: true, | ||||||
}, | ||||||
{ | ||||||
name: "loadbalancer type changed from NLB to ELB, with old NLB parameters removal", | ||||||
ic: makeIC(spec(elb()), status(nlbWithNullParameters())), | ||||||
expectedResult: true, | ||||||
expectedIC: makeIC(spec(elb()), status(elbWithNullParameters())), | ||||||
domainMatchesBaseDomain: true, | ||||||
}, | ||||||
Comment on lines
-655
to
-668
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason you removed these test cases rather than changing them to match the new behavior? Granted, |
||||||
{ | ||||||
name: "loadbalancer type changed from NLB to unset, with Classic LB as default", | ||||||
ic: makeIC(spec(eps(lbs(operatorv1.ExternalLoadBalancer, &managedDNS))), status(nlb())), | ||||||
|
@@ -1465,11 +1451,20 @@ func Test_IsProxyProtocolNeeded(t *testing.T) { | |||||
Protocol: operatorv1.ProxyProtocol, | ||||||
}, | ||||||
} | ||||||
serviceWithELB = corev1.Service{} | ||||||
serviceWithNLB = corev1.Service{ | ||||||
ObjectMeta: metav1.ObjectMeta{ | ||||||
Annotations: map[string]string{ | ||||||
AWSLBTypeAnnotation: AWSNLBAnnotation, | ||||||
}, | ||||||
}, | ||||||
} | ||||||
) | ||||||
testCases := []struct { | ||||||
description string | ||||||
strategy *operatorv1.EndpointPublishingStrategy | ||||||
platform *configv1.PlatformStatus | ||||||
service *corev1.Service | ||||||
expect bool | ||||||
expectError bool | ||||||
}{ | ||||||
|
@@ -1515,6 +1510,20 @@ func Test_IsProxyProtocolNeeded(t *testing.T) { | |||||
platform: &awsPlatform, | ||||||
expect: false, | ||||||
}, | ||||||
{ | ||||||
description: "loadbalancer strategy with NLB, but a service with ELB should use PROXY", | ||||||
strategy: &loadBalancerStrategyWithNLB, | ||||||
platform: &awsPlatform, | ||||||
service: &serviceWithELB, | ||||||
expect: true, | ||||||
}, | ||||||
{ | ||||||
description: "loadbalancer strategy with ELB, but a service with NLB shouldn't use PROXY", | ||||||
strategy: &loadBalancerStrategyWithNLB, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
based on the description of the test case. |
||||||
platform: &awsPlatform, | ||||||
service: &serviceWithNLB, | ||||||
expect: false, | ||||||
}, | ||||||
{ | ||||||
description: "loadbalancer strategy shouldn't use PROXY on Azure", | ||||||
strategy: &loadBalancerStrategy, | ||||||
|
@@ -1596,7 +1605,7 @@ func Test_IsProxyProtocolNeeded(t *testing.T) { | |||||
EndpointPublishingStrategy: tc.strategy, | ||||||
}, | ||||||
} | ||||||
switch actual, err := IsProxyProtocolNeeded(ic, tc.platform); { | ||||||
switch actual, err := IsProxyProtocolNeeded(ic, tc.platform, tc.service); { | ||||||
case tc.expectError && err == nil: | ||||||
t.Error("expected error, got nil") | ||||||
case !tc.expectError && err != nil: | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.