Browse Source

Replace ${version} with openshift_image_tag

Otherwise some code will check the wrong value.
Clayton Coleman 7 years ago
parent
commit
c826c4337f

+ 1 - 1
roles/openshift_control_plane/defaults/main.yml

@@ -17,7 +17,7 @@ l_openshift_master_images_dict:
   origin: 'openshift/origin-${component}:${version}'
   openshift-enterprise: 'openshift3/ose-${component}:${version}'
 l_osm_registry_url_default: "{{ l_openshift_master_images_dict[openshift_deployment_type] }}"
-l_osm_registry_url: "{{ oreg_url_master | default(oreg_url) | default(l_osm_registry_url_default) }}"
+l_osm_registry_url: "{{ oreg_url_master | default(oreg_url) | default(l_osm_registry_url_default) | regex_replace('${version}' | regex_escape, openshift_image_tag | default('${version}')) }}"
 
 system_images_registry_dict:
   openshift-enterprise: "registry.access.redhat.com"

+ 2 - 2
roles/openshift_hosted/defaults/main.yml

@@ -47,7 +47,7 @@ openshift_hosted_router_edits:
   value: 21600
   action: put
 
-openshift_hosted_router_registryurl: "{{ oreg_url_master | default(oreg_url) | default(openshift_hosted_images_dict[openshift_deployment_type]) }}"
+openshift_hosted_router_registryurl: "{{ oreg_url_master | default(oreg_url) | default(openshift_hosted_images_dict[openshift_deployment_type]) | regex_replace('${version}' | regex_escape, openshift_image_tag | default('${version}')) }}"
 openshift_hosted_routers:
 - name: router
   replicas: "{{ replicas | default(1) }}"
@@ -73,7 +73,7 @@ r_openshift_hosted_router_os_firewall_allow: []
 ############
 
 openshift_hosted_registry_selector: "{{ openshift_registry_selector | default(openshift_hosted_infra_selector) }}"
-openshift_hosted_registry_registryurl: "{{ oreg_url_master | default(oreg_url) | default(openshift_hosted_images_dict[openshift_deployment_type]) }}"
+openshift_hosted_registry_registryurl: "{{ oreg_url_master | default(oreg_url) | default(openshift_hosted_images_dict[openshift_deployment_type]) | regex_replace('${version}' | regex_escape, openshift_image_tag | default('${version}')) }}"
 openshift_hosted_registry_routecertificates: {}
 openshift_hosted_registry_routetermination: "passthrough"
 

+ 1 - 1
roles/openshift_hosted_templates/defaults/main.yml

@@ -8,7 +8,7 @@ openshift_hosted_images_dict:
   origin: 'openshift/origin-${component}:${version}'
   openshift-enterprise: 'openshift3/ose-${component}:${version}'
 
-openshift_hosted_templates_registryurl: "{{ oreg_url_master | default(oreg_url) | default(openshift_hosted_images_dict[openshift_deployment_type]) }}"
+openshift_hosted_templates_registryurl: "{{ oreg_url_master | default(oreg_url) | default(openshift_hosted_images_dict[openshift_deployment_type]) | regex_replace('${version}' | regex_escape, openshift_image_tag | default('${version}')) }}"
 registry_host: "{{ openshift_hosted_templates_registryurl.split('/')[0] if '.' in openshift_hosted_templates_registryurl.split('/')[0] else '' }}"
 
 openshift_hosted_templates_import_command: 'create'

+ 1 - 1
roles/openshift_node/defaults/main.yml

@@ -14,7 +14,7 @@ openshift_oreg_url_default_dict:
   origin: "openshift/origin-${component}:${version}"
   openshift-enterprise: "openshift3/ose-${component}:${version}"
 openshift_oreg_url_default: "{{ openshift_oreg_url_default_dict[openshift_deployment_type] }}"
-oreg_url_node: "{{ oreg_url | default(openshift_oreg_url_default) }}"
+oreg_url_node: "{{ oreg_url | default(openshift_oreg_url_default) | regex_replace('${version}' | regex_escape, openshift_image_tag | default('${version}')) }}"
 
 openshift_dns_ip: "{{ ansible_default_ipv4['address'] }}"
 

+ 1 - 1
roles/openshift_node_group/defaults/main.yml

@@ -21,7 +21,7 @@ openshift_oreg_url_default_dict:
   origin: "openshift/origin-${component}:${version}"
   openshift-enterprise: openshift3/ose-${component}:${version}
 openshift_oreg_url_default: "{{ openshift_oreg_url_default_dict[openshift_deployment_type] }}"
-oreg_url_node: "{{ oreg_url | default(openshift_oreg_url_default) }}"
+oreg_url_node: "{{ oreg_url | default(openshift_oreg_url_default) | regex_replace('${version}' | regex_escape, openshift_image_tag | default('${version}')) }}"
 
 openshift_imageconfig_format: "{{ oreg_url_node }}"
 openshift_node_group_cloud_provider: "{{ openshift_cloudprovider_kind | default('aws') }}"

+ 2 - 1
roles/openshift_sdn/defaults/main.yml

@@ -2,4 +2,5 @@
 openshift_node_image_dict:
   origin: 'openshift/node'
   openshift-enterprise: 'openshift3/node'
-osn_image: "{{ openshift_node_image_dict[openshift_deployment_type | default('origin')] }}"
+oreg_host: "{{ oreg_url.split('/')[0] if (oreg_url is defined and '.' in oreg_url.split('/')[0]) else '' }}"
+osn_image: "{{ oreg_host }}{{ openshift_node_image_dict[openshift_deployment_type | default('origin')] }}:{{ openshift_image_tag | default('latest') }}"

+ 1 - 2
roles/openshift_sdn/tasks/main.yml

@@ -30,8 +30,7 @@
     src: "{{ mktemp.stdout }}/sdn-images.yaml"
     key: 'tag.from.name'
     # TODO: this should be easier to replace
-    value: "{{ osn_image }}:{{ openshift_image_tag }}"
-  when: oreg_url is defined
+    value: "{{ osn_image }}"
 
 - name: Ensure the SDN can run privileged
   oc_adm_policy_user: