Skip to content
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

juju bug 1756135, improve handling of service catalog urls #62

Merged
merged 2 commits into from Mar 22, 2018

Conversation

hmlanigan
Copy link
Member

during api version discovery. Provide coverage to additional OpenStack deployments.
Add Trace to client logging.

Tested against the on-site config, openstack and rackspace, and additional unit tests.

@hmlanigan
Copy link
Member Author

version discovery.  Provide coverage to additional OpenStack deployments.

Add Trace to client logging.
@@ -118,6 +118,30 @@ func (s *localLiveSuite) makeServiceURLTests() []makeServiceURLTest {
success: false,
err: "no endpoints known for service type: no-such-service",
},
{
Copy link

Choose a reason for hiding this comment

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

Are these completely representative of everything we saw? I'm thinking of the double version in the URL, like https://10.235.28.252/volumev2/v1/

Copy link
Member Author

Choose a reason for hiding this comment

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

added.

client/client.go Outdated
logger.Tracef("MakeServiceURL: %s",returnURL)
}
} ()

Copy link

Choose a reason for hiding this comment

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

Might be nice to include the URL you are falling back to in logger.Warningf("falling back to catalogue service URL").

Copy link
Member Author

Choose a reason for hiding this comment

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

We do print out the catalogue near the top of bootstrap... and the url will be printed too if trace is enable.

}
return nil, err
if err := c.sendRequest("GET", getVersionURL, c.Token(), requestData); err != nil {
logger.Debugf("API version discovery failed: %v", err)
Copy link

Choose a reason for hiding this comment

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

This was warn -- I think we should keep it on warn. We would want every user to see this.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

// some hrefURL.Path contain more than the version, with
// overlap on the apiURLVersionInfo.rootURL
if strings.HasPrefix(match, "/"+versionURL.Path) {
versionURL.Path = "/"
Copy link

Choose a reason for hiding this comment

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

Maybe I'm being verbose, but trace logging for this?

Copy link
Member Author

Choose a reason for hiding this comment

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

added.

for i, p := range pathParts {
if _, err := parseVersion(p); err == nil {
found = true
if i == 0 {
Copy link

Choose a reason for hiding this comment

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

Debug statements would be useful here for each condition - if we have to do this again, it would be nice to understand how juju parsed it.

Copy link

Choose a reason for hiding this comment

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

Can you also provide an example URL or format for each case?

Copy link
Member Author

Choose a reason for hiding this comment

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

added logger.tracef and additional comments

@nskaggs
Copy link

nskaggs commented Mar 21, 2018

$$merge$$

@hmlanigan hmlanigan merged commit 36df5d1 into go-goose:v2 Mar 22, 2018
@hmlanigan hmlanigan deleted the bug1756135 branch July 19, 2018 19:38
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.

None yet

2 participants