Helm chart image overrides cleanup
This commit includes: - Cleanup the duplicated functions for image overrides generation - Add missing image overrides in some charts to avoid pulling useless/uncessary images Verified on AIO-SX/AIO-DX/2+2+2: - config_controller --kubernetes - system application-upload/apply/remove/delete Story: 2004520 Task: 28730 Change-Id: Ibc4d3b5d3087547678c2786e44764e02f752c186 Signed-off-by: Angie Wang <angie.wang@windriver.com>
This commit is contained in:
parent
6d47838a24
commit
fff66fdec3
@ -24,10 +24,6 @@ class AodhHelm(openstack.OpenstackBaseHelm):
|
||||
SERVICE_NAME = 'aodh'
|
||||
AUTH_USERS = ['aodh']
|
||||
|
||||
@property
|
||||
def docker_repo_source(self):
|
||||
return common.DOCKER_SRC_LOC
|
||||
|
||||
def get_namespaces(self):
|
||||
return self.SUPPORTED_NAMESPACES
|
||||
|
||||
|
@ -41,7 +41,7 @@ class BaseHelm(object):
|
||||
|
||||
@property
|
||||
def docker_repo_source(self):
|
||||
return self._operator.docker_repo_source
|
||||
return common.DOCKER_SRC_LOC
|
||||
|
||||
@property
|
||||
def docker_repo_tag(self):
|
||||
|
@ -25,10 +25,6 @@ class CeilometerHelm(openstack.OpenstackBaseHelm):
|
||||
SERVICE_NAME = 'ceilometer'
|
||||
AUTH_USERS = ['ceilometer']
|
||||
|
||||
@property
|
||||
def docker_repo_source(self):
|
||||
return common.DOCKER_SRC_LOC
|
||||
|
||||
def get_namespaces(self):
|
||||
return self.SUPPORTED_NAMESPACES
|
||||
|
||||
@ -60,13 +56,15 @@ class CeilometerHelm(openstack.OpenstackBaseHelm):
|
||||
'ks_user': heat_image,
|
||||
'ks_endpoints': heat_image,
|
||||
'db_init': self.docker_image,
|
||||
'db_init_mongodb': self.docker_image,
|
||||
'ceilometer_db_sync': self.docker_image,
|
||||
'ceilometer_central': self.docker_image,
|
||||
'ceilometer_compute': self.docker_image,
|
||||
'ceilometer_ipmi': self.docker_image,
|
||||
'ceilometer_notification': self.docker_image,
|
||||
'ceilometer_collector': self.docker_image,
|
||||
'ceilometer_api': self.docker_image
|
||||
'ceilometer_api': self.docker_image,
|
||||
'test': self.docker_image
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,14 +27,6 @@ class CinderHelm(openstack.OpenstackBaseHelm):
|
||||
SERVICE_TYPE = 'volume'
|
||||
AUTH_USERS = ['cinder']
|
||||
|
||||
@property
|
||||
def docker_repo_source(self):
|
||||
return common.DOCKER_SRC_LOC
|
||||
|
||||
@property
|
||||
def docker_repo_tag(self):
|
||||
return common.DOCKER_SRCS[self.docker_repo_source][common.IMG_TAG_KEY]
|
||||
|
||||
def get_namespaces(self):
|
||||
return self.SUPPORTED_NAMESPACES
|
||||
|
||||
|
@ -29,14 +29,6 @@ class GlanceHelm(openstack.OpenstackBaseHelm):
|
||||
SERVICE_TYPE = 'image'
|
||||
AUTH_USERS = ['glance']
|
||||
|
||||
@property
|
||||
def docker_repo_source(self):
|
||||
return common.DOCKER_SRC_LOC
|
||||
|
||||
@property
|
||||
def docker_repo_tag(self):
|
||||
return common.DOCKER_SRCS[self.docker_repo_source][common.IMG_TAG_KEY]
|
||||
|
||||
def get_namespaces(self):
|
||||
return self.SUPPORTED_NAMESPACES
|
||||
|
||||
|
@ -24,14 +24,6 @@ class GnocchiHelm(openstack.OpenstackBaseHelm):
|
||||
SERVICE_NAME = 'gnocchi'
|
||||
AUTH_USERS = ['gnocchi']
|
||||
|
||||
@property
|
||||
def docker_repo_source(self):
|
||||
return common.DOCKER_SRC_LOC
|
||||
|
||||
@property
|
||||
def docker_repo_tag(self):
|
||||
return common.DOCKER_SRCS[self.docker_repo_source][common.IMG_TAG_KEY]
|
||||
|
||||
def get_namespaces(self):
|
||||
return self.SUPPORTED_NAMESPACES
|
||||
|
||||
@ -63,6 +55,7 @@ class GnocchiHelm(openstack.OpenstackBaseHelm):
|
||||
return {
|
||||
'tags': {
|
||||
'db_init': self.docker_image,
|
||||
'db_init_indexer': self.docker_image,
|
||||
'db_sync': self.docker_image,
|
||||
'gnocchi_api': self.docker_image,
|
||||
'gnocchi_metricd': self.docker_image,
|
||||
|
@ -24,14 +24,6 @@ class HeatHelm(openstack.OpenstackBaseHelm):
|
||||
SERVICE_NAME = constants.HELM_CHART_HEAT
|
||||
AUTH_USERS = ['heat', 'heat_trustee', 'heat_stack_user']
|
||||
|
||||
@property
|
||||
def docker_repo_source(self):
|
||||
return common.DOCKER_SRC_LOC
|
||||
|
||||
@property
|
||||
def docker_repo_tag(self):
|
||||
return common.DOCKER_SRCS[self.docker_repo_source][common.IMG_TAG_KEY]
|
||||
|
||||
def get_namespaces(self):
|
||||
return self.SUPPORTED_NAMESPACES
|
||||
|
||||
@ -64,6 +56,7 @@ class HeatHelm(openstack.OpenstackBaseHelm):
|
||||
'heat_db_sync': self.docker_image,
|
||||
'heat_engine': self.docker_image,
|
||||
'heat_engine_cleaner': self.docker_image,
|
||||
'heat_purge_deleted': self.docker_image,
|
||||
'ks_endpoints': self.docker_image,
|
||||
'ks_service': self.docker_image,
|
||||
'ks_user': self.docker_image,
|
||||
|
@ -23,10 +23,6 @@ class HorizonHelm(openstack.OpenstackBaseHelm):
|
||||
|
||||
SERVICE_NAME = 'horizon'
|
||||
|
||||
@property
|
||||
def docker_repo_source(self):
|
||||
return common.DOCKER_SRC_LOC
|
||||
|
||||
def get_namespaces(self):
|
||||
return self.SUPPORTED_NAMESPACES
|
||||
|
||||
|
@ -32,14 +32,6 @@ class KeystoneHelm(openstack.OpenstackBaseHelm):
|
||||
|
||||
DEFAULT_DOMAIN_NAME = 'default'
|
||||
|
||||
@property
|
||||
def docker_repo_source(self):
|
||||
return common.DOCKER_SRC_LOC
|
||||
|
||||
@property
|
||||
def docker_repo_tag(self):
|
||||
return common.DOCKER_SRCS[self.docker_repo_source][common.IMG_TAG_KEY]
|
||||
|
||||
def get_namespaces(self):
|
||||
return self.SUPPORTED_NAMESPACES
|
||||
|
||||
|
@ -23,14 +23,6 @@ class LibvirtHelm(openstack.OpenstackBaseHelm):
|
||||
|
||||
SERVICE_NAME = 'libvirt'
|
||||
|
||||
@property
|
||||
def docker_repo_source(self):
|
||||
return common.DOCKER_SRC_LOC
|
||||
|
||||
@property
|
||||
def docker_repo_tag(self):
|
||||
return common.DOCKER_SRCS[self.docker_repo_source][common.IMG_TAG_KEY]
|
||||
|
||||
def get_namespaces(self):
|
||||
return self.SUPPORTED_NAMESPACES
|
||||
|
||||
|
@ -32,6 +32,7 @@ class MariadbHelm(openstack.OpenstackBaseHelm):
|
||||
'server': 1
|
||||
}
|
||||
},
|
||||
'images': self._get_images_overrides(),
|
||||
'endpoints': self._get_endpoints_overrides(),
|
||||
}
|
||||
}
|
||||
@ -44,6 +45,16 @@ class MariadbHelm(openstack.OpenstackBaseHelm):
|
||||
else:
|
||||
return overrides
|
||||
|
||||
def _get_images_overrides(self):
|
||||
heat_image = self._operator.chart_operators[
|
||||
constants.HELM_CHART_HEAT].docker_image
|
||||
|
||||
return {
|
||||
'tags': {
|
||||
'prometheus_mysql_exporter_helm_tests': heat_image
|
||||
}
|
||||
}
|
||||
|
||||
def _get_endpoints_overrides(self):
|
||||
return {
|
||||
'oslo_db': {
|
||||
|
@ -30,14 +30,6 @@ class NeutronHelm(openstack.OpenstackBaseHelm):
|
||||
AUTH_USERS = ['neutron']
|
||||
SERVICE_USERS = ['nova']
|
||||
|
||||
@property
|
||||
def docker_repo_source(self):
|
||||
return common.DOCKER_SRC_LOC
|
||||
|
||||
@property
|
||||
def docker_repo_tag(self):
|
||||
return common.DOCKER_SRCS[self.docker_repo_source][common.IMG_TAG_KEY]
|
||||
|
||||
def get_namespaces(self):
|
||||
return self.SUPPORTED_NAMESPACES
|
||||
|
||||
|
@ -46,14 +46,6 @@ class NovaHelm(openstack.OpenstackBaseHelm):
|
||||
AUTH_USERS = ['nova', 'placement']
|
||||
SERVICE_USERS = ['neutron', 'ironic']
|
||||
|
||||
@property
|
||||
def docker_repo_source(self):
|
||||
return common.DOCKER_SRC_LOC
|
||||
|
||||
@property
|
||||
def docker_repo_tag(self):
|
||||
return common.DOCKER_SRCS[self.docker_repo_source][common.IMG_TAG_KEY]
|
||||
|
||||
def get_namespaces(self):
|
||||
return self.SUPPORTED_NAMESPACES
|
||||
|
||||
@ -191,6 +183,7 @@ class NovaHelm(openstack.OpenstackBaseHelm):
|
||||
'nova_cell_setup': self.docker_image,
|
||||
'nova_cell_setup_init': heat_image,
|
||||
'nova_compute': self.docker_image,
|
||||
'nova_compute_ironic': self.docker_image,
|
||||
'nova_compute_ssh': self.docker_image,
|
||||
'nova_conductor': self.docker_image,
|
||||
'nova_consoleauth': self.docker_image,
|
||||
@ -199,6 +192,7 @@ class NovaHelm(openstack.OpenstackBaseHelm):
|
||||
'nova_placement': self.docker_image,
|
||||
'nova_scheduler': self.docker_image,
|
||||
'nova_spiceproxy': self.docker_image,
|
||||
'nova_spiceproxy_assets': self.docker_image
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,13 +21,9 @@ class NovaApiProxyHelm(openstack.OpenstackBaseHelm):
|
||||
common.HELM_NS_OPENSTACK
|
||||
]
|
||||
|
||||
SERVICE_NAME = 'nova'
|
||||
SERVICE_NAME = 'nova-api-proxy'
|
||||
AUTH_USERS = ['nova']
|
||||
|
||||
@property
|
||||
def docker_repo_source(self):
|
||||
return common.DOCKER_SRC_LOC
|
||||
|
||||
def get_namespaces(self):
|
||||
return self.SUPPORTED_NAMESPACES
|
||||
|
||||
@ -63,25 +59,23 @@ class NovaApiProxyHelm(openstack.OpenstackBaseHelm):
|
||||
return overrides
|
||||
|
||||
def _get_images_overrides(self):
|
||||
nova_api_proxy_image = "{}:{}/{}/{}{}:{}".format(
|
||||
self._get_management_address(), common.REGISTRY_PORT, common.REPO_LOC,
|
||||
common.DOCKER_SRCS[self.docker_repo_source][common.IMG_PREFIX_KEY],
|
||||
'nova-api-proxy', self.docker_repo_tag)
|
||||
|
||||
heat_image = self._operator.chart_operators[
|
||||
constants.HELM_CHART_HEAT].docker_image
|
||||
|
||||
return {
|
||||
'tags': {
|
||||
'nova_api_proxy': nova_api_proxy_image,
|
||||
'nova_api_proxy': self.docker_image,
|
||||
'ks_endpoints': heat_image
|
||||
}
|
||||
}
|
||||
|
||||
def _get_endpoints_overrides(self):
|
||||
nova_service_name = self._operator.chart_operators[
|
||||
constants.HELM_CHART_NOVA].SERVICE_NAME
|
||||
|
||||
return {
|
||||
'identity': {
|
||||
'auth': self._get_endpoints_identity_overrides(
|
||||
self.SERVICE_NAME, self.AUTH_USERS),
|
||||
nova_service_name, self.AUTH_USERS),
|
||||
}
|
||||
}
|
||||
|
@ -24,10 +24,6 @@ class PankoHelm(openstack.OpenstackBaseHelm):
|
||||
SERVICE_NAME = 'panko'
|
||||
AUTH_USERS = ['panko']
|
||||
|
||||
@property
|
||||
def docker_repo_source(self):
|
||||
return common.DOCKER_SRC_LOC
|
||||
|
||||
def get_namespaces(self):
|
||||
return self.SUPPORTED_NAMESPACES
|
||||
|
||||
|
@ -32,6 +32,7 @@ class RabbitmqHelm(openstack.OpenstackBaseHelm):
|
||||
'server': self._num_controllers()
|
||||
}
|
||||
},
|
||||
'images': self._get_images_overrides(),
|
||||
'endpoints': self._get_endpoints_overrides(),
|
||||
}
|
||||
}
|
||||
@ -44,6 +45,16 @@ class RabbitmqHelm(openstack.OpenstackBaseHelm):
|
||||
else:
|
||||
return overrides
|
||||
|
||||
def _get_images_overrides(self):
|
||||
heat_image = self._operator.chart_operators[
|
||||
constants.HELM_CHART_HEAT].docker_image
|
||||
|
||||
return {
|
||||
'tags': {
|
||||
'prometheus_rabbitmq_exporter_helm_tests': heat_image
|
||||
}
|
||||
}
|
||||
|
||||
def _get_endpoints_overrides(self):
|
||||
credentials = self._get_endpoints_oslo_messaging_overrides(
|
||||
self.CHART, [])
|
||||
|
@ -26,14 +26,6 @@ class RbdProvisionerHelm(base.BaseHelm):
|
||||
SERVICE_NAME = 'rbd-provisioner'
|
||||
SERVICE_PORT_MON = 6789
|
||||
|
||||
@property
|
||||
def docker_repo_source(self):
|
||||
return common.DOCKER_SRC_LOC
|
||||
|
||||
@property
|
||||
def docker_repo_tag(self):
|
||||
return common.DOCKER_SRCS[self.docker_repo_source][common.IMG_TAG_KEY]
|
||||
|
||||
def get_namespaces(self):
|
||||
return self.SUPPORTED_NAMESPACES
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user