Comment 27 for bug 1843486

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-glance-simplestreams-sync (stable/21.04)

Reviewed: https://review.opendev.org/c/openstack/charm-glance-simplestreams-sync/+/802052
Committed: https://opendev.org/openstack/charm-glance-simplestreams-sync/commit/a18cca2ec0d843072c4cc732d6393110ac0124af
Submitter: "Zuul (22348)"
Branch: stable/21.04

commit a18cca2ec0d843072c4cc732d6393110ac0124af
Author: Dmitrii Shcherbakov <email address hidden>
Date: Thu Jul 15 20:49:16 2021 +0300

    Dynamically generate proxy settings for image syncs

    sstream-mirror-glance has several endpoints it needs to talk to:

    * Image mirrors - typically, public Internet endpoints;
    * Keystone - typically, a directly reachable endpoint;
    * Glance - typically, a directly reachable endpoint;
    * Object store (Swift) - typically, a directly reachable endpoint but
      sometimes it may be deployed externally and added to the region
      catalog in Keystone (in which case it might be accessible via a proxy
      only).

    While sstream-mirror-glance does not support specifying proxy settings
    for individual directions, since we know all of them based on the
    Keystone catalog, a list of endpoints to add to NO_PROXY environment
    variable can be generated dynamically.

    The complication is that image syncs are periodically done via a cron
    job so a juju-run invocation is needed to retrieve relevant proxy
    settings from model-config at each invocation of the synchronization
    script.

    Additionally, the charm is long-lived so there may be some environments
    that rely on legacy proxy settings. This change accounts for that and
    acts both on juju-prefixed (new) and unprefixed (legacy) proxy settings.

    Whether to use proxy settings for connections to the object store API
    is controlled by a charm option which the script is made to react to.
    Proxy settings are ignored for object store connections by default.

    Closes-Bug: #1843486
    Change-Id: Ib1fc5d2eebf43d5f98bb8ee405a3799802c8b8dc
    (cherry picked from commit 009c8a7b929c9b961c9cf388c122cffe6f6ae41c)