-
Notifications
You must be signed in to change notification settings - Fork 33
enhance the sdk of cce addon to support listing addon instances #428
Conversation
3d5025a to
9344f42
Compare
Pull Request Test Coverage Report for Build 1275
💛 - Coveralls |
| return CCEServiceURL(client, cluster_id, rootPath, id+"?cluster_id="+cluster_id) | ||
| } | ||
|
|
||
| func resourceListURL(client *golangsdk.ServiceClient, cluster_id string) string { |
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.
we can use BuildQueryString to add query parameters
openstack/cce/v3/addons/urls.go
Outdated
| } | ||
|
|
||
| func CCEServiceURL(client *golangsdk.ServiceClient, cluster_id string, parts ...string) string { | ||
| rbUrl := "https://" + cluster_id + "." + client.ResourceBaseURL()[8:] |
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 line is hard to understand, suggest to use net/url package to generate it.
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.
fixed
openstack/cce/v3/addons/requests.go
Outdated
| // List returns collection of addons. | ||
| func List(client *golangsdk.ServiceClient, clusterID string, opts ListOpts) ([]Addon, error) { | ||
| var r ListResult | ||
| _, r.Err = client.Get(resourceListURL(client, clusterID), &r.Body, &golangsdk.RequestOpts{ |
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.
dose the RequestOpts is essential?
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.
fixed
openstack/cce/v3/addons/requests.go
Outdated
| } | ||
| } | ||
| } else { | ||
| refinedAddons = addons |
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.
looks this line is unnecessary.
openstack/cce/v3/addons/requests.go
Outdated
| matched = true | ||
|
|
||
| for key, value := range m { | ||
| if sVal := GetStructNestedField(&addon, key, value.Driller); !(sVal == value.Value) { |
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.
s/!(sVal == value.Value)/sVal != value.Value/ ?
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.
fixed
0e919cf to
4f23d9b
Compare
4f23d9b to
78bf6c3
Compare
What this PR does / why we need it:
enhance the sdk of cce addon to support listing addon instances
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close that issue when PR gets merged): fixes #Special notes for your reviewer:
Release note: