Skip to content

Commit

Permalink
update the eventrouter image to match logging 5.0 (openshift#1852)
Browse files Browse the repository at this point in the history
  • Loading branch information
QiaolingTang authored Feb 20, 2021
1 parent 1b841d1 commit 02d5d8f
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions features/step_definitions/logging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -391,15 +391,32 @@
step %Q/admin ensures "eventrouter" service_account is deleted from the "openshift-logging" project after scenario/
step %Q/admin ensures "eventrouter" config_map is deleted from the "openshift-logging" project after scenario/
step %Q/admin ensures "eventrouter" deployment is deleted from the "openshift-logging" project after scenario/
image_version = cluster_version('version').channel.split('-')[1]
clo_csv_version = subscription("cluster-logging").current_csv(cached: false)
if clo_csv_version.include? "cluster-logging"
image_version = clo_csv_version.match(/cluster-logging\.(.*)/)[1].split('-')[0]
else
image_version = clo_csv_version.match(/clusterlogging\.(.*)/)[1].split('-')[0]
end
if image_version.start_with?("5")
# from logging 5.0, the image name is changed to eventrouter-rhel8
image_name = "eventrouter-rhel8"
else
image_name = "logging-eventrouter"
end

if image_content_source_policy('brew-registry').exists?
registry = image_content_source_policy('brew-registry').mirror_repository[0]
image = "#{registry}/rh-osbs/openshift-ose-logging-eventrouter:v#{image_version}"
if image_version.start_with?("5")
# from logging 5.0, the image namespace is changed to openshift-logging
image = "#{registry}/rh-osbs/openshift-logging-#{image_name}:v#{image_version}"
else
image = "#{registry}/rh-osbs/openshift-ose-#{image_name}:v#{image_version}"
end
else
# get image registry from CLO
image_registry = deployment('cluster-logging-operator').container_spec(name: 'cluster-logging-operator').image
registry = image_registry.split('@')[0].gsub("cluster-logging-operator", "logging-eventrouter")
image = "#{registry}:v#{image_version}"
clo_image = deployment('cluster-logging-operator').container_spec(name: 'cluster-logging-operator').image
registry = clo_image.split(/cluster-logging(.*)/)[0]
image = "#{registry}#{image_name}:v#{image_version}"
end
step %Q/I process and create:/, table(%{
| f | #{BushSlicer::HOME}/testdata/logging/eventrouter/internal_eventrouter.yaml |
Expand Down

0 comments on commit 02d5d8f

Please sign in to comment.