-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Check opts of cloud config file #48348
Check opts of cloud config file #48348
Conversation
Hi @FengyunPan. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
9874ed5
to
ec616b2
Compare
/ok-to-test |
9d8fdc9
to
8002880
Compare
/test pull-kubernetes-e2e-gce-etcd3 |
/assign |
/approve |
/lgtm |
/approve |
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.
some minor style comments
|
||
// if need to create health monitor for Neutron LB, | ||
// monitor-delay, monitor-timeout and monitor-max-retries should be set. | ||
emptyDuration := new(MyDuration) |
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.
No need to create a reference to a MyDuration
only to deref it again later. Just do: emptyDuration := MyDuration{}
here and remove the asterisks below.
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.
Done.
delay := new(MyDuration) | ||
delay.Duration = 60 * time.Second | ||
timeout := new(MyDuration) | ||
timeout.Duration = 30 * time.Second |
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.
Similar to earlier comment - these MyDuration objects should just be regular objects, not references.
delay := MyDuration{60 * time.Second}
timeout := MyDuration{30 * time.Second}
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.
Done.
@@ -53,6 +53,11 @@ const ProviderName = "openstack" | |||
var ErrNotFound = errors.New("Failed to find object") | |||
var ErrMultipleResults = errors.New("Multiple results where only one expected") | |||
var ErrNoAddressFound = errors.New("No address found for host") | |||
var ErrNoSubnetId = errors.New("subnet-id not set in cloud provider config") |
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.
It's highly unlikely any caller is going to want to match against one of these different errors explicitly.
So instead of growing a huge list of pre-built errors here, delete these and just use in-line error strings in the function below:
if len(lbOpts.SubnetId) == 0 {
return fmt.Errorf("subnet-id not set in cloud provider config")
}
// etc
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.
Done. Thank you very much.
Fix kubernetes#48347 Check opts when register OpenStack CloudProvider rather than returning error when use opts to create/use cloud resource.
8002880
to
d2ebb60
Compare
/test pull-kubernetes-federation-e2e-gce |
/test pull-kubernetes-kubemark-e2e-gce |
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: FengyunPan, dims Associated issue: 48347 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue (batch tested with PRs 47234, 48410, 48514, 48529, 48348) |
Automatic merge from submit-queue (batch tested with PRs 47234, 48410, 48514, 48529, 48348) Check opts of cloud config file Fix kubernetes#48347 Check opts when register OpenStack CloudProvider rather than returning error when use opts to create/use cloud resource. **Release note**: ```release-note NONE ```
Fix #48347
Check opts when register OpenStack CloudProvider rather than
returning error when use opts to create/use cloud resource.
Release note: