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

🐛 Fix htpasswd command not found #1486

Merged
merged 1 commit into from
Dec 12, 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
1 change: 1 addition & 0 deletions hack/ci-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ BMO_E2E_EMULATOR=${BMO_E2E_EMULATOR:-"sushy-tools"}
"${REPO_ROOT}/hack/e2e/ensure_go.sh"
export PATH="${PATH}:/usr/local/go/bin"
"${REPO_ROOT}/hack/e2e/ensure_minikube.sh"
"${REPO_ROOT}/hack/e2e/ensure_htpasswd.sh"
# CAPI test framework uses kubectl in the background
"${REPO_ROOT}/hack/e2e/ensure_kubectl.sh"

Expand Down
15 changes: 15 additions & 0 deletions hack/e2e/ensure_htpasswd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

set -eux

# Check if htpasswd is installed and install it if not
verify_htpasswd()
{
if ! [ -x "$(command -v htpasswd)" ]; then
echo "htpasswd could not be found, installing..."
sudo apt-get update
sudo apt-get install -y apache2-utils
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not specific to this PR, but generally these hack/e2e/ scripts wont work locally for a mac user like me. I will add an issue to make it work for other architectures as well.
cc @lentzi90 @maxrantil

Copy link
Member

@lentzi90 lentzi90 Dec 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it would be great to make this more flexible so it can work also for development and not just CI. So far my focus has been to just set up the CI, but for the long term I definitely intend to make this easier for developers to use locally.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dis-asgree here. My understanding was the hack/ scripts are also used to test the CI test locally. If hack/e2e scripts are not meant to be used by developers locally, then I can agree.

I would ask that you do not make the CI unnecessarily complicated just to accommodate mac users though 😉

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyways, I have created an issue here anyhow #1487, lets discuss it on the issue.
/approve

fi
}

verify_htpasswd