Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#2353459] Bug fix for config/example-values.yaml file not present in resc-helm-wizard while installing from pip #114

Merged
merged 1 commit into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deployment/resc-helm-wizard/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
exclude README.md
exclude MANIFEST.in
include config/*.yaml
include src/resc_helm_wizard/config/*.yaml
2 changes: 1 addition & 1 deletion deployment/resc-helm-wizard/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[metadata]
name = resc_helm_wizard
description = Repository Scanner - Helm Wizard
version = 1.0.3
version = 1.0.4
author = ABN AMRO
author_email = resc@nl.abnamro.com
url = https://github.com/ABNAMRO/repository-scanner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def add_helm_repository():
"""
Adds a helm repository
"""
cmd = ["helm", "repo", "add", constants.HELM_REPO_NAME, constants.RESC_HELM_REPO_URL]
cmd = ["helm", "repo", "add", constants.HELM_REPO_NAME, constants.RESC_HELM_REPO_URL, "-n", constants.NAMESPACE]
try:
subprocess.run(cmd, check=True)
except subprocess.CalledProcessError:
Expand All @@ -86,7 +86,7 @@ def update_helm_repository():
"""
Updates a helm repository
"""
cmd = ["helm", "repo", "update", constants.HELM_REPO_NAME]
cmd = ["helm", "repo", "update", "-n", constants.NAMESPACE]
try:
subprocess.run(cmd, check=True)
except subprocess.CalledProcessError:
Expand Down
8 changes: 4 additions & 4 deletions deployment/resc-helm-wizard/tests/test_helm_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ def test_get_version_from_downloaded_chart_failure(mock_check_output):

@patch("subprocess.run")
def test_add_helm_repository_success(mock_check_output):
cmd = ["helm", "repo", "add", constants.HELM_REPO_NAME, constants.RESC_HELM_REPO_URL]
cmd = ["helm", "repo", "add", constants.HELM_REPO_NAME, constants.RESC_HELM_REPO_URL, "-n", constants.NAMESPACE]
add_helm_repository()
assert mock_check_output.called
mock_check_output.assert_called_once_with(cmd, check=True)


@patch("logging.Logger.error")
def test_add_helm_repository_failure(mock_error_log):
cmd = ["helm", "repo", "add", constants.HELM_REPO_NAME, constants.RESC_HELM_REPO_URL]
cmd = ["helm", "repo", "add", constants.HELM_REPO_NAME, constants.RESC_HELM_REPO_URL, "-n", constants.NAMESPACE]
expected_error_log = "An error occurred while adding the helm repository"
with mock.patch("subprocess.run") as mock_check_output, \
mock.patch("sys.exit") as mock_sys_exit:
Expand All @@ -116,15 +116,15 @@ def test_add_helm_repository_failure(mock_error_log):

@patch("subprocess.run")
def test_update_helm_repository_success(mock_check_output):
cmd = ["helm", "repo", "update", constants.HELM_REPO_NAME]
cmd = ["helm", "repo", "update", "-n", constants.NAMESPACE]
update_helm_repository()
assert mock_check_output.called
mock_check_output.assert_called_once_with(cmd, check=True)


@patch("logging.Logger.error")
def test_update_helm_repository_failure(mock_error_log):
cmd = ["helm", "repo", "update", constants.HELM_REPO_NAME]
cmd = ["helm", "repo", "update", "-n", constants.NAMESPACE]
expected_error_log = "An error occurred while updating the helm repository"
with mock.patch("subprocess.run") as mock_check_output, \
mock.patch("sys.exit") as mock_sys_exit:
Expand Down