More fixes for the Ceph docker images url parsing
authorGiulio Fidente <gfidente@redhat.com>
Fri, 18 Aug 2017 16:01:02 +0000 (18:01 +0200)
committerGiulio Fidente <gfidente@redhat.com>
Fri, 18 Aug 2017 16:01:02 +0000 (18:01 +0200)
Existing code was still failing the following scenario:

  http://192.168.24.1:8787/ceph/rhceph-2-rhel7:latest

Now this has been tested with the following variations:

  http://192.168.24.1:8787/ceph/rhceph-2-rhel7:latest
  http://192.168.24.1:8787/rhceph-2-rhel7:latest
  192.168.24.1:8787/ceph/rhceph-2-rhel7:latest
  192.168.24.1:8787/rhceph-2-rhel7:latest
  192.168.24.1/ceph/daemon:latest

And then the same list without the custom registry host.

Change-Id: Ifc871de8c2678f6a6fc5d234bfb62e8273c1b0b7

docker/services/ceph-ansible/ceph-base.yaml

index e65c503..d0bc266 100644 (file)
@@ -120,14 +120,14 @@ resources:
           if:
           - custom_registry_host
           - yaql:
-              expression: let(location => $.data.rightSplit(':', 1)[0]) -> regex('(?:https?://)?(.*)/').split($location)[1]
+              expression: let(location => $.data.rightSplit(':', 1)[0]) -> regex('(?:https?://)?(.*?)/(.*)').split($location)[1]
               data: {get_param: DockerCephDaemonImage}
           - docker.io
         image:
           if:
           - custom_registry_host
           - yaql:
-              expression: let(location => $.data.rightSplit(':', 1)[0]) -> regex('(?:https?://)?(.*)/').split($location)[2]
+              expression: let(location => $.data.rightSplit(':', 1)[0]) -> regex('(?:https?://)?(.*?)/(.*)').split($location)[2]
               data: {get_param: DockerCephDaemonImage}
           - yaql:
               expression: $.data.rightSplit(':', 1)[0]