150 lines
4.4 KiB
INI
Raw Normal View History

Add B&R lifecycle hooks to the nginx-ingress-controller The recent upversion of the nginx app (https://review.opendev.org/c/starlingx/nginx-ingress-controller-armada-app/+/782326) enabled the nginx admissionWebhook and this introduced an issue in the restore procedure. The proposed solution is to use the lifecycle operator to delete the nginx admissionWebhook before the backup. If we do this, the backup of the etcd database will not have the nginx webhook and the restore will succeed. Note that the solution implies a deletion of a resource in the nginx app. Because of this, there are some procedural changes to the backup and restore that the user must do: - After backup completes the following steps must be done: 1. $ system helm-override-update nginx-ingress-controller ingress-nginx kube-system --set controller.admissionWebhooks.enabled=true 2. reapply the nginx app to restore the admissionWebhook: $ system application-apply nginx-ingress-controller - After the whole restore procedure (i.e after all the nodes are restored and unlocked, apps are in applied state and 'system restore-complete' was executed) the user must do the same steps as above to restore the nginx webhook: 1. $ system helm-override-update nginx-ingress-controller ingress-nginx kube-system --set controller.admissionWebhooks.enabled=true 2. $ system application-apply nginx-ingress-controller Depends-On: I61156db05970aa03c96ddc8533fdd4f4a680b334 Depends-On: I0ebab45f4846cbcd25fecac6bf99195d9047eb8a Depends-On: I648e940f8104307e111213afd511f8fca19e39ab Closes-Bug: 1923185 Signed-off-by: Mihnea Saracin <Mihnea.Saracin@windriver.com> Change-Id: I9ca56329cfa353e7938a9fd8e94c50295c6a0778
2021-04-09 18:31:29 +03:00
[tox]
envlist = flake8,py36,py39,pylint,bandit
Add B&R lifecycle hooks to the nginx-ingress-controller The recent upversion of the nginx app (https://review.opendev.org/c/starlingx/nginx-ingress-controller-armada-app/+/782326) enabled the nginx admissionWebhook and this introduced an issue in the restore procedure. The proposed solution is to use the lifecycle operator to delete the nginx admissionWebhook before the backup. If we do this, the backup of the etcd database will not have the nginx webhook and the restore will succeed. Note that the solution implies a deletion of a resource in the nginx app. Because of this, there are some procedural changes to the backup and restore that the user must do: - After backup completes the following steps must be done: 1. $ system helm-override-update nginx-ingress-controller ingress-nginx kube-system --set controller.admissionWebhooks.enabled=true 2. reapply the nginx app to restore the admissionWebhook: $ system application-apply nginx-ingress-controller - After the whole restore procedure (i.e after all the nodes are restored and unlocked, apps are in applied state and 'system restore-complete' was executed) the user must do the same steps as above to restore the nginx webhook: 1. $ system helm-override-update nginx-ingress-controller ingress-nginx kube-system --set controller.admissionWebhooks.enabled=true 2. $ system application-apply nginx-ingress-controller Depends-On: I61156db05970aa03c96ddc8533fdd4f4a680b334 Depends-On: I0ebab45f4846cbcd25fecac6bf99195d9047eb8a Depends-On: I648e940f8104307e111213afd511f8fca19e39ab Closes-Bug: 1923185 Signed-off-by: Mihnea Saracin <Mihnea.Saracin@windriver.com> Change-Id: I9ca56329cfa353e7938a9fd8e94c50295c6a0778
2021-04-09 18:31:29 +03:00
minversion = 1.6
# disable source dist generation because Zuul fails on setting up
# pbr randomly in the sdist step.
skipsdist = True
Add B&R lifecycle hooks to the nginx-ingress-controller The recent upversion of the nginx app (https://review.opendev.org/c/starlingx/nginx-ingress-controller-armada-app/+/782326) enabled the nginx admissionWebhook and this introduced an issue in the restore procedure. The proposed solution is to use the lifecycle operator to delete the nginx admissionWebhook before the backup. If we do this, the backup of the etcd database will not have the nginx webhook and the restore will succeed. Note that the solution implies a deletion of a resource in the nginx app. Because of this, there are some procedural changes to the backup and restore that the user must do: - After backup completes the following steps must be done: 1. $ system helm-override-update nginx-ingress-controller ingress-nginx kube-system --set controller.admissionWebhooks.enabled=true 2. reapply the nginx app to restore the admissionWebhook: $ system application-apply nginx-ingress-controller - After the whole restore procedure (i.e after all the nodes are restored and unlocked, apps are in applied state and 'system restore-complete' was executed) the user must do the same steps as above to restore the nginx webhook: 1. $ system helm-override-update nginx-ingress-controller ingress-nginx kube-system --set controller.admissionWebhooks.enabled=true 2. $ system application-apply nginx-ingress-controller Depends-On: I61156db05970aa03c96ddc8533fdd4f4a680b334 Depends-On: I0ebab45f4846cbcd25fecac6bf99195d9047eb8a Depends-On: I648e940f8104307e111213afd511f8fca19e39ab Closes-Bug: 1923185 Signed-off-by: Mihnea Saracin <Mihnea.Saracin@windriver.com> Change-Id: I9ca56329cfa353e7938a9fd8e94c50295c6a0778
2021-04-09 18:31:29 +03:00
# tox does not work if the path to the workdir is too long, so move it to /tmp
toxworkdir = /tmp/{env:USER}_k8sapp_nginx_ingress_controllertox
stxdir = {toxinidir}/../../..
distshare={toxworkdir}/.tox/distshare
[testenv]
# usedevelop = True
# enabling usedevelop results in py27 develop-inst:
# Exception: Versioning for this project requires either an sdist tarball,
# or access to an upstream git repository.
# Note. site-packages is true and rpm-python must be yum installed on your dev machine.
sitepackages = False
Add B&R lifecycle hooks to the nginx-ingress-controller The recent upversion of the nginx app (https://review.opendev.org/c/starlingx/nginx-ingress-controller-armada-app/+/782326) enabled the nginx admissionWebhook and this introduced an issue in the restore procedure. The proposed solution is to use the lifecycle operator to delete the nginx admissionWebhook before the backup. If we do this, the backup of the etcd database will not have the nginx webhook and the restore will succeed. Note that the solution implies a deletion of a resource in the nginx app. Because of this, there are some procedural changes to the backup and restore that the user must do: - After backup completes the following steps must be done: 1. $ system helm-override-update nginx-ingress-controller ingress-nginx kube-system --set controller.admissionWebhooks.enabled=true 2. reapply the nginx app to restore the admissionWebhook: $ system application-apply nginx-ingress-controller - After the whole restore procedure (i.e after all the nodes are restored and unlocked, apps are in applied state and 'system restore-complete' was executed) the user must do the same steps as above to restore the nginx webhook: 1. $ system helm-override-update nginx-ingress-controller ingress-nginx kube-system --set controller.admissionWebhooks.enabled=true 2. $ system application-apply nginx-ingress-controller Depends-On: I61156db05970aa03c96ddc8533fdd4f4a680b334 Depends-On: I0ebab45f4846cbcd25fecac6bf99195d9047eb8a Depends-On: I648e940f8104307e111213afd511f8fca19e39ab Closes-Bug: 1923185 Signed-off-by: Mihnea Saracin <Mihnea.Saracin@windriver.com> Change-Id: I9ca56329cfa353e7938a9fd8e94c50295c6a0778
2021-04-09 18:31:29 +03:00
# tox is silly... these need to be separated by a newline....
allowlist_externals = bash
Add B&R lifecycle hooks to the nginx-ingress-controller The recent upversion of the nginx app (https://review.opendev.org/c/starlingx/nginx-ingress-controller-armada-app/+/782326) enabled the nginx admissionWebhook and this introduced an issue in the restore procedure. The proposed solution is to use the lifecycle operator to delete the nginx admissionWebhook before the backup. If we do this, the backup of the etcd database will not have the nginx webhook and the restore will succeed. Note that the solution implies a deletion of a resource in the nginx app. Because of this, there are some procedural changes to the backup and restore that the user must do: - After backup completes the following steps must be done: 1. $ system helm-override-update nginx-ingress-controller ingress-nginx kube-system --set controller.admissionWebhooks.enabled=true 2. reapply the nginx app to restore the admissionWebhook: $ system application-apply nginx-ingress-controller - After the whole restore procedure (i.e after all the nodes are restored and unlocked, apps are in applied state and 'system restore-complete' was executed) the user must do the same steps as above to restore the nginx webhook: 1. $ system helm-override-update nginx-ingress-controller ingress-nginx kube-system --set controller.admissionWebhooks.enabled=true 2. $ system application-apply nginx-ingress-controller Depends-On: I61156db05970aa03c96ddc8533fdd4f4a680b334 Depends-On: I0ebab45f4846cbcd25fecac6bf99195d9047eb8a Depends-On: I648e940f8104307e111213afd511f8fca19e39ab Closes-Bug: 1923185 Signed-off-by: Mihnea Saracin <Mihnea.Saracin@windriver.com> Change-Id: I9ca56329cfa353e7938a9fd8e94c50295c6a0778
2021-04-09 18:31:29 +03:00
find
install_command = pip install \
-v -v -v \
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \
Add B&R lifecycle hooks to the nginx-ingress-controller The recent upversion of the nginx app (https://review.opendev.org/c/starlingx/nginx-ingress-controller-armada-app/+/782326) enabled the nginx admissionWebhook and this introduced an issue in the restore procedure. The proposed solution is to use the lifecycle operator to delete the nginx admissionWebhook before the backup. If we do this, the backup of the etcd database will not have the nginx webhook and the restore will succeed. Note that the solution implies a deletion of a resource in the nginx app. Because of this, there are some procedural changes to the backup and restore that the user must do: - After backup completes the following steps must be done: 1. $ system helm-override-update nginx-ingress-controller ingress-nginx kube-system --set controller.admissionWebhooks.enabled=true 2. reapply the nginx app to restore the admissionWebhook: $ system application-apply nginx-ingress-controller - After the whole restore procedure (i.e after all the nodes are restored and unlocked, apps are in applied state and 'system restore-complete' was executed) the user must do the same steps as above to restore the nginx webhook: 1. $ system helm-override-update nginx-ingress-controller ingress-nginx kube-system --set controller.admissionWebhooks.enabled=true 2. $ system application-apply nginx-ingress-controller Depends-On: I61156db05970aa03c96ddc8533fdd4f4a680b334 Depends-On: I0ebab45f4846cbcd25fecac6bf99195d9047eb8a Depends-On: I648e940f8104307e111213afd511f8fca19e39ab Closes-Bug: 1923185 Signed-off-by: Mihnea Saracin <Mihnea.Saracin@windriver.com> Change-Id: I9ca56329cfa353e7938a9fd8e94c50295c6a0778
2021-04-09 18:31:29 +03:00
{opts} {packages}
# Note the hash seed is set to 0 until can be tested with a
# random hash seed successfully.
setenv = VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0
PYTHONDONTWRITEBYTECODE=1
OS_TEST_PATH=./k8sapp_nginx_ingress_controller/tests
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_ALL=C
SYSINV_TEST_ENV=True
TOX_WORK_DIR={toxworkdir}
PYLINTHOME={toxworkdir}
# centos patching base dir is cgcs-patch
centos_deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
-e{[tox]stxdir}/config/sysinv/sysinv/sysinv
-e{[tox]stxdir}/config/tsconfig/tsconfig
-e{[tox]stxdir}/fault/fm-api/source
-e{[tox]stxdir}/fault/python-fmclient/fmclient
-e{[tox]stxdir}/utilities/ceph/python-cephclient/python-cephclient
-e{[tox]stxdir}/update/cgcs-patch/cgcs-patch
# debian patching base dir is sw-patch
debian_deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
-e{[tox]stxdir}/config/sysinv/sysinv/sysinv
-e{[tox]stxdir}/config/tsconfig/tsconfig
-e{[tox]stxdir}/fault/fm-api/source
-e{[tox]stxdir}/fault/python-fmclient/fmclient
-e{[tox]stxdir}/utilities/ceph/python-cephclient/python-cephclient
-e{[tox]stxdir}/update/sw-patch/cgcs-patch
# default deps are still centos
deps = {[testenv]centos_deps}
Add B&R lifecycle hooks to the nginx-ingress-controller The recent upversion of the nginx app (https://review.opendev.org/c/starlingx/nginx-ingress-controller-armada-app/+/782326) enabled the nginx admissionWebhook and this introduced an issue in the restore procedure. The proposed solution is to use the lifecycle operator to delete the nginx admissionWebhook before the backup. If we do this, the backup of the etcd database will not have the nginx webhook and the restore will succeed. Note that the solution implies a deletion of a resource in the nginx app. Because of this, there are some procedural changes to the backup and restore that the user must do: - After backup completes the following steps must be done: 1. $ system helm-override-update nginx-ingress-controller ingress-nginx kube-system --set controller.admissionWebhooks.enabled=true 2. reapply the nginx app to restore the admissionWebhook: $ system application-apply nginx-ingress-controller - After the whole restore procedure (i.e after all the nodes are restored and unlocked, apps are in applied state and 'system restore-complete' was executed) the user must do the same steps as above to restore the nginx webhook: 1. $ system helm-override-update nginx-ingress-controller ingress-nginx kube-system --set controller.admissionWebhooks.enabled=true 2. $ system application-apply nginx-ingress-controller Depends-On: I61156db05970aa03c96ddc8533fdd4f4a680b334 Depends-On: I0ebab45f4846cbcd25fecac6bf99195d9047eb8a Depends-On: I648e940f8104307e111213afd511f8fca19e39ab Closes-Bug: 1923185 Signed-off-by: Mihnea Saracin <Mihnea.Saracin@windriver.com> Change-Id: I9ca56329cfa353e7938a9fd8e94c50295c6a0778
2021-04-09 18:31:29 +03:00
commands =
find . -type f -name "*.pyc" -delete
[flake8]
exclude = build,dist,tools,.eggs
max-line-length=120
[testenv:flake8]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt
flake8-bugbear
commands =
flake8 {posargs} .
[testenv:py36]
basepython = python3.6
commands =
{[testenv]commands}
stestr run {posargs}
stestr slowest
[testenv:py39]
basepython = python3.9
deps = {[testenv]debian_deps}
install_command = pip install \
-v -v -v \
-c{toxinidir}/upper-constraints.txt \
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \
{opts} {packages}
commands =
{[testenv]commands}
stestr run {posargs}
stestr slowest
Add B&R lifecycle hooks to the nginx-ingress-controller The recent upversion of the nginx app (https://review.opendev.org/c/starlingx/nginx-ingress-controller-armada-app/+/782326) enabled the nginx admissionWebhook and this introduced an issue in the restore procedure. The proposed solution is to use the lifecycle operator to delete the nginx admissionWebhook before the backup. If we do this, the backup of the etcd database will not have the nginx webhook and the restore will succeed. Note that the solution implies a deletion of a resource in the nginx app. Because of this, there are some procedural changes to the backup and restore that the user must do: - After backup completes the following steps must be done: 1. $ system helm-override-update nginx-ingress-controller ingress-nginx kube-system --set controller.admissionWebhooks.enabled=true 2. reapply the nginx app to restore the admissionWebhook: $ system application-apply nginx-ingress-controller - After the whole restore procedure (i.e after all the nodes are restored and unlocked, apps are in applied state and 'system restore-complete' was executed) the user must do the same steps as above to restore the nginx webhook: 1. $ system helm-override-update nginx-ingress-controller ingress-nginx kube-system --set controller.admissionWebhooks.enabled=true 2. $ system application-apply nginx-ingress-controller Depends-On: I61156db05970aa03c96ddc8533fdd4f4a680b334 Depends-On: I0ebab45f4846cbcd25fecac6bf99195d9047eb8a Depends-On: I648e940f8104307e111213afd511f8fca19e39ab Closes-Bug: 1923185 Signed-off-by: Mihnea Saracin <Mihnea.Saracin@windriver.com> Change-Id: I9ca56329cfa353e7938a9fd8e94c50295c6a0778
2021-04-09 18:31:29 +03:00
[testenv:pep8]
# testenv:flake8 clone
basepython = {[testenv:flake8]basepython}
deps = {[testenv:flake8]deps}
commands = {[testenv:flake8]commands}
[testenv:venv]
commands = {posargs}
[bandit]
[testenv:bandit]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt
bandit
commands = bandit --ini tox.ini -n 5 -r k8sapp_nginx_ingress_controller
[testenv:pylint]
basepython = python3
Add B&R lifecycle hooks to the nginx-ingress-controller The recent upversion of the nginx app (https://review.opendev.org/c/starlingx/nginx-ingress-controller-armada-app/+/782326) enabled the nginx admissionWebhook and this introduced an issue in the restore procedure. The proposed solution is to use the lifecycle operator to delete the nginx admissionWebhook before the backup. If we do this, the backup of the etcd database will not have the nginx webhook and the restore will succeed. Note that the solution implies a deletion of a resource in the nginx app. Because of this, there are some procedural changes to the backup and restore that the user must do: - After backup completes the following steps must be done: 1. $ system helm-override-update nginx-ingress-controller ingress-nginx kube-system --set controller.admissionWebhooks.enabled=true 2. reapply the nginx app to restore the admissionWebhook: $ system application-apply nginx-ingress-controller - After the whole restore procedure (i.e after all the nodes are restored and unlocked, apps are in applied state and 'system restore-complete' was executed) the user must do the same steps as above to restore the nginx webhook: 1. $ system helm-override-update nginx-ingress-controller ingress-nginx kube-system --set controller.admissionWebhooks.enabled=true 2. $ system application-apply nginx-ingress-controller Depends-On: I61156db05970aa03c96ddc8533fdd4f4a680b334 Depends-On: I0ebab45f4846cbcd25fecac6bf99195d9047eb8a Depends-On: I648e940f8104307e111213afd511f8fca19e39ab Closes-Bug: 1923185 Signed-off-by: Mihnea Saracin <Mihnea.Saracin@windriver.com> Change-Id: I9ca56329cfa353e7938a9fd8e94c50295c6a0778
2021-04-09 18:31:29 +03:00
sitepackages = False
deps = {[testenv]centos_deps}
Add B&R lifecycle hooks to the nginx-ingress-controller The recent upversion of the nginx app (https://review.opendev.org/c/starlingx/nginx-ingress-controller-armada-app/+/782326) enabled the nginx admissionWebhook and this introduced an issue in the restore procedure. The proposed solution is to use the lifecycle operator to delete the nginx admissionWebhook before the backup. If we do this, the backup of the etcd database will not have the nginx webhook and the restore will succeed. Note that the solution implies a deletion of a resource in the nginx app. Because of this, there are some procedural changes to the backup and restore that the user must do: - After backup completes the following steps must be done: 1. $ system helm-override-update nginx-ingress-controller ingress-nginx kube-system --set controller.admissionWebhooks.enabled=true 2. reapply the nginx app to restore the admissionWebhook: $ system application-apply nginx-ingress-controller - After the whole restore procedure (i.e after all the nodes are restored and unlocked, apps are in applied state and 'system restore-complete' was executed) the user must do the same steps as above to restore the nginx webhook: 1. $ system helm-override-update nginx-ingress-controller ingress-nginx kube-system --set controller.admissionWebhooks.enabled=true 2. $ system application-apply nginx-ingress-controller Depends-On: I61156db05970aa03c96ddc8533fdd4f4a680b334 Depends-On: I0ebab45f4846cbcd25fecac6bf99195d9047eb8a Depends-On: I648e940f8104307e111213afd511f8fca19e39ab Closes-Bug: 1923185 Signed-off-by: Mihnea Saracin <Mihnea.Saracin@windriver.com> Change-Id: I9ca56329cfa353e7938a9fd8e94c50295c6a0778
2021-04-09 18:31:29 +03:00
pylint
commands =
pylint {posargs} k8sapp_nginx_ingress_controller --rcfile=./pylint.rc
[testenv:cover]
basepython = python3
deps = {[testenv]centos_deps}
Add B&R lifecycle hooks to the nginx-ingress-controller The recent upversion of the nginx app (https://review.opendev.org/c/starlingx/nginx-ingress-controller-armada-app/+/782326) enabled the nginx admissionWebhook and this introduced an issue in the restore procedure. The proposed solution is to use the lifecycle operator to delete the nginx admissionWebhook before the backup. If we do this, the backup of the etcd database will not have the nginx webhook and the restore will succeed. Note that the solution implies a deletion of a resource in the nginx app. Because of this, there are some procedural changes to the backup and restore that the user must do: - After backup completes the following steps must be done: 1. $ system helm-override-update nginx-ingress-controller ingress-nginx kube-system --set controller.admissionWebhooks.enabled=true 2. reapply the nginx app to restore the admissionWebhook: $ system application-apply nginx-ingress-controller - After the whole restore procedure (i.e after all the nodes are restored and unlocked, apps are in applied state and 'system restore-complete' was executed) the user must do the same steps as above to restore the nginx webhook: 1. $ system helm-override-update nginx-ingress-controller ingress-nginx kube-system --set controller.admissionWebhooks.enabled=true 2. $ system application-apply nginx-ingress-controller Depends-On: I61156db05970aa03c96ddc8533fdd4f4a680b334 Depends-On: I0ebab45f4846cbcd25fecac6bf99195d9047eb8a Depends-On: I648e940f8104307e111213afd511f8fca19e39ab Closes-Bug: 1923185 Signed-off-by: Mihnea Saracin <Mihnea.Saracin@windriver.com> Change-Id: I9ca56329cfa353e7938a9fd8e94c50295c6a0778
2021-04-09 18:31:29 +03:00
setenv = {[testenv]setenv}
PYTHON=coverage run --parallel-mode
commands =
{[testenv]commands}
coverage erase
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:pip-missing-reqs]
# do not install test-requirements as that will pollute the virtualenv for
# determining missing packages
# this also means that pip-missing-reqs must be installed separately, outside
# of the requirements.txt files
deps = pip_missing_reqs
-rrequirements.txt
commands=pip-missing-reqs -d --ignore-file=/k8sapp_nginx_ingress_controller/tests k8sapp_nginx_ingress_controller