-
Notifications
You must be signed in to change notification settings - Fork 26
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
Fix issue with services controller when load balancing should be disabled #232
Conversation
…bled Signed-off-by: Jason DeTiberus <detiber@users.noreply.github.com>
var ( | ||
validCloud *cloud | ||
backend *store.Memory | ||
) |
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.
Removing these variables was the easiest way that I could enable testing with different configurations instead of a common shared config.
func TestLoadBalancerDefaultDisabled(t *testing.T) { | ||
vc, _ := testGetValidCloud(t, "") | ||
response, supported := vc.LoadBalancer() | ||
var ( | ||
expectedSupported = false | ||
expectedResponse = response | ||
) | ||
if supported != expectedSupported { | ||
t.Errorf("supported returned %v instead of expected %v", supported, expectedSupported) | ||
} | ||
if response != expectedResponse { | ||
t.Errorf("value returned %v instead of expected %v", response, expectedResponse) | ||
} | ||
} |
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.
This was previously returning true erroneously, now it properly returns false.
} | ||
if response != expectedResponse { | ||
t.Errorf("value returned %v instead of expected %v", response, expectedResponse) | ||
} | ||
} |
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.
Skipping these because we don't have a k8s client plumbed through for the code paths to be able to run.
func TestLoadBalancerKubeVIP(t *testing.T) { | ||
t.Skip("Test needs a k8s client to work") | ||
vc, _ := testGetValidCloud(t, "kube-vip://") |
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.
Skipping these because we don't have a k8s client plumbed through for the code paths to be able to run.
When trying to run with the load balancer disabled, currently the controller will panic, because we are testing if an interface is nil rather than if the value of the interface is nil).
Replacing the interface types in the cloud struct with the concrete types resolves the issue and as far as I can tell does not impact anything else.