summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2021-02-08 13:48:06 +0100
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2021-02-09 08:33:42 +0000
commit3e8ac4b4ca407f5185dfa4becc22f56dc750afe7 (patch)
tree880b06f9d0cc66f277712dc8b30eb8445fdc7d99
parent77324013ff407183b0d9729bd335d8bf3cc72b79 (diff)
Customize helm "--timeout" option format if running helm v3
Helm v3 requires unit definition for 'timeout' option which is not supported by Helm v2. Change-Id: Ia5839e5c412be1700459c70d43d2e6cc0400633d Issue-ID: OOM-2665 Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
-rw-r--r--ansible/roles/application/defaults/main.yml2
-rw-r--r--ansible/roles/application/molecule/default/tests/test_default.py2
-rwxr-xr-xansible/test/bin/install-molecule.sh3
3 files changed, 4 insertions, 3 deletions
diff --git a/ansible/roles/application/defaults/main.yml b/ansible/roles/application/defaults/main.yml
index 6a7472a6..8e630f73 100644
--- a/ansible/roles/application/defaults/main.yml
+++ b/ansible/roles/application/defaults/main.yml
@@ -2,7 +2,7 @@
helm_repository_name: local
helm_repository_url: http://127.0.0.1:8879
helm_extra_install_options:
- - { opt: '--timeout 1800'}
+ - { opt: "{% if helm_version | regex_search('^v3' ) %}{{ '--timeout 1800s' }}{% else %}{{ '--timeout 1800' }}{% endif %}"}
# Override file generation for Helm application can be customized by any role
# given by user and found by ansible from roles_path.
# By default override file is generated by 'application-override' role that
diff --git a/ansible/roles/application/molecule/default/tests/test_default.py b/ansible/roles/application/molecule/default/tests/test_default.py
index be9b4cdf..f57f5afc 100644
--- a/ansible/roles/application/molecule/default/tests/test_default.py
+++ b/ansible/roles/application/molecule/default/tests/test_default.py
@@ -29,7 +29,7 @@ repo add local http://127.0.0.1:8879
deploy moleculetestapp local/moleculetestapp --namespace \
moleculetestapp -f /opt/moleculetestapp/helm_charts/onap/resources/\
overrides/onap-all.yaml -f /opt/moleculetestapp/override.yaml \
---timeout 1800"""
+--timeout 1800s"""
expected_plugin_path = '/root/.local/share/helm/plugins/deploy/' +\
'deploy.sh'
assert fc == expected_content
diff --git a/ansible/test/bin/install-molecule.sh b/ansible/test/bin/install-molecule.sh
index ab6de436..4df06684 100755
--- a/ansible/test/bin/install-molecule.sh
+++ b/ansible/test/bin/install-molecule.sh
@@ -41,5 +41,6 @@ source ${VENV_PATH}/bin/activate
# Install Molecule
if [ ! -z ${VIRTUAL_ENV} ]; then
echo "Activated virtual env in ${VIRTUAL_ENV}"
- pip -q install molecule==2.20 ansible==2.7.8 ansible-lint==4.2.0 docker pyopenssl
+ pip -q install -U pip
+ pip -q install pyopenssl molecule==2.20 ansible==2.7.8 ansible-lint==4.2.0 docker
fi