-
Notifications
You must be signed in to change notification settings - Fork 93
Fix panic when no backends #157
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
Conversation
Remove old node port rule in securityListManger.Update() rather than calling securityListManger.Delete() and then securityListManger.Update().
3ca25e0
to
8c4cce7
Compare
pkg/oci/load_balancer.go
Outdated
"github.com/oracle/oci-go-sdk/core" | ||
"github.com/oracle/oci-go-sdk/loadbalancer" | ||
"github.com/pkg/errors" | ||
|
||
api "k8s.io/api/core/v1" | ||
v1 "k8s.io/api/core/v1" |
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.
Technically not needed
pkg/oci/load_balancer.go
Outdated
func (cp *CloudProvider) updateListener(ctx context.Context, lbID string, action *ListenerAction, ports portSpec, lbSubnets, nodeSubnets []*core.Subnet, sourceCIDRs []string) error { | ||
var workRequestID string | ||
var err error | ||
l := action.Listener |
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.
I'd avoid using variable names that are this ambiguous in this context. Would prefer for clarity
listener := action.Listener
@@ -21,18 +21,20 @@ import ( | |||
"github.com/oracle/oci-go-sdk/common" | |||
"github.com/oracle/oci-go-sdk/core" | |||
|
|||
"k8s.io/api/core/v1" | |||
v1 "k8s.io/api/core/v1" |
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.
Minor: This is generally inconsistent in this PR. Sometimes it's qualified sometimes not. We don't need to qualify so suggest removing.
pkg/oci/load_balancer_spec.go
Outdated
if len(defaultSubnets) != 2 { | ||
return LBSpec{}, errors.New("defualt subnets incorrectly configured") | ||
return nil, errors.New("defualt subnets incorrectly configured") |
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.
defualt => default
pkg/oci/load_balancer_spec.go
Outdated
} | ||
|
||
func getBackends(nodes []*v1.Node, nodePort int32) []loadbalancer.BackendDetails { | ||
if len(nodes) < 1 { |
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.
if len(nodes) == 0 ?
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.
Generally looking good. Couple of minor typos and nits. Nothing major.
d6c57e6
to
36b38a1
Compare
36b38a1
to
121d2c3
Compare
@owainlewis ready for a final review and merge. |
* Refactor LBSpec to derive state up-front * Fix panic when no backends * Refactor security list manager to use portSpec * Remove old node port rule in Update() * Remove old node port rule in securityListManger.Update() rather than
Resolves: #67 and #152