Skip to content

Commit 3e8f64f

Browse files
committed
Updates to address shellcheck findings
Issue: PGO-1427
1 parent 4549296 commit 3e8f64f

File tree

3 files changed

+84
-72
lines changed

3 files changed

+84
-72
lines changed

internal/controller/postgrescluster/instance_test.go

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -550,26 +550,28 @@ func TestAddPGBackRestToInstancePodSpec(t *testing.T) {
550550
# Parameters for curl when managing autogrow annotation.
551551
APISERVER="https://kubernetes.default.svc"
552552
SERVICEACCOUNT="/var/run/secrets/kubernetes.io/serviceaccount"
553-
NAMESPACE=$(cat ${SERVICEACCOUNT}/namespace)
554-
TOKEN=$(cat ${SERVICEACCOUNT}/token)
553+
NAMESPACE=$(cat "${SERVICEACCOUNT}"/namespace)
554+
TOKEN=$(cat "${SERVICEACCOUNT}"/token)
555555
CACERT=${SERVICEACCOUNT}/ca.crt
556556
557557
# Manage autogrow annotation.
558558
# Return size in Mebibytes.
559559
manageAutogrowAnnotation() {
560560
local volume=$1
561561
562-
size=$(df --human-readable --block-size=M /pgbackrest/"${volume}" | awk 'FNR == 2 {print $2}')
563-
use=$(df --human-readable /pgbackrest/"${volume}" | awk 'FNR == 2 {print $5}')
562+
size=$(df --human-readable --block-size=M "/pgbackrest/${volume}")
563+
read -r _ size _ <<< "${size#*$'\n'}"
564+
use=$(df --human-readable "/pgbackrest/${volume}")
565+
read -r _ _ _ _ use _ <<< "${use#*$'\n'}"
564566
sizeInt="${size//M/}"
565567
# Use the sed punctuation class, because the shell will not accept the percent sign in an expansion.
566-
useInt=$(echo $use | sed 's/[[:punct:]]//g')
568+
useInt=${use//[[:punct:]]/}
567569
triggerExpansion="$((useInt > 75))"
568-
if [ $triggerExpansion -eq 1 ]; then
570+
if [[ ${triggerExpansion} -eq 1 ]]; then
569571
newSize="$(((sizeInt / 2)+sizeInt))"
570572
newSizeMi="${newSize}Mi"
571-
d='[{"op": "add", "path": "/metadata/annotations/suggested-'"${volume}"'-pvc-size", "value": "'"$newSizeMi"'"}]'
572-
curl --cacert ${CACERT} --header "Authorization: Bearer ${TOKEN}" -XPATCH "${APISERVER}/api/v1/namespaces/${NAMESPACE}/pods/${HOSTNAME}?fieldManager=kubectl-annotate" -H "Content-Type: application/json-patch+json" --data "$d"
573+
d='[{"op": "add", "path": "/metadata/annotations/suggested-'"${volume}"'-pvc-size", "value": "'"${newSizeMi}"'"}]'
574+
curl --cacert "${CACERT}" --header "Authorization: Bearer ${TOKEN}" -XPATCH "${APISERVER}/api/v1/namespaces/${NAMESPACE}/pods/${HOSTNAME}?fieldManager=kubectl-annotate" -H "Content-Type: application/json-patch+json" --data "${d}"
573575
fi
574576
}
575577
@@ -592,22 +594,22 @@ func TestAddPGBackRestToInstancePodSpec(t *testing.T) {
592594
fi
593595
594596
# manage autogrow annotation for the repo1 volume, if it exists
595-
if [ -d /pgbackrest/repo1 ]; then
597+
if [[ -d /pgbackrest/repo1 ]]; then
596598
manageAutogrowAnnotation "repo1"
597599
fi
598600
599601
# manage autogrow annotation for the repo2 volume, if it exists
600-
if [ -d /pgbackrest/repo2 ]; then
602+
if [[ -d /pgbackrest/repo2 ]]; then
601603
manageAutogrowAnnotation "repo2"
602604
fi
603605
604606
# manage autogrow annotation for the repo3 volume, if it exists
605-
if [ -d /pgbackrest/repo3 ]; then
607+
if [[ -d /pgbackrest/repo3 ]]; then
606608
manageAutogrowAnnotation "repo3"
607609
fi
608610
609611
# manage autogrow annotation for the repo4 volume, if it exists
610-
if [ -d /pgbackrest/repo4 ]; then
612+
if [[ -d /pgbackrest/repo4 ]]; then
611613
manageAutogrowAnnotation "repo4"
612614
fi
613615
@@ -714,26 +716,28 @@ func TestAddPGBackRestToInstancePodSpec(t *testing.T) {
714716
# Parameters for curl when managing autogrow annotation.
715717
APISERVER="https://kubernetes.default.svc"
716718
SERVICEACCOUNT="/var/run/secrets/kubernetes.io/serviceaccount"
717-
NAMESPACE=$(cat ${SERVICEACCOUNT}/namespace)
718-
TOKEN=$(cat ${SERVICEACCOUNT}/token)
719+
NAMESPACE=$(cat "${SERVICEACCOUNT}"/namespace)
720+
TOKEN=$(cat "${SERVICEACCOUNT}"/token)
719721
CACERT=${SERVICEACCOUNT}/ca.crt
720722
721723
# Manage autogrow annotation.
722724
# Return size in Mebibytes.
723725
manageAutogrowAnnotation() {
724726
local volume=$1
725727
726-
size=$(df --human-readable --block-size=M /pgbackrest/"${volume}" | awk 'FNR == 2 {print $2}')
727-
use=$(df --human-readable /pgbackrest/"${volume}" | awk 'FNR == 2 {print $5}')
728+
size=$(df --human-readable --block-size=M "/pgbackrest/${volume}")
729+
read -r _ size _ <<< "${size#*$'\n'}"
730+
use=$(df --human-readable "/pgbackrest/${volume}")
731+
read -r _ _ _ _ use _ <<< "${use#*$'\n'}"
728732
sizeInt="${size//M/}"
729733
# Use the sed punctuation class, because the shell will not accept the percent sign in an expansion.
730-
useInt=$(echo $use | sed 's/[[:punct:]]//g')
734+
useInt=${use//[[:punct:]]/}
731735
triggerExpansion="$((useInt > 75))"
732-
if [ $triggerExpansion -eq 1 ]; then
736+
if [[ ${triggerExpansion} -eq 1 ]]; then
733737
newSize="$(((sizeInt / 2)+sizeInt))"
734738
newSizeMi="${newSize}Mi"
735-
d='[{"op": "add", "path": "/metadata/annotations/suggested-'"${volume}"'-pvc-size", "value": "'"$newSizeMi"'"}]'
736-
curl --cacert ${CACERT} --header "Authorization: Bearer ${TOKEN}" -XPATCH "${APISERVER}/api/v1/namespaces/${NAMESPACE}/pods/${HOSTNAME}?fieldManager=kubectl-annotate" -H "Content-Type: application/json-patch+json" --data "$d"
739+
d='[{"op": "add", "path": "/metadata/annotations/suggested-'"${volume}"'-pvc-size", "value": "'"${newSizeMi}"'"}]'
740+
curl --cacert "${CACERT}" --header "Authorization: Bearer ${TOKEN}" -XPATCH "${APISERVER}/api/v1/namespaces/${NAMESPACE}/pods/${HOSTNAME}?fieldManager=kubectl-annotate" -H "Content-Type: application/json-patch+json" --data "${d}"
737741
fi
738742
}
739743
@@ -756,22 +760,22 @@ func TestAddPGBackRestToInstancePodSpec(t *testing.T) {
756760
fi
757761
758762
# manage autogrow annotation for the repo1 volume, if it exists
759-
if [ -d /pgbackrest/repo1 ]; then
763+
if [[ -d /pgbackrest/repo1 ]]; then
760764
manageAutogrowAnnotation "repo1"
761765
fi
762766
763767
# manage autogrow annotation for the repo2 volume, if it exists
764-
if [ -d /pgbackrest/repo2 ]; then
768+
if [[ -d /pgbackrest/repo2 ]]; then
765769
manageAutogrowAnnotation "repo2"
766770
fi
767771
768772
# manage autogrow annotation for the repo3 volume, if it exists
769-
if [ -d /pgbackrest/repo3 ]; then
773+
if [[ -d /pgbackrest/repo3 ]]; then
770774
manageAutogrowAnnotation "repo3"
771775
fi
772776
773777
# manage autogrow annotation for the repo4 volume, if it exists
774-
if [ -d /pgbackrest/repo4 ]; then
778+
if [[ -d /pgbackrest/repo4 ]]; then
775779
manageAutogrowAnnotation "repo4"
776780
fi
777781

internal/pgbackrest/config.go

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -625,26 +625,28 @@ func reloadCommand(name string) []string {
625625
# Parameters for curl when managing autogrow annotation.
626626
APISERVER="https://kubernetes.default.svc"
627627
SERVICEACCOUNT="/var/run/secrets/kubernetes.io/serviceaccount"
628-
NAMESPACE=$(cat ${SERVICEACCOUNT}/namespace)
629-
TOKEN=$(cat ${SERVICEACCOUNT}/token)
628+
NAMESPACE=$(cat "${SERVICEACCOUNT}"/namespace)
629+
TOKEN=$(cat "${SERVICEACCOUNT}"/token)
630630
CACERT=${SERVICEACCOUNT}/ca.crt
631631
632632
# Manage autogrow annotation.
633633
# Return size in Mebibytes.
634634
manageAutogrowAnnotation() {
635635
local volume=$1
636636
637-
size=$(df --human-readable --block-size=M /pgbackrest/"${volume}" | awk 'FNR == 2 {print $2}')
638-
use=$(df --human-readable /pgbackrest/"${volume}" | awk 'FNR == 2 {print $5}')
637+
size=$(df --human-readable --block-size=M "/pgbackrest/${volume}")
638+
read -r _ size _ <<< "${size#*$'\n'}"
639+
use=$(df --human-readable "/pgbackrest/${volume}")
640+
read -r _ _ _ _ use _ <<< "${use#*$'\n'}"
639641
sizeInt="${size//M/}"
640642
# Use the sed punctuation class, because the shell will not accept the percent sign in an expansion.
641-
useInt=$(echo $use | sed 's/[[:punct:]]//g')
643+
useInt=${use//[[:punct:]]/}
642644
triggerExpansion="$((useInt > 75))"
643-
if [ $triggerExpansion -eq 1 ]; then
645+
if [[ ${triggerExpansion} -eq 1 ]]; then
644646
newSize="$(((sizeInt / 2)+sizeInt))"
645647
newSizeMi="${newSize}Mi"
646-
d='[{"op": "add", "path": "/metadata/annotations/suggested-'"${volume}"'-pvc-size", "value": "'"$newSizeMi"'"}]'
647-
curl --cacert ${CACERT} --header "Authorization: Bearer ${TOKEN}" -XPATCH "${APISERVER}/api/v1/namespaces/${NAMESPACE}/pods/${HOSTNAME}?fieldManager=kubectl-annotate" -H "Content-Type: application/json-patch+json" --data "$d"
648+
d='[{"op": "add", "path": "/metadata/annotations/suggested-'"${volume}"'-pvc-size", "value": "'"${newSizeMi}"'"}]'
649+
curl --cacert "${CACERT}" --header "Authorization: Bearer ${TOKEN}" -XPATCH "${APISERVER}/api/v1/namespaces/${NAMESPACE}/pods/${HOSTNAME}?fieldManager=kubectl-annotate" -H "Content-Type: application/json-patch+json" --data "${d}"
648650
fi
649651
}
650652
@@ -667,22 +669,22 @@ until read -r -t 5 -u "${fd}"; do
667669
fi
668670
669671
# manage autogrow annotation for the repo1 volume, if it exists
670-
if [ -d /pgbackrest/repo1 ]; then
672+
if [[ -d /pgbackrest/repo1 ]]; then
671673
manageAutogrowAnnotation "repo1"
672674
fi
673675
674676
# manage autogrow annotation for the repo2 volume, if it exists
675-
if [ -d /pgbackrest/repo2 ]; then
677+
if [[ -d /pgbackrest/repo2 ]]; then
676678
manageAutogrowAnnotation "repo2"
677679
fi
678680
679681
# manage autogrow annotation for the repo3 volume, if it exists
680-
if [ -d /pgbackrest/repo3 ]; then
682+
if [[ -d /pgbackrest/repo3 ]]; then
681683
manageAutogrowAnnotation "repo3"
682684
fi
683685
684686
# manage autogrow annotation for the repo4 volume, if it exists
685-
if [ -d /pgbackrest/repo4 ]; then
687+
if [[ -d /pgbackrest/repo4 ]]; then
686688
manageAutogrowAnnotation "repo4"
687689
fi
688690

internal/pgbackrest/reconcile_test.go

Lines changed: 42 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -737,26 +737,28 @@ func TestAddServerToInstancePod(t *testing.T) {
737737
# Parameters for curl when managing autogrow annotation.
738738
APISERVER="https://kubernetes.default.svc"
739739
SERVICEACCOUNT="/var/run/secrets/kubernetes.io/serviceaccount"
740-
NAMESPACE=$(cat ${SERVICEACCOUNT}/namespace)
741-
TOKEN=$(cat ${SERVICEACCOUNT}/token)
740+
NAMESPACE=$(cat "${SERVICEACCOUNT}"/namespace)
741+
TOKEN=$(cat "${SERVICEACCOUNT}"/token)
742742
CACERT=${SERVICEACCOUNT}/ca.crt
743743
744744
# Manage autogrow annotation.
745745
# Return size in Mebibytes.
746746
manageAutogrowAnnotation() {
747747
local volume=$1
748748
749-
size=$(df --human-readable --block-size=M /pgbackrest/"${volume}" | awk 'FNR == 2 {print $2}')
750-
use=$(df --human-readable /pgbackrest/"${volume}" | awk 'FNR == 2 {print $5}')
749+
size=$(df --human-readable --block-size=M "/pgbackrest/${volume}")
750+
read -r _ size _ <<< "${size#*$'\n'}"
751+
use=$(df --human-readable "/pgbackrest/${volume}")
752+
read -r _ _ _ _ use _ <<< "${use#*$'\n'}"
751753
sizeInt="${size//M/}"
752754
# Use the sed punctuation class, because the shell will not accept the percent sign in an expansion.
753-
useInt=$(echo $use | sed 's/[[:punct:]]//g')
755+
useInt=${use//[[:punct:]]/}
754756
triggerExpansion="$((useInt > 75))"
755-
if [ $triggerExpansion -eq 1 ]; then
757+
if [[ ${triggerExpansion} -eq 1 ]]; then
756758
newSize="$(((sizeInt / 2)+sizeInt))"
757759
newSizeMi="${newSize}Mi"
758-
d='[{"op": "add", "path": "/metadata/annotations/suggested-'"${volume}"'-pvc-size", "value": "'"$newSizeMi"'"}]'
759-
curl --cacert ${CACERT} --header "Authorization: Bearer ${TOKEN}" -XPATCH "${APISERVER}/api/v1/namespaces/${NAMESPACE}/pods/${HOSTNAME}?fieldManager=kubectl-annotate" -H "Content-Type: application/json-patch+json" --data "$d"
760+
d='[{"op": "add", "path": "/metadata/annotations/suggested-'"${volume}"'-pvc-size", "value": "'"${newSizeMi}"'"}]'
761+
curl --cacert "${CACERT}" --header "Authorization: Bearer ${TOKEN}" -XPATCH "${APISERVER}/api/v1/namespaces/${NAMESPACE}/pods/${HOSTNAME}?fieldManager=kubectl-annotate" -H "Content-Type: application/json-patch+json" --data "${d}"
760762
fi
761763
}
762764
@@ -779,22 +781,22 @@ func TestAddServerToInstancePod(t *testing.T) {
779781
fi
780782
781783
# manage autogrow annotation for the repo1 volume, if it exists
782-
if [ -d /pgbackrest/repo1 ]; then
784+
if [[ -d /pgbackrest/repo1 ]]; then
783785
manageAutogrowAnnotation "repo1"
784786
fi
785787
786788
# manage autogrow annotation for the repo2 volume, if it exists
787-
if [ -d /pgbackrest/repo2 ]; then
789+
if [[ -d /pgbackrest/repo2 ]]; then
788790
manageAutogrowAnnotation "repo2"
789791
fi
790792
791793
# manage autogrow annotation for the repo3 volume, if it exists
792-
if [ -d /pgbackrest/repo3 ]; then
794+
if [[ -d /pgbackrest/repo3 ]]; then
793795
manageAutogrowAnnotation "repo3"
794796
fi
795797
796798
# manage autogrow annotation for the repo4 volume, if it exists
797-
if [ -d /pgbackrest/repo4 ]; then
799+
if [[ -d /pgbackrest/repo4 ]]; then
798800
manageAutogrowAnnotation "repo4"
799801
fi
800802
@@ -913,26 +915,28 @@ func TestAddServerToInstancePod(t *testing.T) {
913915
# Parameters for curl when managing autogrow annotation.
914916
APISERVER="https://kubernetes.default.svc"
915917
SERVICEACCOUNT="/var/run/secrets/kubernetes.io/serviceaccount"
916-
NAMESPACE=$(cat ${SERVICEACCOUNT}/namespace)
917-
TOKEN=$(cat ${SERVICEACCOUNT}/token)
918+
NAMESPACE=$(cat "${SERVICEACCOUNT}"/namespace)
919+
TOKEN=$(cat "${SERVICEACCOUNT}"/token)
918920
CACERT=${SERVICEACCOUNT}/ca.crt
919921
920922
# Manage autogrow annotation.
921923
# Return size in Mebibytes.
922924
manageAutogrowAnnotation() {
923925
local volume=$1
924926
925-
size=$(df --human-readable --block-size=M /pgbackrest/"${volume}" | awk 'FNR == 2 {print $2}')
926-
use=$(df --human-readable /pgbackrest/"${volume}" | awk 'FNR == 2 {print $5}')
927+
size=$(df --human-readable --block-size=M "/pgbackrest/${volume}")
928+
read -r _ size _ <<< "${size#*$'\n'}"
929+
use=$(df --human-readable "/pgbackrest/${volume}")
930+
read -r _ _ _ _ use _ <<< "${use#*$'\n'}"
927931
sizeInt="${size//M/}"
928932
# Use the sed punctuation class, because the shell will not accept the percent sign in an expansion.
929-
useInt=$(echo $use | sed 's/[[:punct:]]//g')
933+
useInt=${use//[[:punct:]]/}
930934
triggerExpansion="$((useInt > 75))"
931-
if [ $triggerExpansion -eq 1 ]; then
935+
if [[ ${triggerExpansion} -eq 1 ]]; then
932936
newSize="$(((sizeInt / 2)+sizeInt))"
933937
newSizeMi="${newSize}Mi"
934-
d='[{"op": "add", "path": "/metadata/annotations/suggested-'"${volume}"'-pvc-size", "value": "'"$newSizeMi"'"}]'
935-
curl --cacert ${CACERT} --header "Authorization: Bearer ${TOKEN}" -XPATCH "${APISERVER}/api/v1/namespaces/${NAMESPACE}/pods/${HOSTNAME}?fieldManager=kubectl-annotate" -H "Content-Type: application/json-patch+json" --data "$d"
938+
d='[{"op": "add", "path": "/metadata/annotations/suggested-'"${volume}"'-pvc-size", "value": "'"${newSizeMi}"'"}]'
939+
curl --cacert "${CACERT}" --header "Authorization: Bearer ${TOKEN}" -XPATCH "${APISERVER}/api/v1/namespaces/${NAMESPACE}/pods/${HOSTNAME}?fieldManager=kubectl-annotate" -H "Content-Type: application/json-patch+json" --data "${d}"
936940
fi
937941
}
938942
@@ -955,22 +959,22 @@ func TestAddServerToInstancePod(t *testing.T) {
955959
fi
956960
957961
# manage autogrow annotation for the repo1 volume, if it exists
958-
if [ -d /pgbackrest/repo1 ]; then
962+
if [[ -d /pgbackrest/repo1 ]]; then
959963
manageAutogrowAnnotation "repo1"
960964
fi
961965
962966
# manage autogrow annotation for the repo2 volume, if it exists
963-
if [ -d /pgbackrest/repo2 ]; then
967+
if [[ -d /pgbackrest/repo2 ]]; then
964968
manageAutogrowAnnotation "repo2"
965969
fi
966970
967971
# manage autogrow annotation for the repo3 volume, if it exists
968-
if [ -d /pgbackrest/repo3 ]; then
972+
if [[ -d /pgbackrest/repo3 ]]; then
969973
manageAutogrowAnnotation "repo3"
970974
fi
971975
972976
# manage autogrow annotation for the repo4 volume, if it exists
973-
if [ -d /pgbackrest/repo4 ]; then
977+
if [[ -d /pgbackrest/repo4 ]]; then
974978
manageAutogrowAnnotation "repo4"
975979
fi
976980
@@ -1078,26 +1082,28 @@ func TestAddServerToRepoPod(t *testing.T) {
10781082
# Parameters for curl when managing autogrow annotation.
10791083
APISERVER="https://kubernetes.default.svc"
10801084
SERVICEACCOUNT="/var/run/secrets/kubernetes.io/serviceaccount"
1081-
NAMESPACE=$(cat ${SERVICEACCOUNT}/namespace)
1082-
TOKEN=$(cat ${SERVICEACCOUNT}/token)
1085+
NAMESPACE=$(cat "${SERVICEACCOUNT}"/namespace)
1086+
TOKEN=$(cat "${SERVICEACCOUNT}"/token)
10831087
CACERT=${SERVICEACCOUNT}/ca.crt
10841088
10851089
# Manage autogrow annotation.
10861090
# Return size in Mebibytes.
10871091
manageAutogrowAnnotation() {
10881092
local volume=$1
10891093
1090-
size=$(df --human-readable --block-size=M /pgbackrest/"${volume}" | awk 'FNR == 2 {print $2}')
1091-
use=$(df --human-readable /pgbackrest/"${volume}" | awk 'FNR == 2 {print $5}')
1094+
size=$(df --human-readable --block-size=M "/pgbackrest/${volume}")
1095+
read -r _ size _ <<< "${size#*$'\n'}"
1096+
use=$(df --human-readable "/pgbackrest/${volume}")
1097+
read -r _ _ _ _ use _ <<< "${use#*$'\n'}"
10921098
sizeInt="${size//M/}"
10931099
# Use the sed punctuation class, because the shell will not accept the percent sign in an expansion.
1094-
useInt=$(echo $use | sed 's/[[:punct:]]//g')
1100+
useInt=${use//[[:punct:]]/}
10951101
triggerExpansion="$((useInt > 75))"
1096-
if [ $triggerExpansion -eq 1 ]; then
1102+
if [[ ${triggerExpansion} -eq 1 ]]; then
10971103
newSize="$(((sizeInt / 2)+sizeInt))"
10981104
newSizeMi="${newSize}Mi"
1099-
d='[{"op": "add", "path": "/metadata/annotations/suggested-'"${volume}"'-pvc-size", "value": "'"$newSizeMi"'"}]'
1100-
curl --cacert ${CACERT} --header "Authorization: Bearer ${TOKEN}" -XPATCH "${APISERVER}/api/v1/namespaces/${NAMESPACE}/pods/${HOSTNAME}?fieldManager=kubectl-annotate" -H "Content-Type: application/json-patch+json" --data "$d"
1105+
d='[{"op": "add", "path": "/metadata/annotations/suggested-'"${volume}"'-pvc-size", "value": "'"${newSizeMi}"'"}]'
1106+
curl --cacert "${CACERT}" --header "Authorization: Bearer ${TOKEN}" -XPATCH "${APISERVER}/api/v1/namespaces/${NAMESPACE}/pods/${HOSTNAME}?fieldManager=kubectl-annotate" -H "Content-Type: application/json-patch+json" --data "${d}"
11011107
fi
11021108
}
11031109
@@ -1120,22 +1126,22 @@ func TestAddServerToRepoPod(t *testing.T) {
11201126
fi
11211127
11221128
# manage autogrow annotation for the repo1 volume, if it exists
1123-
if [ -d /pgbackrest/repo1 ]; then
1129+
if [[ -d /pgbackrest/repo1 ]]; then
11241130
manageAutogrowAnnotation "repo1"
11251131
fi
11261132
11271133
# manage autogrow annotation for the repo2 volume, if it exists
1128-
if [ -d /pgbackrest/repo2 ]; then
1134+
if [[ -d /pgbackrest/repo2 ]]; then
11291135
manageAutogrowAnnotation "repo2"
11301136
fi
11311137
11321138
# manage autogrow annotation for the repo3 volume, if it exists
1133-
if [ -d /pgbackrest/repo3 ]; then
1139+
if [[ -d /pgbackrest/repo3 ]]; then
11341140
manageAutogrowAnnotation "repo3"
11351141
fi
11361142
11371143
# manage autogrow annotation for the repo4 volume, if it exists
1138-
if [ -d /pgbackrest/repo4 ]; then
1144+
if [[ -d /pgbackrest/repo4 ]]; then
11391145
manageAutogrowAnnotation "repo4"
11401146
fi
11411147

0 commit comments

Comments
 (0)