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

Bug 1576881 - Add /v2/_catalog support for openshift adapter #74

Merged
merged 9 commits into from May 21, 2018

Conversation

dymurray
Copy link
Contributor

@dymurray dymurray commented May 8, 2018

No description provided.

@dymurray
Copy link
Contributor Author

dymurray commented May 9, 2018

@johnkim76 Do we have a bug for this? If so I believe we need to create 2 PRs... one against master and one against release-1.0

jmrodri
jmrodri previously requested changes May 9, 2018
Copy link
Contributor

@jmrodri jmrodri left a comment

Choose a reason for hiding this comment

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

Use *f versions of logging statements when substitution strings are used. Also add some more logging for the error conditions I noted, particularly the one where we get a !200 status code. Definitely want to print the actual status code we got to make it easier to debug in the future.

images := r.Config.Images
log.Debugf("Configured to use images: %v", images)
if r.Config.Images != nil {
log.Debug("Configured to use images: %v", r.Config.Images)
Copy link
Contributor

Choose a reason for hiding this comment

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

Use log.Debugf

log.Debug("Configured to use images: %v", r.Config.Images)
return r.Config.Images, nil
}
log.Debug("Did not find images in config, attempting to discover from %s/v2/_catalog", r.Config.URL)
Copy link
Contributor

Choose a reason for hiding this comment

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

Use log.Debugf whenever you have a substitution string in the string. i.e. %s or %v.

defer resp.Body.Close()

if resp.StatusCode != 200 {
return nil, errors.New(resp.Status)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would add an error or warning log here. It would be nice to get as much information as to why we hit this exceptional case. I just know when we hit this we're going to wonder what really happened, and we'll add a log debug in to figure it out. If the warning or error were there already, we'd know why we got a !200.

@dymurray
Copy link
Contributor Author

Thanks for the feedback @jmrodri. Made the requested changes.

@dymurray dymurray changed the title Add /v2/_catalog support for openshift adapter Bug 1576881 - Add /v2/_catalog support for openshift adapter May 10, 2018
Copy link
Contributor

@shawn-hurley shawn-hurley left a comment

Choose a reason for hiding this comment

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

VISACK

@dymurray
Copy link
Contributor Author

#77

@dymurray
Copy link
Contributor Author

Please look through the changes on #77 and if you agree with the name change I will make the same changes here for master.

@dymurray dymurray dismissed jmrodri’s stale review May 18, 2018 12:35

Old review... Gone through a lot of changes since then :)

Copy link
Contributor

@jmrodri jmrodri left a comment

Choose a reason for hiding this comment

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

I think this should use the change from @maleck13 PR #87 .

}
log.Debugf("Did not find images in config, attempting to discover from %s/v2/_catalog", r.Config.URL)

req, err := http.NewRequest("GET", fmt.Sprintf(partnerCatalogURL, r.Config.URL), nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should use the change from @maleck13 PR #87 .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like @maleck13's change only affects the loadSpec function not the Catalog call... this is unique to the partner adapter.

I'm fine with making the change to loadSpec once it's merged.

@dymurray dymurray merged commit 09683e1 into master May 21, 2018
@jmrodri jmrodri deleted the partner-reg branch February 1, 2019 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants