Skip to content

Commit e82a998

Browse files
Remove def _helm_chart_dir that used undefined env var (#535)
# Summary In our source file we had a function ``` def _helm_chart_dir(default: Optional[str] = "helm_chart") -> str: return os.environ.get("HELM_CHART_DIR", default) ``` The env var `HELM_CHART_DIR` is not set in our project anywhere that makes this function not needed. That's why this PR removes the function. From the function def we can see that it would always return what was passed to this function, that's why at the caller we are removing the function call and just using the argument. ## Proof of Work CI in the PR. ## Checklist - [x] Have you linked a jira ticket and/or is the ticket in the title? - [x] Have you checked whether your jira ticket required DOCSP changes? - [x] Have you added changelog file? - use `skip-changelog` label if not needed - refer to [Changelog files and Release Notes](https://github.com/mongodb/mongodb-kubernetes/blob/master/CONTRIBUTING.md#changelog-files-and-release-notes) section in CONTRIBUTING.md for more details
1 parent ebb8f78 commit e82a998

File tree

1 file changed

+3
-7
lines changed
  • docker/mongodb-kubernetes-tests/kubetester

1 file changed

+3
-7
lines changed

docker/mongodb-kubernetes-tests/kubetester/helm.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def helm_template(
2525
command_args.append("--show-only")
2626
command_args.append(templates)
2727

28-
args = ("helm", "template", *(command_args), _helm_chart_dir(helm_chart_path))
28+
args = ("helm", "template", *(command_args), helm_chart_path)
2929
logger.info(" ".join(args))
3030

3131
yaml_file_name = "{}.yaml".format(str(uuid.uuid4()))
@@ -51,7 +51,7 @@ def helm_install(
5151
f"--namespace={namespace}",
5252
*command_args,
5353
name,
54-
_helm_chart_dir(helm_chart_path),
54+
helm_chart_path,
5555
]
5656
if custom_operator_version:
5757
args.append(f"--version={custom_operator_version}")
@@ -159,7 +159,7 @@ def helm_upgrade(
159159
logger.warning("Helm chart path is empty, defaulting to 'helm_chart'")
160160
helm_chart_path = "helm_chart"
161161

162-
chart_dir = helm_chart_path if helm_override_path else _helm_chart_dir(helm_chart_path)
162+
chart_dir = helm_chart_path
163163

164164
if apply_crds_first:
165165
apply_crds_from_chart(chart_dir)
@@ -230,7 +230,3 @@ def _create_helm_args(helm_args: Dict[str, str], helm_options: Optional[List[str
230230
command_args.extend(helm_options)
231231

232232
return command_args
233-
234-
235-
def _helm_chart_dir(default: Optional[str] = "helm_chart") -> str:
236-
return os.environ.get("HELM_CHART_DIR", default)

0 commit comments

Comments
 (0)