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 1507111 - Do not force image tag to be IP + Port #540

Merged
merged 5 commits into from
Nov 7, 2017

Conversation

dymurray
Copy link
Member

@dymurray dymurray commented Nov 7, 2017

This PR changes default behavior of local registry adapter to not error out if APB name does not start with IP+port. This was erroring out when a user's image was being tagged with the svc name instead.

Changes proposed in this pull request

  • Change error to debug statement and continue
  • Set default namespace to openshift if not set

@openshift-ci-robot openshift-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 7, 2017
r.Config.Namespaces = append(r.Config.Namespaces, "openshift")
}
spec.Image = image.Name
namespace := strings.Split(image.Name, "/")[1]
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like blindly accessing index of an array

@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 7, 2017
ns_list := strings.Split(image.Name, "/")
var namespace string
if len(ns_list) == 0 {
r.Log.Errorf("Image [%v] is not in the proper format. Erroring.")
Copy link
Contributor

Choose a reason for hiding this comment

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

missing image name in print statement.

}
}
if strings.HasPrefix(image.Name, registryIP) == false {
r.Log.Debugf("Image does not have a registry IP as prefix. This might cause problems but not erroring out.")
Copy link
Member

Choose a reason for hiding this comment

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

Why not Warningf then?

Copy link
Member Author

Choose a reason for hiding this comment

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

@djzager Because if you look a few lines below it is possible that S2I images will not have any registry prefix at all. I'm indifferent to which type of logging statement it is but with 10 S2I images that would output 10 warning statements in the logs for something that is expected behavior.

Feels weird to warn the user over expected behavior.

Copy link
Member

Choose a reason for hiding this comment

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

I figured there was a reason. In this case, the text of the message is the warning. Works for me.

Copy link
Member

@djzager djzager left a comment

Choose a reason for hiding this comment

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

Visual ACK

@djzager djzager merged commit a12a10b into openshift:master Nov 7, 2017
jianzhangbjz pushed a commit to jianzhangbjz/ansible-service-broker that referenced this pull request May 17, 2018
* Bug 1507111 - Do not force image tag to be IP + Port

* Better warning statement

* Better error handling for bad image names

* Forgot print statement

* Linting fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-review size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants