From 63b46caf7dd170b752cd233daae824acd2e79fd5 Mon Sep 17 00:00:00 2001 From: Daniel Trieu Date: Mon, 20 Feb 2017 18:39:19 +0200 Subject: [PATCH] Make registry & repo configurable for 'image-inspector' Tag (:2.1) deliberately left non-configurable as we depend on a specific version's interface. (Minor 2.1.z versions will be activated simply by re-pointing the 2.1 tag.) https://bugzilla.redhat.com/show_bug.cgi?id=1378007 --- .../providers/kubernetes/container_manager/scanning/job.rb | 7 ++++--- config/settings.yml | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/models/manageiq/providers/kubernetes/container_manager/scanning/job.rb b/app/models/manageiq/providers/kubernetes/container_manager/scanning/job.rb index 491b5b905a5..f1ce5c612aa 100644 --- a/app/models/manageiq/providers/kubernetes/container_manager/scanning/job.rb +++ b/app/models/manageiq/providers/kubernetes/container_manager/scanning/job.rb @@ -3,7 +3,7 @@ class ManageIQ::Providers::Kubernetes::ContainerManager::Scanning::Job < Job PROVIDER_CLASS = ManageIQ::Providers::Kubernetes::ContainerManager - INSPECTOR_NAMESPACE_FALLBACK = 'management-infra' + INSPECTOR_IMAGE_TAG = '2.1'.freeze INSPECTOR_PORT = 8080 DOCKER_SOCKET = '/var/run/docker.sock' SCAN_CATEGORIES = %w(system software) @@ -48,7 +48,6 @@ def start return queue_signal(:abort_job, "cannot analyze non docker images", "error") unless image.docker_id namespace = ::Settings.ems.ems_kubernetes.miq_namespace - namespace = INSPECTOR_NAMESPACE_FALLBACK if namespace.blank? update!(:options => options.merge( :docker_image_id => image.docker_id, @@ -419,7 +418,9 @@ def add_secret_to_pod_def(pod_def, inspector_admin_secret_name) end def inspector_image - 'docker.io/openshift/image-inspector:2.1' + registry = ::Settings.ems.ems_kubernetes.image_inspector_registry + repo = ::Settings.ems.ems_kubernetes.image_inspector_repository + "#{registry}/#{repo}:#{INSPECTOR_IMAGE_TAG}" end def inspector_proxy_env_variables diff --git a/config/settings.yml b/config/settings.yml index 96b8e06ef98..96cc11a4098 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -102,6 +102,8 @@ :read_timeout: 1.hour :ems_kubernetes: :miq_namespace: management-infra + :image_inspector_registry: docker.io + :image_inspector_repository: openshift/image-inspector :ems_azure: :disabled_regions: [] :additional_regions: {}