Using general naming for app openstack

To make a downstream release of stx-openstack, we often have to also
rename all the app's helm and puppet plugins namespace and also change
code on sysinv. This change decouples the name of the openstack
application from its plugins in order to ease downstream development
and release.

Tests report: https://paste.opendev.org/show/810225/

Story: 2009669
Task: 43900

Depends-On: https://review.opendev.org/c/starlingx/config/+/814670
Signed-off-by: Thiago Brito <thiago.brito@windriver.com>
Change-Id: I2bce2416c613bde374a86854c746ba4ded52a842
This commit is contained in:
Thiago Brito 2021-10-19 18:33:47 -03:00 committed by Thiago Paiva Brito
parent 2755a00457
commit 147f1cfb7f
5 changed files with 21 additions and 16 deletions

View File

@ -51,7 +51,7 @@ LOG = logging.getLogger(__name__)
class OpenstackArmadaManifestOperator(base.ArmadaManifestOperator):
APP = constants.HELM_APP_OPENSTACK
ARMADA_MANIFEST = 'armada-manifest'
ARMADA_MANIFEST = 'openstack-manifest'
CHART_GROUP_PSP_ROLEBINDING = 'openstack-psp-rolebinding'
CHART_GROUP_INGRESS_OS = 'openstack-ingress'

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2020 Wind River Systems, Inc.
# Copyright (c) 2019-2021 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@ -174,8 +174,12 @@ class NovaHelm(openstack.OpenstackBaseHelm):
def _get_compute_ironic_manifests(self):
ironic_operator = self._operator.chart_operators[
app_constants.HELM_CHART_IRONIC]
enabled = ironic_operator._is_enabled(constants.HELM_APP_OPENSTACK,
app_constants.HELM_CHART_IRONIC, common.HELM_NS_OPENSTACK)
openstack_app = utils.find_openstack_app(self.dbapi)
enabled = ironic_operator._is_enabled(
openstack_app.name,
app_constants.HELM_CHART_IRONIC,
common.HELM_NS_OPENSTACK
)
return {
'statefulset_compute_ironic': enabled
}

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2020 Wind River Systems, Inc.
# Copyright (c) 2019-2021 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@ -20,6 +20,7 @@ from sqlalchemy.orm.exc import NoResultFound
from sysinv.common import constants
from sysinv.common import exception
from sysinv.common import kubernetes
from sysinv.common import utils
from sysinv.common.storage_backend_conf import K8RbdProvisioner
from sysinv.helm import base
from sysinv.helm import common
@ -164,7 +165,7 @@ class OpenstackBaseHelm(base.BaseHelm):
return None
try:
app = self.dbapi.kube_app_get(constants.HELM_APP_OPENSTACK)
app = utils.find_openstack_app(self.dbapi)
override = self.dbapi.helm_override_get(app_id=app.id,
name=chart,
namespace=namespace)
@ -188,8 +189,8 @@ class OpenstackBaseHelm(base.BaseHelm):
# The password is not present, dump from inactive app if available,
# otherwise generate one and store it to the override
try:
inactive_apps = self.dbapi.kube_app_get_inactive(
constants.HELM_APP_OPENSTACK)
openstack_app = utils.find_openstack_app(self.dbapi)
inactive_apps = self.dbapi.kube_app_get_inactive(openstack_app.name)
app_override = self.dbapi.helm_override_get(app_id=inactive_apps[0].id,
name=chart,
namespace=namespace)
@ -376,7 +377,7 @@ class OpenstackBaseHelm(base.BaseHelm):
def _get_or_generate_ssh_keys(self, chart, namespace):
try:
app = self.dbapi.kube_app_get(constants.HELM_APP_OPENSTACK)
app = utils.find_openstack_app(self.dbapi)
override = self.dbapi.helm_override_get(app_id=app.id,
name=chart,
namespace=namespace)
@ -400,8 +401,8 @@ class OpenstackBaseHelm(base.BaseHelm):
newprivatekey = None
newpublickey = None
try:
inactive_apps = self.dbapi.kube_app_get_inactive(
constants.HELM_APP_OPENSTACK)
openstack_app = utils.find_openstack_app(self.dbapi)
inactive_apps = self.dbapi.kube_app_get_inactive(openstack_app.name)
app_override = self.dbapi.helm_override_get(app_id=inactive_apps[0].id,
name=chart,
namespace=namespace)

View File

@ -30,9 +30,9 @@ setup-hooks =
[entry_points]
systemconfig.helm_applications =
stx-openstack = systemconfig.helm_plugins.stx_openstack
openstack = systemconfig.helm_plugins.openstack
systemconfig.helm_plugins.stx_openstack =
systemconfig.helm_plugins.openstack =
001_ingress = k8sapp_openstack.helm.ingress:IngressHelm
002_mariadb = k8sapp_openstack.helm.mariadb:MariadbHelm
003_garbd = k8sapp_openstack.helm.garbd:GarbdHelm
@ -65,10 +65,10 @@ systemconfig.helm_plugins.stx_openstack =
030_pci-irq-affinity-agent = k8sapp_openstack.helm.pci_irq_affinity_agent:PciIrqAffinityAgentHelm
systemconfig.armada.manifest_ops =
stx-openstack = k8sapp_openstack.armada.manifest_openstack:OpenstackArmadaManifestOperator
openstack = k8sapp_openstack.armada.manifest_openstack:OpenstackArmadaManifestOperator
systemconfig.app_lifecycle =
stx-openstack = k8sapp_openstack.lifecycle.lifecycle_openstack:OpenstackAppLifecycleOperator
openstack = k8sapp_openstack.lifecycle.lifecycle_openstack:OpenstackAppLifecycleOperator
[wheel]
universal = 1

View File

@ -4040,7 +4040,7 @@ data:
schema: armada/Manifest/v1
metadata:
schema: metadata/Document/v1
name: armada-manifest
name: openstack-manifest
data:
release_prefix: osh
chart_groups: