Skip to content

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

Merged
merged 5 commits into from
Mar 28, 2018
Merged

Fix panic when no backends #157

merged 5 commits into from
Mar 28, 2018

Conversation

prydie
Copy link
Contributor

@prydie prydie commented Mar 26, 2018

Resolves: #67 and #152

@prydie prydie requested review from owainlewis and jhorwit2 March 26, 2018 15:15
@owainlewis owainlewis self-assigned this Mar 26, 2018
@owainlewis owainlewis requested a review from simonlord March 26, 2018 15:28
@prydie prydie added this to the 0.3.0 milestone Mar 26, 2018
prydie added 2 commits March 27, 2018 09:50
Remove old node port rule in securityListManger.Update() rather than
calling securityListManger.Delete() and then
securityListManger.Update().
@prydie prydie force-pushed the ap/backendset-panic branch from 3ca25e0 to 8c4cce7 Compare March 27, 2018 12:33
"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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically not needed

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
Copy link
Member

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"
Copy link
Member

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.

if len(defaultSubnets) != 2 {
return LBSpec{}, errors.New("defualt subnets incorrectly configured")
return nil, errors.New("defualt subnets incorrectly configured")
Copy link
Member

@owainlewis owainlewis Mar 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defualt => default

}

func getBackends(nodes []*v1.Node, nodePort int32) []loadbalancer.BackendDetails {
if len(nodes) < 1 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if len(nodes) == 0 ?

Copy link
Member

@owainlewis owainlewis left a 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.

@prydie prydie force-pushed the ap/backendset-panic branch from d6c57e6 to 36b38a1 Compare March 27, 2018 19:45
@prydie prydie force-pushed the ap/backendset-panic branch from 36b38a1 to 121d2c3 Compare March 27, 2018 19:47
@prydie
Copy link
Contributor Author

prydie commented Mar 27, 2018

@owainlewis ready for a final review and merge.

@owainlewis owainlewis merged commit 3d533ef into master Mar 28, 2018
@owainlewis owainlewis deleted the ap/backendset-panic branch March 28, 2018 07:33
ayushverma14 pushed a commit to ayushverma14/oci-cloud-controller-manager that referenced this pull request Jul 18, 2022
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants