Skip to content
Open
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 deploy/operator/provision-host-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ DIR=$(echo "/Users/${USERNAME}" | base64 -w 0)
if [ -e "/tls/tls.crt" ]; then
echo "{message: \"Creating secret file using TLS certificate...\", level: \"INFO\"}"
KEY=$(cat id_rsa)
if ! otp_raw=$(curl --fail --cacert /tls/tls.crt -XPOST -d "$KEY" https://multi-platform-otp-server.multi-platform-controller.svc.cluster.local/store-key); then
if ! otp_raw=$(curl --fail --connect-timeout 5 --max-time 30 --retry 3 --retry-all-errors --retry-delay 1 --cacert /tls/tls.crt -XPOST -d "$KEY" https://multi-platform-otp-server.multi-platform-controller.svc.cluster.local/store-key); then
echo "{message: \"Failed to store SSH key in OTP server. Please, retry build in a few minutes, and if problem persists, please report it as an MPC bug.\", level: \"ERROR\"}" >&2
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion deploy/operator/provision-host-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ DIR=$(echo 'C:\\Users\\'"${USERNAME}" | base64 -w 0)
if [ -e "/tls/tls.crt" ]; then
echo "{message: \"Creating secret file using TLS certificate...\", level: \"INFO\"}"
KEY=$(cat id_rsa)
if ! otp_raw=$(curl --fail --cacert /tls/tls.crt -XPOST -d "$KEY" https://multi-platform-otp-server.multi-platform-controller.svc.cluster.local/store-key); then
if ! otp_raw=$(curl --fail --connect-timeout 5 --max-time 30 --retry 3 --retry-all-errors --retry-delay 1 --cacert /tls/tls.crt -XPOST -d "$KEY" https://multi-platform-otp-server.multi-platform-controller.svc.cluster.local/store-key); then
echo "{message: \"Failed to store SSH key in OTP server. Please, retry build in a few minutes, and if problem persists, please report it as an MPC bug.\", level: \"ERROR\"}" >&2
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion deploy/operator/provision-shared-host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ DIR=$(echo /home/"$USERNAME" | base64 -w 0)
if [ -e "/tls/tls.crt" ]; then
echo "{message: \"Creating secret file using TLS certificate...\", level: \"INFO\"}"
KEY=$(cat id_rsa)
if ! otp_raw=$(curl --fail --cacert /tls/tls.crt -XPOST -d "$KEY" https://multi-platform-otp-server.multi-platform-controller.svc.cluster.local/store-key); then
if ! otp_raw=$(curl --fail --connect-timeout 5 --max-time 30 --retry 3 --retry-all-errors --retry-delay 1 --cacert /tls/tls.crt -XPOST -d "$KEY" https://multi-platform-otp-server.multi-platform-controller.svc.cluster.local/store-key); then

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] inconsistent-retry-pattern

The curl retry flags for the OTP server call (--connect-timeout 5 --max-time 30) differ from the existing curl retry pattern at line 46 (--connect-timeout 10 --max-time 120). The difference is justified (in-cluster OTP POST vs. external GitHub download), but a brief inline comment explaining the rationale would aid future maintainers.

Suggested fix: Consider adding a brief comment explaining why the OTP server curl uses shorter timeouts than the GitHub download curl, to aid future maintainers.

echo "{message: \"Failed to store SSH key in OTP server. Please, retry build in a few minutes, and if problem persists, please report it as an MPC bug.\", level: \"ERROR\"}" >&2
exit 1
fi
Expand Down
Loading