Revision c36fdec1

Added by Partha Aji almost 8 years ago

Fixes #10404 - Finds correct repo name for Docker Hub registry

Bug is stated as follows
on centos 7 ->

$ docker version
Client version: 1.5.0-dev
Client API version: 1.18
Go version (client): go1.3.3

$ docker search centos
NAME DESCRIPTION STARS OFFICIAL AUTOMATED The official build of CentOS. 978 [OK] Ansible on Centos7 40 [OK]

On fedora 20 ->
$ docker version
Client version: 1.5.0
Client API version: 1.17

$ docker search centos
centos The official build of CentOS. 978 [OK]
ansible/centos7-ansible Ansible on Centos7 40 [OK]

Note the " " prefix for the centos 7 name columns
has details on why thats the case.

When you ask foreman-docker "search centos from docker hub", it gives
you different names based on whether the docker compute resource is
running on el7 or fedora 20. You then select an image and it shows the
tags for that. Based on your selections it picks "NAME" as the repo name
and chooses the tag. This works for docker compute instance running on
f20 and used to work for docker instance on el7.

Anyway problem is simple -> "" is not a valid
repo name. So foreman-docker has to somehow infer that
"" is what the repo name should be and strip out
" " while it should some how also work for
"" and not strip out

This commit achieves to do that.

Also removing the hub_url code generation code because we'd need some
logic that converts to and also work for rhel and regular

View differences:

7 7
8 8
9 9
      <%= trunc_with_tooltip(repository['description']) %>
      <%= link_to '<span class="glyphicon glyphicon-share"></span>'.html_safe, hub_url(repository), :target => '_blank' %>
11 10
12 11
<% end %>

Also available in: Unified diff