Commit 62834a9d authored by harshavardhan.c's avatar harshavardhan.c

enh: functionality changes while preparing the helm chart.

parent 6ba91763
...@@ -27,9 +27,9 @@ app.add_middleware( ...@@ -27,9 +27,9 @@ app.add_middleware(
) )
@app.on_event("startup") # @app.on_event("startup")
async def startup_event(): # async def startup_event():
""" # """
This function is to create default database and tables, # This function is to create default database and tables,
""" # """
create_default_psql_dependencies() # create_default_psql_dependencies()
...@@ -22,15 +22,13 @@ class HelmHandler: ...@@ -22,15 +22,13 @@ class HelmHandler:
global_config_vars = global_config_data.get('data', {}) global_config_vars = global_config_data.get('data', {})
existing_env_variables = {_v['name']: _v for _v in existing_env_variables = {_v['name']: _v for _v in
existing_data.get('deployment', {}).get('environmentVar', [])} existing_data.get('deployment', {}).get('environmentVar', [])}
existing_data['deployment']['environmentVar'] = [] diff_keys = list(set(existing_env_variables.keys()).symmetric_difference(set(module_env_variables.keys())))
for k, v in module_env_variables.items(): for _each in diff_keys:
if k.lower() in {'port', 'service_port', 'module_port'} and v.get("value"): if _each.lower() in {'port', 'service_port', 'module_port'} and module_env_variables[_each].get(
global_config_vars["SERVICE_PORT"] = v['value'] "value"):
global_config_vars["SERVICE_PORT"] = module_env_variables[_each]["value"]
continue continue
if "valueFrom" in existing_env_variables.get(k, []): existing_data['deployment']['environmentVar'].append(module_env_variables[_each])
existing_data['deployment']['environmentVar'].append(existing_env_variables[k])
else:
existing_data['deployment']['environmentVar'].append(v)
existing_data['deployment']['imageName'] = image_tag or existing_data['deployment']['imageName'] existing_data['deployment']['imageName'] = image_tag or existing_data['deployment']['imageName']
self.common_utils.convert_json_to_yaml(json_data=existing_data, output_file_path=template_file) self.common_utils.convert_json_to_yaml(json_data=existing_data, output_file_path=template_file)
......
...@@ -4,7 +4,7 @@ from scripts.db.psql.databases import Base ...@@ -4,7 +4,7 @@ from scripts.db.psql.databases import Base
class ILensVersionTable(Base): class ILensVersionTable(Base):
__tablename__ = "ilens_version_tags" __tablename__ = "ilens_version_release"
id = Column(Integer, autoincrement=True, primary_key=True) id = Column(Integer, autoincrement=True, primary_key=True)
module_name = Column(String, index=True, nullable=False) module_name = Column(String, index=True, nullable=False)
...@@ -13,6 +13,6 @@ class ILensVersionTable(Base): ...@@ -13,6 +13,6 @@ class ILensVersionTable(Base):
release_version = Column(Integer, nullable=False) release_version = Column(Integer, nullable=False)
feature_version = Column(Integer, nullable=False) feature_version = Column(Integer, nullable=False)
patch_version = Column(Integer, nullable=False) patch_version = Column(Integer, nullable=False)
image_tag = Column(String, nullable=False) image_url = Column(String, nullable=False)
last_updated_at = Column(TIMESTAMP(timezone=True), nullable=False, index=True) updated_at = Column(TIMESTAMP(timezone=True), nullable=False, index=True)
__table_args__ = (Index('version_index', "module_name", "client"),) __table_args__ = (Index('version_index', "module_name", "client"),)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment