Comment 7 for bug 2029303

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to config (master)

Reviewed: https://review.opendev.org/c/starlingx/config/+/915377
Committed: https://opendev.org/starlingx/config/commit/967eedadb73b93a4098975663b3b221d83b4d5ce
Submitter: "Zuul (22348)"
Branch: master

commit 967eedadb73b93a4098975663b3b221d83b4d5ce
Author: Joshua Reed <email address hidden>
Date: Tue Apr 9 14:11:59 2024 -0600

    Apply Helm Overrides to initially disabled charts.

    The previous implementation of the _get_list_of_charts
    method would not take into account whether or not a
    particular application chart was enabled or disabled.

    This change now only includes charts that are enabled, or
    if the function caller asks for all of them with the
    include_disabled override set. The override is set as a
    part of the perform_app_upload routine to ensure overrides
    are generated and applied to all charts, including those
    which are initially disabled.

    This change also seeks to handle issues where the
    kustomize-orig.yaml file is not created by the time the
    perform_app_upload routine runs _get_list_of_charts by
    including an extra check.

    Finally, the override generation in the perform_app_apply
    function is moved to happen first in the sequence of events
    such that the app object is populated with overrides prior
    to any other operations occuring. This must be done to
    ensure the correct chart list is used.

    This fix ensures that:

    1. When all charts are needed then an option can be specified
       (i.e. when determining all the container images needed for
       the application) This is done with include_disabled flag.
    2. All possible charts, as filtered by the metadata/user
       driven and DB stored enabled status, are consistently
       returned regardless of the current state of the top-level
       application kustomization.yaml.
    3. A final check for kustomization-orig.yaml is performed and
       the file is created, if missing, before
       _get_list_of_charts executes with include_disabled=True

    Test Plan:
    PASS: build-pkgs -a && build-image
    PASS: AIO-SX full install with clean bootstrap
    PASS: Enable the cms-replication chart on the dell-storage app
    PASS: Use system helm-override-update to pass
          --set config.clusterID=ClusterA
    PASS: system application-apply dell-storage
    PASS: Check the YAML structure of the
          configmap/dell-replication-controller-config
          for ClusterA and properly formatted.
    PASS: Additional check to ensure that stx-openstack application
          successfully uploads and applies.
    PASS: Check that a helm override are generated even for an
          application that doesn't have a kustomize operator. This
          was done for the metrics-server app. A helm override was
          created and the subsequent metrics-server.yaml file in
          /opt/platform/helm contained the override after the
          system applciation-apply command was run.

    Relates to previous attempt at a fix:
    https://review.opendev.org/c/starlingx/config/+/890570

    Closes-Bug: 2029303

    Change-Id: I4c501b982e4061e5067ca0e8e43f37a9eecfcb68
    Signed-off-by: Joshua Reed <email address hidden>