You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The OpenStack manager tools are started through run_command() with an empty
environment dict and ignore_env=True, see osism/tasks/openstack.py
(image_manager, flavor_manager, run_openstack_command_with_cloud, …):
ignore_env=True together with env={} means the subprocess is started with a
completely empty environment. Nothing that is configured for the openstack
worker container reaches the tool.
Why this matters
HTTP_PROXY / HTTPS_PROXY / NO_PROXY never arrive. On deployments where
the manager has no direct outbound connectivity, openstack-image-manager
cannot reach the image sources at all. This is the blocker reported in Support proxy for manager service issues#1432. The manager role of osism.services can now set the
proxy for all services of the manager, but the value stops at this boundary.
The same applies to the aria2c subprocess that openstack-image-manager
uses to prefetch images (openstack_image_manager/main.py, _download()).
It inherits the empty environment, and aria2 only reads the lowercase http_proxy / https_proxy / no_proxy names.
REQUESTS_CA_BUNDLE, CURL_CA_BUNDLE and SSL_CERT_FILE are lost as well,
which matters for a proxy that terminates TLS, and so are PATH, HOME, LANG and TZ (without PATH, shutil.which("aria2c") falls back to os.defpath).
Suggested fix
The blanking was introduced in #1687, which carries no description. The
apparent purpose is to keep the OS_* variables from openstack.env out of
the tools so that they do not override the --cloud selection from clouds.yaml. Dropping the entire environment is a wider hammer than needed.
Pass through an explicit allowlist instead of starting from {}:
HTTP_PROXY, HTTPS_PROXY, NO_PROXY, ALL_PROXY and their lowercase
spellings
An alternative is to keep os.environ and remove the OS_* variables. That
fixes the reported symptom too, but lets everything else back in, so the
allowlist is the safer of the two.
Acceptance criteria
openstack-image-manager and the other tools invoked with ignore_env=True
run with the proxy and CA variables of their container.
OS_* variables from openstack.env still do not reach these tools.
Follow-up to osism/issues#1432 (Support proxy for manager service).
What happens
The OpenStack manager tools are started through
run_command()with an emptyenvironment dict and
ignore_env=True, seeosism/tasks/openstack.py(
image_manager,flavor_manager,run_openstack_command_with_cloud, …):and
osism/tasks/__init__.py:ignore_env=Truetogether withenv={}means the subprocess is started with acompletely empty environment. Nothing that is configured for the
openstackworker container reaches the tool.
Why this matters
HTTP_PROXY/HTTPS_PROXY/NO_PROXYnever arrive. On deployments wherethe manager has no direct outbound connectivity,
openstack-image-managercannot reach the image sources at all. This is the blocker reported in
Support proxy for manager service issues#1432. The
managerrole ofosism.servicescan now set theproxy for all services of the manager, but the value stops at this boundary.
aria2csubprocess thatopenstack-image-manageruses to prefetch images (
openstack_image_manager/main.py,_download()).It inherits the empty environment, and aria2 only reads the lowercase
http_proxy/https_proxy/no_proxynames.REQUESTS_CA_BUNDLE,CURL_CA_BUNDLEandSSL_CERT_FILEare lost as well,which matters for a proxy that terminates TLS, and so are
PATH,HOME,LANGandTZ(withoutPATH,shutil.which("aria2c")falls back toos.defpath).Suggested fix
The blanking was introduced in #1687, which carries no description. The
apparent purpose is to keep the
OS_*variables fromopenstack.envout ofthe tools so that they do not override the
--cloudselection fromclouds.yaml. Dropping the entire environment is a wider hammer than needed.Pass through an explicit allowlist instead of starting from
{}:PATH,HOME,LANG,LC_*,TZSSL_CERT_FILE,SSL_CERT_DIR,REQUESTS_CA_BUNDLE,CURL_CA_BUNDLEHTTP_PROXY,HTTPS_PROXY,NO_PROXY,ALL_PROXYand their lowercasespellings
An alternative is to keep
os.environand remove theOS_*variables. Thatfixes the reported symptom too, but lets everything else back in, so the
allowlist is the safer of the two.
Acceptance criteria
openstack-image-managerand the other tools invoked withignore_env=Truerun with the proxy and CA variables of their container.
OS_*variables fromopenstack.envstill do not reach these tools.