Skip to content

Commit

Permalink
K8SPXC-200 fix run_backup.sh script (#896)
Browse files Browse the repository at this point in the history
* K8SPXC-200 fix run_backup.sh script

* fix CVE for debug image
  • Loading branch information
hors authored Jan 9, 2024
1 parent a51728d commit 569cc24
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions percona-xtradb-cluster-8.0-backup/run_backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ check_ssl() {
FIRST_RECEIVED=0
SST_FAILED=0
handle_sigterm() {
if ((FIRST_RECEIVED == 0)); then
if (($FIRST_RECEIVED == 0)); then
pid_s=$(ps -C socat -o pid= || true)
if [ -n "${pid_s}" ]; then
log 'ERROR' 'SST request failed'
Expand Down Expand Up @@ -77,7 +77,7 @@ backup_volume() {
echo "[IINFO] Socat(1) returned $?"
vault_store $BACKUP_DIR/${SST_INFO_NAME}

if ((SST_FAILED == 0)); then
if (($SST_FAILED == 0)); then
FIRST_RECEIVED=0
socat -u "$SOCAT_OPTS" stdio >xtrabackup.stream
FIRST_RECEIVED=1
Expand Down Expand Up @@ -117,7 +117,7 @@ backup_s3() {
| xbcloud put --parallel="$(grep -c processor /proc/cpuinfo)" --storage=s3 --md5 $XBCLOUD_ARGS --s3-bucket="$S3_BUCKET" "$S3_BUCKET_PATH.$SST_INFO_NAME" 2>&1 \
| (grep -v "error: http request failed: Couldn't resolve host name" || exit 1)

if ((SST_FAILED == 0)); then
if (($SST_FAILED == 0)); then
FIRST_RECEIVED=0
socat -u "$SOCAT_OPTS" stdio \
| xbcloud put --storage=s3 --parallel="$(grep -c processor /proc/cpuinfo)" --md5 $XBCLOUD_ARGS --s3-bucket="$S3_BUCKET" "$S3_BUCKET_PATH" 2>&1 \
Expand Down Expand Up @@ -158,7 +158,7 @@ backup_azure() {
| xbcloud put --parallel="$(grep -c processor /proc/cpuinfo)" $XBCLOUD_ARGS --storage=azure "$BACKUP_PATH.$SST_INFO_NAME" 2>&1 \
| (grep -v "error: http request failed: Couldn't resolve host name" || exit 1)

if ((SST_FAILED == 0)); then
if (($SST_FAILED == 0)); then
FIRST_RECEIVED=0
socat -u "$SOCAT_OPTS" stdio \
| xbcloud put --parallel="$(grep -c processor /proc/cpuinfo)" $XBCLOUD_ARGS --storage=azure "$BACKUP_PATH" 2>&1 \
Expand All @@ -179,7 +179,7 @@ else
backup_volume
fi

if ((SST_FAILED == 0)); then
if (($SST_FAILED == 0)); then
touch /tmp/backup-is-completed
fi
exit $SST_FAILED
2 changes: 1 addition & 1 deletion percona-xtradb-cluster-8.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ RUN if [[ -n $DEBUG ]] ; then \
percona-release disable pdpxc-8.0 ${PXC_REPO}; \
curl -Lf -o /tmp/telnet.rpm http://vault.centos.org/centos/8/AppStream/x86_64/os/Packages/telnet-0.17-76.el8.x86_64.rpm; \
curl -Lf -o /tmp/tcpdump.rpm http://vault.centos.org/centos/8/AppStream/x86_64/os/Packages/tcpdump-4.9.3-2.el8.x86_64.rpm; \
curl -Lf -o /tmp/perf.rpm https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/getPackage/perf-4.18.0-477.13.1.el8_8.x86_64.rpm; \
curl -Lf -o /tmp/perf.rpm https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/getPackage/perf-4.18.0-513.9.1.el8_9.x86_64.rpm; \
curl -Lf -o /tmp/strace.rpm http://vault.centos.org/centos/8/BaseOS/x86_64/os/Packages/strace-5.7-3.el8.x86_64.rpm; \
curl -Lf -o /tmp/percona-xtradb-cluster-debuginfo.rpm https://repo.percona.com/pxc-80/yum/${PXC_REPO}/8/RPMS/x86_64/percona-xtradb-cluster-debuginfo-${FULL_PERCONA_XTRADBCLUSTER_VERSION}.x86_64.rpm; \
curl -Lf -o /tmp/percona-xtradb-cluster-server-debuginfo.rpm https://repo.percona.com/pxc-80/yum/${PXC_REPO}/8/RPMS/x86_64/percona-xtradb-cluster-server-debuginfo-${FULL_PERCONA_XTRADBCLUSTER_VERSION}.x86_64.rpm; \
Expand Down

0 comments on commit 569cc24

Please sign in to comment.