Skip to content
Open
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
25 changes: 23 additions & 2 deletions pkg/helm/actions/testdata/chartmuseum.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,39 @@ if [ ! -x "$BINARY" ]; then
ls -la "./$GOOS-$GOARCH/" >&2
exit 1
fi

# Verify binary can execute (catches glibc/library incompatibility)
if ! "$BINARY" --version > /dev/null 2>&1; then
echo "ERROR: chartmuseum binary cannot execute (likely library incompatibility)" >&2
echo "ldd output:" >&2
ldd "$BINARY" >&2 || true
file "$BINARY" >&2 || true
exit 1
fi

echo "Starting chartmuseum TLS on port 9443..." >&2

# Verify TLS files exist
if [ ! -f ./server.crt ] || [ ! -f ./server.key ]; then
echo "ERROR: TLS cert/key missing. Expected ./server.crt and ./server.key" >&2
ls -la ./server.* >&2 || true
exit 1
fi

"$BINARY" --debug --port=9443 \
--storage="local" \
--storage-local-rootdir="./chartstore-9443" \
--tls-cert=./server.crt --tls-key=./server.key \
> ./chartmuseum-9443.log 2>&1 &
CM_PID=$!
echo $CM_PID > ./chartmuseum-tls.pid
sleep 1
sleep 3
if ! kill -0 $CM_PID 2>/dev/null; then
echo "ERROR: chartmuseum (TLS) exited immediately. Log:" >&2
echo "ERROR: chartmuseum (TLS) exited within 3s. Exit code:" >&2
wait $CM_PID 2>/dev/null; echo " $?" >&2
echo "Log contents:" >&2
cat ./chartmuseum-9443.log >&2
echo "---" >&2
exit 1
fi
echo "chartmuseum TLS started (PID $CM_PID)" >&2