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

HBASE-28455 do-release-docker fails to setup gpg agent proxy if proxy container is slow to start #5781

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
17 changes: 15 additions & 2 deletions dev-support/create-release/do-release-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,22 @@ if [ "${HOST_OS}" == "DARWIN" ]; then
"type=bind,src=${HOME}/.ssh/id_rsa.pub,dst=/home/${USER}/.ssh/authorized_keys,readonly" \
"${GPG_PROXY_MOUNT[@]}" \
"org.apache.hbase/gpg-agent-proxy:${IMGTAG}"

KEYSCAN_OUTPUT_PATH="${WORKDIR}/gpg-agent-proxy.ssh-keyscan"
if [ -f "${KEYSCAN_OUTPUT_PATH}" ]; then
Copy link
Member

Choose a reason for hiding this comment

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

Can this be cleaned up in the cleanup function that it attached to the TRAP?

# cleanup first so that the below checks will work, in case this is a rerun.
rm "${KEYSCAN_OUTPUT_PATH}"
fi

log "Waiting for port 62222 to be available"
while [ ! -s "${KEYSCAN_OUTPUT_PATH}" ]; do
sleep 5
ssh-keyscan -p 62222 localhost 2>/dev/null | sort > "${KEYSCAN_OUTPUT_PATH}"
done
log "Done - port 62222 is ready"

# gotta trust the container host
ssh-keyscan -p 62222 localhost 2>/dev/null | sort > "${WORKDIR}/gpg-agent-proxy.ssh-keyscan"
sort "${HOME}/.ssh/known_hosts" | comm -1 -3 - "${WORKDIR}/gpg-agent-proxy.ssh-keyscan" \
sort "${HOME}/.ssh/known_hosts" | comm -1 -3 - "${KEYSCAN_OUTPUT_PATH}" \
> "${WORKDIR}/gpg-agent-proxy.known_hosts"
if [ -s "${WORKDIR}/gpg-agent-proxy.known_hosts" ]; then
log "Your ssh known_hosts does not include the entries for the gpg-agent proxy container."
Expand Down