From 0cd0912668675128dd1d838783c8e452465f7a3b Mon Sep 17 00:00:00 2001 From: Felipe Reyes Date: Thu, 19 Jan 2023 11:17:12 -0300 Subject: [PATCH] Add config option swift-temp-url-duration This config option allows operators to increase the duration of temporary URLs handed to ironic-python-agent to download images when using the 'direct' deployment interface[0]. The rendered file (ironic.conf) will only include [glance].swift_temp_url_duration when it's overriden by the operator, otherwise the upstream's default is used by omitting the key defition. [0] https://docs.openstack.org/ironic/latest/admin/interfaces/deploy.html#direct-deploy Closes-Bug: #1997581 Change-Id: I6a4a582b199e5137a9e5fd185882acec20424f3a --- src/config.yaml | 8 ++++++++ src/templates/train/ironic.conf | 3 +++ src/tests/bundles/jammy-yoga.yaml | 2 -- src/tests/bundles/jammy-zed.yaml | 2 -- src/tests/bundles/kinetic-zed.yaml | 2 -- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/config.yaml b/src/config.yaml index a9e85ed..05ca7fa 100644 --- a/src/config.yaml +++ b/src/config.yaml @@ -212,3 +212,11 @@ options: type: int description: | Number of days before a log object expires in swift. + swift-temp-url-duration: + default: + type: int + description: | + The length of time (in seconds) that the temporary URL will be valid + for. Defaults to 20 minutes. If some deploys get a 401 response code + when trying to download from the temporary URL, try raising this + duration. diff --git a/src/templates/train/ironic.conf b/src/templates/train/ironic.conf index 8cd48bf..5e2ff43 100644 --- a/src/templates/train/ironic.conf +++ b/src/templates/train/ironic.conf @@ -49,6 +49,9 @@ swift_container = glance {% if options.temp_url_secret -%} swift_temp_url_key = {{ options.temp_url_secret }} {% endif %} +{%- if options.swift_temp_url_duration and options.swift_temp_url_duration > 0 %} +swift_temp_url_duration = {{ options.swift_temp_url_duration }} +{%- endif %} [swift] {% include "parts/service-auth" %} diff --git a/src/tests/bundles/jammy-yoga.yaml b/src/tests/bundles/jammy-yoga.yaml index a87530d..84825ba 100644 --- a/src/tests/bundles/jammy-yoga.yaml +++ b/src/tests/bundles/jammy-yoga.yaml @@ -162,8 +162,6 @@ services: charm: ch:mysql-innodb-cluster num_units: 3 constraints: mem=4G - options: - source: *source channel: latest/edge cinder: charm: ch:cinder diff --git a/src/tests/bundles/jammy-zed.yaml b/src/tests/bundles/jammy-zed.yaml index d063b5c..40f0707 100644 --- a/src/tests/bundles/jammy-zed.yaml +++ b/src/tests/bundles/jammy-zed.yaml @@ -162,8 +162,6 @@ services: charm: ch:mysql-innodb-cluster num_units: 3 constraints: mem=4G - options: - source: *source channel: latest/edge cinder: charm: ch:cinder diff --git a/src/tests/bundles/kinetic-zed.yaml b/src/tests/bundles/kinetic-zed.yaml index 1c42847..27adb7a 100644 --- a/src/tests/bundles/kinetic-zed.yaml +++ b/src/tests/bundles/kinetic-zed.yaml @@ -162,8 +162,6 @@ services: charm: ch:mysql-innodb-cluster num_units: 3 constraints: mem=4G - options: - source: *source channel: latest/edge cinder: charm: ch:cinder