3838OPERATOR_DOMAIN = "pelorus.dora-metrics.io"
3939
4040ROOT = Path (__file__ ).resolve ().parent .parent
41- PELORUS_CHARTS_FOLDER = ROOT / "charts/pelorus"
41+ PELORUS_CHARTS_FOLDER = ROOT / "pelorus-operator/helm- charts/pelorus"
4242PELORUS_EXPORTERS_FOLDER = PELORUS_CHARTS_FOLDER / "charts/exporters"
4343PELORUS_OPERATOR_FOLDER = ROOT / "pelorus-operator"
4444PATCHES_FOLDER = ROOT / "scripts/pelorus-operator-patches"
5454CHARTS_FILES_TO_UPDATE = {
5555 # Files to updated in charts folder and number of changes in each one
5656 PELORUS_CHARTS_FOLDER / "Chart.yaml" : 2 ,
57- ROOT / "charts/operators/Chart.yaml" : 1 ,
57+ # ROOT / "charts/operators/Chart.yaml": 1,
5858 PELORUS_EXPORTERS_FOLDER / "Chart.yaml" : 1 ,
5959 PELORUS_EXPORTERS_FOLDER / "templates/_deployment.yaml" : 2 ,
6060 PELORUS_EXPORTERS_FOLDER / "templates/_imagestream_from_image.yaml" : 1 ,
@@ -123,8 +123,8 @@ def check_prerequisites(destination: Path, force: bool) -> None:
123123 shutil .rmtree (destination )
124124 destination .mkdir (parents = True )
125125
126- if any (destination .iterdir ()):
127- exit_error (f"Destination folder { destination } is not empty" )
126+ # if any(destination.iterdir()):
127+ # exit_error(f"Destination folder {destination} is not empty")
128128
129129 for dependency in SHELL_DEPENDENCIES :
130130 dependency_path = shutil .which (dependency )
@@ -254,24 +254,24 @@ def add_replaces_to_csv(
254254
255255
256256def update_operator_folder (next_operator_version : str , destination : Path ) -> None :
257- logging .info ("Creating operator init files" )
258- # TODO run update command instead of init every time
259- run_command (
260- f"operator-sdk init --plugins=helm --domain={ OPERATOR_DOMAIN } --project-name={ OPERATOR_NAME } " ,
261- directory = destination ,
262- )
263- logging .info ("Creating operator api" )
264- exporters_charts_in_operator = destination / "helm-charts/pelorus/charts/exporters"
265- exporters_charts_in_operator .mkdir (parents = True )
266- shutil .copytree (
267- PELORUS_EXPORTERS_FOLDER , exporters_charts_in_operator , dirs_exist_ok = True
268- )
269- run_command (
270- f"operator-sdk create api --helm-chart={ PELORUS_CHARTS_FOLDER } " ,
271- directory = destination ,
272- )
273- for file in exporters_charts_in_operator .parent .glob ("*.tgz" ):
274- file .unlink ()
257+ # logging.info("Creating operator init files")
258+ # # TODO run update command instead of init every time
259+ # run_command(
260+ # f"operator-sdk init --plugins=helm --domain={OPERATOR_DOMAIN} --project-name={OPERATOR_NAME}",
261+ # directory=destination,
262+ # )
263+ # logging.info("Creating operator api")
264+ # exporters_charts_in_operator = destination / "helm-charts/pelorus/charts/exporters"
265+ # exporters_charts_in_operator.mkdir(parents=True)
266+ # shutil.copytree(
267+ # PELORUS_EXPORTERS_FOLDER, exporters_charts_in_operator, dirs_exist_ok=True
268+ # )
269+ # run_command(
270+ # f"operator-sdk create api --helm-chart={PELORUS_CHARTS_FOLDER}",
271+ # directory=destination,
272+ # )
273+ # for file in exporters_charts_in_operator.parent.glob("*.tgz"):
274+ # file.unlink()
275275
276276 replace_in_file (
277277 file = PELORUS_OPERATOR_FOLDER / "Makefile" ,
@@ -282,7 +282,7 @@ def update_operator_folder(next_operator_version: str, destination: Path) -> Non
282282 operator_image = f"quay.io/{ OPERATOR_ORGANIZATION_NAME } /{ OPERATOR_NAME } "
283283 replace_in_file (
284284 file = PELORUS_OPERATOR_FOLDER / "Makefile" ,
285- pattern = r"IMAGE_TAG_BASE \?= pelorus\.dora-metrics\.io /pelorus-operator" ,
285+ pattern = r"IMAGE_TAG_BASE \?= quay\.io/pelorus /pelorus-operator" ,
286286 new = f"IMAGE_TAG_BASE ?= { operator_image } " ,
287287 number_of_changes = 1 ,
288288 )
@@ -292,15 +292,15 @@ def update_operator_folder(next_operator_version: str, destination: Path) -> Non
292292 directory = destination ,
293293 )
294294
295- for file in sorted (PATCHES_FOLDER .rglob ("*" )):
296- if file .is_file ():
297- logging .info (f"Applying patch { file } " )
298- run_command (f"patch -d { destination } -p0 < { file } " )
295+ # for file in sorted(PATCHES_FOLDER.rglob("*")):
296+ # if file.is_file():
297+ # logging.info(f"Applying patch {file}")
298+ # run_command(f"patch -d {destination} -p0 < {file}")
299299
300300 replace_in_file (
301301 file = PELORUS_OPERATOR_FOLDER
302302 / f"config/manifests/bases/{ OPERATOR_CSV_FILE_NAME } " ,
303- pattern = " containerImage: placeholder " ,
303+ pattern = r " containerImage: quay\.io/pelorus/pelorus-operator:.* " ,
304304 new = f" containerImage: { operator_image } :{ next_operator_version } " ,
305305 number_of_changes = 1 ,
306306 )
0 commit comments