Skip to content

Commit 13cf357

Browse files
authored
Fixed helm unit tests and database docker build (#653)
# Summary * Bumped helm version as recent update of helm's unittest plugin stopped working with helm 3.17. * Fixed building of mongodb-enterprise-database image. `net-snmp` and `net-snmp-agent-libs` caused problems. Upon a closer look those are unnecessary according to [docs](https://www.mongodb.com/docs/v8.0/tutorial/install-mongodb-enterprise-on-red-hat-tarball/#prerequisites). ## Proof of Work [Passing helm tests](https://spruce.mongodb.com/task/__lsierant_fix_database_docker_unit_tests_unit_tests_helm_patch_2bf57afa4dc1576938f614c3d4d13b4755daef2b_6943b7f80745bf000705a8b7_25_12_18_08_14_50/logs?execution=0) [Passing mongodb-kubernetes-database build](https://spruce.mongodb.com/task/__lsierant_fix_database_docker_init_test_run_build_database_image_ubi_patch_2bf57afa4dc1576938f614c3d4d13b4755daef2b_6943b7f80745bf000705a8b7_25_12_18_08_14_50/logs?execution=0)
1 parent 2bf57af commit 13cf357

File tree

5 files changed

+18
-8
lines changed

5 files changed

+18
-8
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,11 @@ test: generate fmt vet manifests golang-tests
300300
# helm-tests will run helm chart unit tests
301301
helm-tests:
302302
@echo "Running helm chart unit tests..."
303-
@if ! helm plugin list | grep -q unittest; then \
304-
echo "Installing helm-unittest plugin..."; \
303+
helm version
304+
helm plugin list || true
305+
@if ! helm unittest --help >/dev/null 2>&1; then \
306+
echo "helm-unittest plugin not working/not installed, reinstalling..."; \
307+
helm plugin uninstall unittest 2>/dev/null || true; \
305308
helm plugin install https://github.com/helm-unittest/helm-unittest; \
306309
fi
307310
helm unittest helm_chart --color

docker/mongodb-kubernetes-database/Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,20 @@ RUN microdnf install -y --disableplugin=subscription-manager \
2424
krb5-libs \
2525
libcurl \
2626
lm_sensors-libs \
27-
net-snmp \
28-
net-snmp-agent-libs \
27+
net-snmp-libs \
2928
openldap \
3029
openssl \
3130
jq \
3231
tar \
3332
xz-libs \
3433
findutils
3534

35+
# Workaround for UBI8 repo version mismatch: net-snmp requires net-snmp-libs=5.8-31
36+
# but only 5.8-32 is available. Install with --nodeps since they are ABI compatible.
37+
RUN microdnf download net-snmp net-snmp-agent-libs && \
38+
rpm -ivh --nodeps net-snmp-*.rpm && \
39+
rm -f net-snmp-*.rpm
40+
3641
RUN ln -s /usr/lib64/libsasl2.so.3 /usr/lib64/libsasl2.so.2
3742

3843
# Set the required perms

scripts/dev/contexts/root-context

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,6 @@ export RELEASE_INITIAL_VERSION="1.3.0"
153153

154154
export CLUSTER_TYPE=kind
155155
export OPERATOR_CLUSTER_SCOPED=false
156+
157+
# for downloading helm binaries
158+
export HELM_VERSION="v3.19.4"

scripts/dev/setup_evg_host.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ download_kubectl() {
5656

5757
download_helm() {
5858
echo "Downloading helm..."
59-
curl -s -o helm.tar.gz -L https://get.helm.sh/helm-v3.17.1-linux-"${ARCH}"tar.gz
59+
curl -s -o helm.tar.gz -L "https://get.helm.sh/helm-${HELM_VERSION}-linux-${ARCH}tar.gz"
6060
tar -xf helm.tar.gz 2>/dev/null
6161
sudo mv linux-"${ARCH}"helm /usr/local/bin/helm
6262
rm helm.tar.gz

scripts/evergreen/setup_kubectl.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ echo "kubectl version --client"
2222
./kubectl version --client
2323
mv kubectl "${bindir}"
2424

25-
echo "Downloading helm for ${ARCH}"
25+
echo "Downloading helm ${HELM_VERSION} for ${ARCH}"
2626
helm_archive="${tmpdir}/helm.tgz"
27-
helm_version="v3.17.1"
28-
curl --retry 5 --retry-delay 3 --retry-all-errors --fail --show-error --max-time 180 -s https://get.helm.sh/helm-${helm_version}-linux-"${ARCH}".tar.gz --output "${helm_archive}"
27+
curl --retry 5 --retry-delay 3 --retry-all-errors --fail --show-error --max-time 180 -s "https://get.helm.sh/helm-${HELM_VERSION}-linux-${ARCH}.tar.gz" --output "${helm_archive}"
2928

3029
tar xfz "${helm_archive}" -C "${tmpdir}" &> /dev/null
3130
mv "${tmpdir}/linux-${ARCH}/helm" "${bindir}"

0 commit comments

Comments
 (0)