Skip to content

Commit 9c42100

Browse files
authored
Merge branch 'main' into K8SPSMDB-1552
2 parents fd11062 + 3b79001 commit 9c42100

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1424
-337
lines changed

Jenkinsfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void pushLogFile(String FILE_NAME) {
9292
def LOG_FILE_PATH="e2e-tests/logs/${FILE_NAME}.log"
9393
def LOG_FILE_NAME="${FILE_NAME}.log"
9494
echo "Push logfile $LOG_FILE_NAME file to S3!"
95-
withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', accessKeyVariable: 'AWS_ACCESS_KEY_ID', credentialsId: 'AMI/OVF', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) {
95+
withCredentials([aws(credentialsId: 'AMI/OVF', accessKeyVariable: 'AWS_ACCESS_KEY_ID', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY')]) {
9696
sh """
9797
S3_PATH=s3://percona-jenkins-artifactory-public/\$JOB_NAME/\$(git rev-parse --short HEAD)
9898
aws s3 ls \$S3_PATH/${LOG_FILE_NAME} || :
@@ -104,7 +104,7 @@ void pushLogFile(String FILE_NAME) {
104104
void pushArtifactFile(String FILE_NAME) {
105105
echo "Push $FILE_NAME file to S3!"
106106

107-
withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', accessKeyVariable: 'AWS_ACCESS_KEY_ID', credentialsId: 'AMI/OVF', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) {
107+
withCredentials([aws(credentialsId: 'AMI/OVF', accessKeyVariable: 'AWS_ACCESS_KEY_ID', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY')]) {
108108
sh """
109109
touch ${FILE_NAME}
110110
S3_PATH=s3://percona-jenkins-artifactory/\$JOB_NAME/\$(git rev-parse --short HEAD)
@@ -129,7 +129,7 @@ void initTests() {
129129
void markPassedTests() {
130130
echo "Marking passed tests in the tests map!"
131131

132-
withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', accessKeyVariable: 'AWS_ACCESS_KEY_ID', credentialsId: 'AMI/OVF', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) {
132+
withCredentials([aws(credentialsId: 'AMI/OVF', accessKeyVariable: 'AWS_ACCESS_KEY_ID', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY')]) {
133133
sh """
134134
aws s3 ls "s3://percona-jenkins-artifactory/${JOB_NAME}/${env.GIT_SHORT_COMMIT}/" || :
135135
"""
@@ -290,9 +290,9 @@ void prepareNode() {
290290
sudo curl -sLo /usr/local/bin/kubectl https://dl.k8s.io/release/\$(curl -Ls https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl && sudo chmod +x /usr/local/bin/kubectl
291291
kubectl version --client --output=yaml
292292
293-
curl -fsSL https://get.helm.sh/helm-v3.18.3-linux-amd64.tar.gz | sudo tar -C /usr/local/bin --strip-components 1 -xzf - linux-amd64/helm
293+
curl -fsSL https://get.helm.sh/helm-v3.19.0-linux-amd64.tar.gz | sudo tar -C /usr/local/bin --strip-components 1 -xzf - linux-amd64/helm
294294
295-
sudo curl -fsSL https://github.com/mikefarah/yq/releases/download/v4.44.1/yq_linux_amd64 -o /usr/local/bin/yq && sudo chmod +x /usr/local/bin/yq
295+
sudo curl -fsSL https://github.com/mikefarah/yq/releases/download/v4.48.1/yq_linux_amd64 -o /usr/local/bin/yq && sudo chmod +x /usr/local/bin/yq
296296
sudo curl -fsSL https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux64 -o /usr/local/bin/jq && sudo chmod +x /usr/local/bin/jq
297297
298298
sudo tee /etc/yum.repos.d/google-cloud-sdk.repo << EOF
@@ -490,7 +490,7 @@ pipeline {
490490
mkdir -p $(dirname ${docker_tag_file})
491491
echo ${DOCKER_TAG} > "${docker_tag_file}"
492492
sg docker -c "
493-
docker login -u '${USER}' -p '${PASS}'
493+
echo '\$PASS' | docker login -u '\$USER' --password-stdin
494494
export RELEASE=0
495495
export IMAGE=\$DOCKER_TAG
496496
./e2e-tests/build
@@ -650,7 +650,7 @@ pipeline {
650650
}
651651
}
652652
makeReport()
653-
step([$class: 'JUnitResultArchiver', testResults: '*.xml', healthScaleFactor: 1.0])
653+
junit testResults: '*.xml', healthScaleFactor: 1.0
654654
archiveArtifacts '*.xml'
655655

656656
unstash 'IMAGE'

build/pbm-entry.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ if [[ -z ${PBM_AGENT_TLS_ENABLED} ]] || [[ ${PBM_AGENT_TLS_ENABLED} == "true" ]]
77
fi
88
fi
99

10+
# shellcheck disable=SC1091
11+
test -e /opt/percona/pbm-hookscript/hook.sh && source /opt/percona/pbm-hookscript/hook.sh
12+
1013
exec "$@"

build/ps-entry.sh

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ _mongod_hack_have_arg() {
6868
local arg
6969
for arg; do
7070
case "$arg" in
71-
"$checkArg" | "$checkArg"=*)
72-
return 0
73-
;;
71+
"$checkArg" | "$checkArg"=*)
72+
return 0
73+
;;
7474
esac
7575
done
7676
return 1
@@ -83,14 +83,14 @@ _mongod_hack_get_arg_val() {
8383
local arg="$1"
8484
shift
8585
case "$arg" in
86-
"$checkArg")
87-
echo "$1"
88-
return 0
89-
;;
90-
"$checkArg"=*)
91-
echo "${arg#"$checkArg"=}"
92-
return 0
93-
;;
86+
"$checkArg")
87+
echo "$1"
88+
return 0
89+
;;
90+
"$checkArg"=*)
91+
echo "${arg#"$checkArg"=}"
92+
return 0
93+
;;
9494
esac
9595
done
9696
return 1
@@ -131,14 +131,14 @@ _mongod_hack_ensure_no_arg_val() {
131131
local arg="$1"
132132
shift
133133
case "$arg" in
134-
"$ensureNoArg")
135-
shift # also skip the value
136-
continue
137-
;;
138-
"$ensureNoArg"=*)
139-
# value is already included
140-
continue
141-
;;
134+
"$ensureNoArg")
135+
shift # also skip the value
136+
continue
137+
;;
138+
"$ensureNoArg"=*)
139+
# value is already included
140+
continue
141+
;;
142142
esac
143143
mongodHackedArgs+=("$arg")
144144
done
@@ -174,7 +174,7 @@ _mongod_hack_rename_arg_save_val() {
174174
val="$1"
175175
shift
176176
continue
177-
elif [[ $arg =~ "$oldArg"=(.*) ]]; then
177+
elif [[ $arg =~ ^${oldArg}=(.*)$ ]]; then
178178
val=${BASH_REMATCH[1]}
179179
continue
180180
fi
@@ -282,10 +282,10 @@ if [ "$originalArgOne" = 'mongod' ]; then
282282
# if we've got any /docker-entrypoint-initdb.d/* files to parse later, we should initdb
283283
for f in /docker-entrypoint-initdb.d/*; do
284284
case "$f" in
285-
*.sh | *.js) # this should match the set of files we check for below
286-
shouldPerformInitdb="$f"
287-
break
288-
;;
285+
*.sh | *.js) # this should match the set of files we check for below
286+
shouldPerformInitdb="$f"
287+
break
288+
;;
289289
esac
290290
done
291291
fi
@@ -387,17 +387,17 @@ if [ "$originalArgOne" = 'mongod' ]; then
387387
echo
388388
for f in /docker-entrypoint-initdb.d/*; do
389389
case "$f" in
390-
*.sh)
391-
echo "$0: running $f"
392-
# shellcheck source=/dev/null
393-
. "$f"
394-
;;
395-
*.js)
396-
echo "$0: running $f"
397-
"${mongo[@]}" "$MONGO_INITDB_DATABASE" "$f"
398-
echo
399-
;;
400-
*) echo "$0: ignoring $f" ;;
390+
*.sh)
391+
echo "$0: running $f"
392+
# shellcheck source=/dev/null
393+
. "$f"
394+
;;
395+
*.js)
396+
echo "$0: running $f"
397+
"${mongo[@]}" "$MONGO_INITDB_DATABASE" "$f"
398+
echo
399+
;;
400+
*) echo "$0: ignoring $f" ;;
401401
esac
402402
echo
403403
done
@@ -509,5 +509,8 @@ fi
509509

510510
rm -f "$jsonConfigFile" "$tempConfigFile"
511511

512+
# shellcheck disable=SC1091
513+
test -e /opt/percona/hookscript/hook.sh && source /opt/percona/hookscript/hook.sh
514+
512515
set -o xtrace
513516
exec "$@"

config/crd/bases/psmdb.percona.com_perconaservermongodbs.yaml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,16 @@ spec:
163163
type: object
164164
enabled:
165165
type: boolean
166+
hookScript:
167+
properties:
168+
configMapRef:
169+
properties:
170+
name:
171+
type: string
172+
type: object
173+
script:
174+
type: string
175+
type: object
166176
image:
167177
type: string
168178
labels:
@@ -1895,6 +1905,16 @@ spec:
18951905
type: object
18961906
enabled:
18971907
type: boolean
1908+
hookScript:
1909+
properties:
1910+
configMapRef:
1911+
properties:
1912+
name:
1913+
type: string
1914+
type: object
1915+
script:
1916+
type: string
1917+
type: object
18981918
labels:
18991919
additionalProperties:
19001920
type: string
@@ -4499,6 +4519,16 @@ spec:
44994519
type: object
45004520
enabled:
45014521
type: boolean
4522+
hookScript:
4523+
properties:
4524+
configMapRef:
4525+
properties:
4526+
name:
4527+
type: string
4528+
type: object
4529+
script:
4530+
type: string
4531+
type: object
45024532
labels:
45034533
additionalProperties:
45044534
type: string
@@ -6693,6 +6723,16 @@ spec:
66936723
- enabled
66946724
- size
66956725
type: object
6726+
hookScript:
6727+
properties:
6728+
configMapRef:
6729+
properties:
6730+
name:
6731+
type: string
6732+
type: object
6733+
script:
6734+
type: string
6735+
type: object
66966736
hostAliases:
66976737
items:
66986738
properties:
@@ -7326,6 +7366,16 @@ spec:
73267366
type: object
73277367
enabled:
73287368
type: boolean
7369+
hookScript:
7370+
properties:
7371+
configMapRef:
7372+
properties:
7373+
name:
7374+
type: string
7375+
type: object
7376+
script:
7377+
type: string
7378+
type: object
73297379
labels:
73307380
additionalProperties:
73317381
type: string
@@ -12684,6 +12734,16 @@ spec:
1268412734
type: object
1268512735
enabled:
1268612736
type: boolean
12737+
hookScript:
12738+
properties:
12739+
configMapRef:
12740+
properties:
12741+
name:
12742+
type: string
12743+
type: object
12744+
script:
12745+
type: string
12746+
type: object
1268712747
labels:
1268812748
additionalProperties:
1268912749
type: string
@@ -15288,6 +15348,16 @@ spec:
1528815348
type: object
1528915349
enabled:
1529015350
type: boolean
15351+
hookScript:
15352+
properties:
15353+
configMapRef:
15354+
properties:
15355+
name:
15356+
type: string
15357+
type: object
15358+
script:
15359+
type: string
15360+
type: object
1529115361
labels:
1529215362
additionalProperties:
1529315363
type: string
@@ -17482,6 +17552,16 @@ spec:
1748217552
- enabled
1748317553
- size
1748417554
type: object
17555+
hookScript:
17556+
properties:
17557+
configMapRef:
17558+
properties:
17559+
name:
17560+
type: string
17561+
type: object
17562+
script:
17563+
type: string
17564+
type: object
1748517565
hostAliases:
1748617566
items:
1748717567
properties:
@@ -18115,6 +18195,16 @@ spec:
1811518195
type: object
1811618196
enabled:
1811718197
type: boolean
18198+
hookScript:
18199+
properties:
18200+
configMapRef:
18201+
properties:
18202+
name:
18203+
type: string
18204+
type: object
18205+
script:
18206+
type: string
18207+
type: object
1811818208
labels:
1811918209
additionalProperties:
1812018210
type: string
@@ -23156,6 +23246,16 @@ spec:
2315623246
type:
2315723247
type: string
2315823248
type: object
23249+
hookScript:
23250+
properties:
23251+
configMapRef:
23252+
properties:
23253+
name:
23254+
type: string
23255+
type: object
23256+
script:
23257+
type: string
23258+
type: object
2315923259
hostAliases:
2316023260
items:
2316123261
properties:

0 commit comments

Comments
 (0)