From 436ed9eabfbef53f5b4ff997f4b0b5163eb29f12 Mon Sep 17 00:00:00 2001 From: Dan Callaghan Date: Thu, 28 Jun 2018 14:41:17 +1000 Subject: [PATCH] waiverdb: trigger import-image instead of start-build Nowadays we have an imagestream, which pulls pre-built waiverdb images from quay.io, and a buildconfig, which then layers some Fedora-infra-specific stuff on top. When we have a new version to deploy, the imagestream should pick up the new image from quay.io, which triggers a build of the buildconfig, which triggers a deploy of the deploymentconfig. So we shouldn't need to explicitly fire off start-build anymore. We *shouldn't* need to explicitly fire off import-image either, because it is set to "scheduled" pull policy. But I am not sure what the schedule is. Right now it says it last polled 5 days ago... that may itself be a bug. Regardless, this gives us a nice way to make it pull the latest image. This patch adds a new, very simple role "import-image" to fire off the oc import-image command, following the precedent of the existing "start-build" role. --- playbooks/openshift-apps/waiverdb.yml | 7 +++---- roles/openshift/import-image/tasks/main.yml | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 roles/openshift/import-image/tasks/main.yml diff --git a/playbooks/openshift-apps/waiverdb.yml b/playbooks/openshift-apps/waiverdb.yml index 89298697e9..89f2977f02 100644 --- a/playbooks/openshift-apps/waiverdb.yml +++ b/playbooks/openshift-apps/waiverdb.yml @@ -56,14 +56,13 @@ app: waiverdb template: imagestream.yml objectname: imagestream.yml + - role: openshift/import-image + app: waiverdb + imagestreamname: waiverdb-upstream - role: openshift/object app: waiverdb template: buildconfig.yml objectname: buildconfig.yml - - role: openshift/start-build - app: waiverdb - buildname: waiverdb-docker-build - objectname: waiverdb-docker-build - role: openshift/object app: waiverdb template: configmap.yml diff --git a/roles/openshift/import-image/tasks/main.yml b/roles/openshift/import-image/tasks/main.yml new file mode 100644 index 0000000000..fa4e8b16f0 --- /dev/null +++ b/roles/openshift/import-image/tasks/main.yml @@ -0,0 +1,2 @@ +- name: Run `oc import-image` + shell: oc -n {{app}} import-image {{imagestreamname}}