Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Conversation

@Jason-Zhang9309
Copy link
Collaborator

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:

@Jason-Zhang9309 Jason-Zhang9309 force-pushed the dev-cce-addon branch 2 times, most recently from 3d5025a to 9344f42 Compare April 14, 2021 08:30
@coveralls
Copy link

coveralls commented Apr 14, 2021

Pull Request Test Coverage Report for Build 1275

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 68.244%

Totals Coverage Status
Change from base Build 1272: 0.0%
Covered Lines: 11667
Relevant Lines: 17096

💛 - Coveralls

return CCEServiceURL(client, cluster_id, rootPath, id+"?cluster_id="+cluster_id)
}

func resourceListURL(client *golangsdk.ServiceClient, cluster_id string) string {
Copy link
Collaborator

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

}

func CCEServiceURL(client *golangsdk.ServiceClient, cluster_id string, parts ...string) string {
rbUrl := "https://" + cluster_id + "." + client.ResourceBaseURL()[8:]
Copy link
Collaborator

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

// 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{
Copy link
Collaborator

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

}
}
} else {
refinedAddons = addons
Copy link
Collaborator

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.

matched = true

for key, value := range m {
if sVal := GetStructNestedField(&addon, key, value.Driller); !(sVal == value.Value) {
Copy link
Collaborator

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/ ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@Jason-Zhang9309 Jason-Zhang9309 force-pushed the dev-cce-addon branch 2 times, most recently from 0e919cf to 4f23d9b Compare April 19, 2021 08:12
@ShiChangkuo ShiChangkuo merged commit cc06e26 into huaweicloud:master Apr 20, 2021
@Jason-Zhang9309 Jason-Zhang9309 deleted the dev-cce-addon branch May 6, 2021 09:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants