Be more inclusive in insecure registry regex
authorMartin André <m.andre@redhat.com>
Tue, 6 Sep 2016 12:58:00 +0000 (14:58 +0200)
committerMartin André <m.andre@redhat.com>
Thu, 6 Oct 2016 09:14:20 +0000 (11:14 +0200)
The regex failed to match the INSECURE_REGISTRY string used in latest
atomic host image due to it expecting a whitespace after
--insecure-registry.

Change-Id: Ib8f288d844b4d94b0f6309bfd04bb05930d8c4c5

docker/firstboot/start_docker_agents.sh

index 65c4e6d..6862503 100644 (file)
@@ -23,7 +23,7 @@ if [ $docker_namespace_is_registry ]; then
     # if namespace is used with local registry, trim all namespacing
     trim_var=$docker_registry
     registry_host="${trim_var%%/*}"
-    /bin/sed -i "s/# INSECURE_REGISTRY='--insecure-registry[ ]'/INSECURE_REGISTRY='--insecure-registry $registry_host'/g" /etc/sysconfig/docker
+    /bin/sed -i -r "s/^[# ]*INSECURE_REGISTRY *=.+$/INSECURE_REGISTRY='--insecure-registry $registry_host'/" /etc/sysconfig/docker
     /usr/bin/systemctl start --no-block docker.service
 fi