From c0a3c0fde2e96c79a683de00325b8166b277b5ae Mon Sep 17 00:00:00 2001 From: Jiri Tyr Date: Tue, 20 Dec 2022 14:18:37 +0000 Subject: [PATCH] Suppot symlink dependencies; improving ci dir discovery --- scripts/helm/plugin_wrapper.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/scripts/helm/plugin_wrapper.py b/scripts/helm/plugin_wrapper.py index 5263dce..801d66d 100755 --- a/scripts/helm/plugin_wrapper.py +++ b/scripts/helm/plugin_wrapper.py @@ -307,12 +307,15 @@ def parse_config(filename): return args -def get_values_files(values_dir, values_pattern): +def get_values_files(values_dir, values_pattern, chart_dir=None): values_files = [] - # Get values files if os.path.isdir(values_dir): + # Get values files from a specific path values_files = glob(os.path.join(values_dir, values_pattern)) + elif chart_dir is not None and os.path.isdir(os.path.join(chart_dir, values_dir)): + # Get values files from the chart directory + values_files = glob(os.path.join(chart_dir, values_dir, values_pattern)) return values_files @@ -336,11 +339,17 @@ def run_helm_dependecy_build(args): for d in data["dependencies"]: if not ( "name" in d - and "version" in d - and os.path.isfile( - os.path.join( - charts_dir, "%s-%s.tgz" % (d["name"], d["version"]) + and ( + ( + "version" in d + and os.path.isfile( + os.path.join( + charts_dir, + "%s-%s.tgz" % (d["name"], d["version"]), + ) + ) ) + or os.path.islink(os.path.join(charts_dir, d["name"])) ) ): # Dependency missing, let's get it @@ -529,6 +538,7 @@ def main(): values_files = get_values_files( args["wrapper"].values_dir, args["wrapper"].values_pattern, + args["helm_tmpl"][-1], ) # Run tests