Rename psp chart to portieris-psp-rolebinding

In order to allow uniqueness across helm applications, rename the
psp-rolebinding helm chart to portieris-psp-rolebinding

Also fix up issue with loading psp-rolebinding helm plugin.

Related-bug: 1889019
Story: 2007348
Task: 40430
Change-Id: Ic113732d93d93c6cd154ddc4660ba15f5424c737
Signed-off-by: Joseph Richard <joseph.richard@windriver.com>
This commit is contained in:
Joseph Richard 2020-07-28 11:14:19 -04:00
parent b4f0cccebb
commit 55afdb279e
7 changed files with 100 additions and 11 deletions

View File

@ -8,5 +8,6 @@
# These values match the names in the chart package's Chart.yaml
HELM_APP_PORTIERIS = 'portieris'
HELM_CHART_PORTIERIS = 'portieris'
HELM_CHART_PSP_ROLEBINDING = 'psp-rolebinding'
HELM_CHART_PORTIERIS_CERTS = 'portieris-certs'
HELM_CHART_PSP_ROLEBINDING = 'portieris-psp-rolebinding'
HELM_NS_PORTIERIS = 'portieris'

View File

@ -0,0 +1,41 @@
#
# Copyright (c) 2020 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from k8sapp_portieris.common import constants
from sysinv.common import exception
from sysinv.helm import base
class PortierisHelm(base.BaseHelm):
"""Class to encapsulate helm operations for the psp rolebinding chart"""
SUPPORTED_NAMESPACES = base.BaseHelm.SUPPORTED_NAMESPACES + \
[constants.HELM_NS_PORTIERIS]
SUPPORTED_APP_NAMESPACES = {
constants.HELM_APP_PORTIERIS:
base.BaseHelm.SUPPORTED_NAMESPACES + [constants.HELM_NS_PORTIERIS],
}
CHART = constants.HELM_CHART_PORTIERIS
SERVICE_NAME = 'portieris'
def get_namespaces(self):
return self.SUPPORTED_NAMESPACES
def get_overrides(self, namespace=None):
overrides = {
constants.HELM_NS_PORTIERIS: {}
}
if namespace in self.SUPPORTED_NAMESPACES:
return overrides[namespace]
elif namespace:
raise exception.InvalidHelmNamespace(chart=self.CHART,
namespace=namespace)
else:
return overrides

View File

@ -0,0 +1,41 @@
#
# Copyright (c) 2020 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from k8sapp_portieris.common import constants
from sysinv.common import exception
from sysinv.helm import base
class PortierisCertsHelm(base.BaseHelm):
"""Class to encapsulate helm operations for the psp rolebinding chart"""
SUPPORTED_NAMESPACES = base.BaseHelm.SUPPORTED_NAMESPACES + \
[constants.HELM_NS_PORTIERIS]
SUPPORTED_APP_NAMESPACES = {
constants.HELM_APP_PORTIERIS:
base.BaseHelm.SUPPORTED_NAMESPACES + [constants.HELM_NS_PORTIERIS],
}
CHART = constants.HELM_CHART_PORTIERIS_CERTS
SERVICE_NAME = 'portieris-certs'
def get_namespaces(self):
return self.SUPPORTED_NAMESPACES
def get_overrides(self, namespace=None):
overrides = {
constants.HELM_NS_PORTIERIS: {}
}
if namespace in self.SUPPORTED_NAMESPACES:
return overrides[namespace]
elif namespace:
raise exception.InvalidHelmNamespace(chart=self.CHART,
namespace=namespace)
else:
return overrides

View File

@ -4,26 +4,24 @@
# SPDX-License-Identifier: Apache-2.0
#
from k8sapp_portieris.common import constants as app_constants
from k8sapp_portieris.common import constants
from sysinv.common import constants
from sysinv.common import exception
from sysinv.helm import base
from sysinv.helm import common
class PSPRolebindingHelm(base.BaseHelm):
"""Class to encapsulate helm operations for the psp rolebinding chart"""
SUPPORTED_NAMESPACES = base.BaseHelm.SUPPORTED_NAMESPACES + \
[common.HELM_NS_PORTIERIS]
[constants.HELM_NS_PORTIERIS]
SUPPORTED_APP_NAMESPACES = {
constants.HELM_APP_PORTIERIS:
base.BaseHelm.SUPPORTED_NAMESPACES + [common.HELM_NS_PORTIERIS],
base.BaseHelm.SUPPORTED_NAMESPACES + [constants.HELM_NS_PORTIERIS],
}
CHART = app_constants.HELM_CHART_PSP_ROLEBINDING
CHART = constants.HELM_CHART_PSP_ROLEBINDING
SERVICE_NAME = 'psp-rolebinding'
def get_namespaces(self):
@ -31,7 +29,7 @@ class PSPRolebindingHelm(base.BaseHelm):
def get_overrides(self, namespace=None):
overrides = {
common.HELM_NS_portieris: {}
constants.HELM_NS_PORTIERIS: {}
}
if namespace in self.SUPPORTED_NAMESPACES:

View File

@ -32,8 +32,10 @@ setup-hooks =
systemconfig.helm_applications =
portieris = systemconfig.helm_plugins.portieris
systemconfig.helm_plugins.potrieris =
001_psp-rolebinding = k8sapp_portieris.helm.psp_rolebinding:PSPRolebindingHelm
systemconfig.helm_plugins.portieris =
001_portieris-psp-rolebinding = k8sapp_portieris.helm.psp_rolebinding:PSPRolebindingHelm
002_portieris-certs = k8sapp_portieris.helm.portieris_certs:PortierisCertsHelm
003_portieris = k8sapp_portieris.helm.portieris:PortierisHelm
[wheel]
universal = 1

View File

@ -24,6 +24,8 @@ BuildArch: noarch
BuildRequires: helm
BuildRequires: chartmuseum
BuildRequires: portieris-helm
BuildRequires: python-k8sapp-portieris
BuildRequires: python-k8sapp-portieris-wheels
%description
StarlingX Portieris Armada Helm Charts
@ -65,6 +67,10 @@ sed -i 's/@APP_NAME@/%{app_name}/g' %{app_staging}/metadata.yaml
sed -i 's/@APP_VERSION@/%{version}-%{tis_patch_ver}/g' %{app_staging}/metadata.yaml
sed -i 's/@HELM_REPO@/%{helm_repo}/g' %{app_staging}/metadata.yaml
# Copy the plugins: installed in the buildroot
mkdir -p %{app_staging}/plugins
cp /plugins/%{app_name}/*.whl %{app_staging}/plugins
# package it up
find . -type f ! -name '*.md5' -print0 | xargs -0 md5sum > checksum.md5
tar -zcf %{_builddir}/%{app_tarball} -C %{app_staging}/ .

View File

@ -67,7 +67,7 @@ metadata:
schema: metadata/Document/v1
name: portieris-psp-rolebinding
data:
chart_name: psp-rolebinding
chart_name: portieris-psp-rolebinding
release: portieris-psp-rolebinding
namespace: portieris
values: