Skip to content

Commit f59a19f

Browse files
authored
Merge branch 'main' into K8SPS-413
2 parents f663c17 + 550a4bd commit f59a19f

File tree

8 files changed

+105
-18
lines changed

8 files changed

+105
-18
lines changed

Jenkinsfile

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,66 @@ pipeline {
628628
clusterRunner('cluster7')
629629
}
630630
}
631+
stage('cluster8') {
632+
when {
633+
expression {
634+
isPRJob && needToRunTests
635+
}
636+
}
637+
agent {
638+
label 'docker-x64-min'
639+
}
640+
steps {
641+
prepareNode()
642+
unstash "sourceFILES"
643+
clusterRunner('cluster8')
644+
}
645+
}
646+
stage('cluster9') {
647+
when {
648+
expression {
649+
isPRJob && needToRunTests
650+
}
651+
}
652+
agent {
653+
label 'docker-x64-min'
654+
}
655+
steps {
656+
prepareNode()
657+
unstash "sourceFILES"
658+
clusterRunner('cluster9')
659+
}
660+
}
661+
stage('cluster10') {
662+
when {
663+
expression {
664+
isPRJob && needToRunTests
665+
}
666+
}
667+
agent {
668+
label 'docker-x64-min'
669+
}
670+
steps {
671+
prepareNode()
672+
unstash "sourceFILES"
673+
clusterRunner('cluster10')
674+
}
675+
}
676+
stage('cluster11') {
677+
when {
678+
expression {
679+
isPRJob && needToRunTests
680+
}
681+
}
682+
agent {
683+
label 'docker-x64-min'
684+
}
685+
steps {
686+
prepareNode()
687+
unstash "sourceFILES"
688+
clusterRunner('cluster11')
689+
}
690+
}
631691
}
632692
}
633693
}

build/heartbeat-entrypoint.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ for i in {1..5}; do
3030
fi
3131
done
3232

33+
# If password contains commas they must be escaped with a backslash: “exam,ple” according https://docs.percona.com/percona-toolkit/pt-heartbeat.html
34+
ESCAPED_HEARTBEAT_PASSWORD="${HEARTBEAT_PASSWORD//,/\\,}"
35+
3336
HEARTBEAT_USER='heartbeat'
3437
echo "[INFO] pt-heartbeat --update --replace --fail-successive-errors 20 --check-read-only --create-table --database sys_operator \
3538
--table heartbeat --user ${HEARTBEAT_USER} --password XXXX --port ${MYSQL_ADMIN_PORT}"
@@ -43,5 +46,5 @@ pt-heartbeat \
4346
--database sys_operator \
4447
--table heartbeat \
4548
--user "${HEARTBEAT_USER}" \
46-
--password "${HEARTBEAT_PASSWORD}" \
49+
--password "${ESCAPED_HEARTBEAT_PASSWORD}" \
4750
--port "${MYSQL_ADMIN_PORT}"

build/ps-entrypoint.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ file_env() {
4242
fi
4343
export "$var"="$val"
4444
unset "$fileVar"
45-
set -o xtrace
4645
}
4746

4847
# usage: process_init_file FILENAME MYSQLCOMMAND...
@@ -294,7 +293,6 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
294293
MYSQL_ROOT_PASSWORD="$(pwmake 128)"
295294
echo "GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD"
296295
fi
297-
set -x
298296

299297
rootCreate=
300298
# default root to listen for connections from anywhere
@@ -366,7 +364,6 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
366364
FLUSH PRIVILEGES ;
367365
EOSQL
368366

369-
{ set +x; } 2>/dev/null
370367
if [ -n "$MYSQL_ROOT_PASSWORD" ]; then
371368
mysql+=(-p"${MYSQL_ROOT_PASSWORD}")
372369
fi

deploy/cr.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,15 @@ spec:
157157
# path: /data
158158
# type: Directory
159159
persistentVolumeClaim:
160+
# dataSource:
161+
# apiGroup: ""
162+
# kind: PersistentVolumeClaim
163+
# name: source-pvc
164+
# dataSourceRef:
165+
# apiGroup: ""
166+
# kind: PersistentVolumeClaim
167+
# name: source-pvc
168+
# namespace: default
160169
# storageClassName: standard
161170
# accessModes: [ "ReadWriteOnce" ]
162171
resources:

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ require (
2626
golang.org/x/sync v0.16.0
2727
golang.org/x/text v0.28.0
2828
google.golang.org/grpc v1.74.2
29-
k8s.io/api v0.33.3
30-
k8s.io/apiextensions-apiserver v0.33.3
31-
k8s.io/apimachinery v0.33.3
32-
k8s.io/client-go v0.33.3
29+
k8s.io/api v0.33.4
30+
k8s.io/apiextensions-apiserver v0.33.4
31+
k8s.io/apimachinery v0.33.4
32+
k8s.io/client-go v0.33.4
3333
k8s.io/utils v0.0.0-20250502105355-0f33e8f1c979
3434
sigs.k8s.io/controller-runtime v0.21.0
3535
)

go.sum

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -329,14 +329,14 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
329329
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
330330
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
331331
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
332-
k8s.io/api v0.33.3 h1:SRd5t//hhkI1buzxb288fy2xvjubstenEKL9K51KBI8=
333-
k8s.io/api v0.33.3/go.mod h1:01Y/iLUjNBM3TAvypct7DIj0M0NIZc+PzAHCIo0CYGE=
334-
k8s.io/apiextensions-apiserver v0.33.3 h1:qmOcAHN6DjfD0v9kxL5udB27SRP6SG/MTopmge3MwEs=
335-
k8s.io/apiextensions-apiserver v0.33.3/go.mod h1:oROuctgo27mUsyp9+Obahos6CWcMISSAPzQ77CAQGz8=
336-
k8s.io/apimachinery v0.33.3 h1:4ZSrmNa0c/ZpZJhAgRdcsFcZOw1PQU1bALVQ0B3I5LA=
337-
k8s.io/apimachinery v0.33.3/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM=
338-
k8s.io/client-go v0.33.3 h1:M5AfDnKfYmVJif92ngN532gFqakcGi6RvaOF16efrpA=
339-
k8s.io/client-go v0.33.3/go.mod h1:luqKBQggEf3shbxHY4uVENAxrDISLOarxpTKMiUuujg=
332+
k8s.io/api v0.33.4 h1:oTzrFVNPXBjMu0IlpA2eDDIU49jsuEorGHB4cvKupkk=
333+
k8s.io/api v0.33.4/go.mod h1:VHQZ4cuxQ9sCUMESJV5+Fe8bGnqAARZ08tSTdHWfeAc=
334+
k8s.io/apiextensions-apiserver v0.33.4 h1:rtq5SeXiDbXmSwxsF0MLe2Mtv3SwprA6wp+5qh/CrOU=
335+
k8s.io/apiextensions-apiserver v0.33.4/go.mod h1:mWXcZQkQV1GQyxeIjYApuqsn/081hhXPZwZ2URuJeSs=
336+
k8s.io/apimachinery v0.33.4 h1:SOf/JW33TP0eppJMkIgQ+L6atlDiP/090oaX0y9pd9s=
337+
k8s.io/apimachinery v0.33.4/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM=
338+
k8s.io/client-go v0.33.4 h1:TNH+CSu8EmXfitntjUPwaKVPN0AYMbc9F1bBS8/ABpw=
339+
k8s.io/client-go v0.33.4/go.mod h1:LsA0+hBG2DPwovjd931L/AoaezMPX9CmBgyVyBZmbCY=
340340
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
341341
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
342342
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff h1:/usPimJzUKKu+m+TE36gUyGcf03XZEP0ZIKgKj35LS4=

pkg/k8s/pvc.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ func PVC(name string, spec *apiv1alpha1.VolumeSpec) corev1.PersistentVolumeClaim
1616
StorageClassName: spec.PersistentVolumeClaim.StorageClassName,
1717
AccessModes: spec.PersistentVolumeClaim.AccessModes,
1818
Resources: spec.PersistentVolumeClaim.Resources,
19+
DataSource: spec.PersistentVolumeClaim.DataSource,
20+
DataSourceRef: spec.PersistentVolumeClaim.DataSourceRef,
1921
},
2022
}
2123
}

pkg/k8s/pvc_test.go

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ package k8s
33
import (
44
"testing"
55

6-
apiv1alpha1 "github.com/percona/percona-server-mysql-operator/api/v1alpha1"
7-
86
"github.com/stretchr/testify/assert"
97
corev1 "k8s.io/api/core/v1"
108
"k8s.io/apimachinery/pkg/api/resource"
9+
"k8s.io/utils/ptr"
10+
11+
apiv1alpha1 "github.com/percona/percona-server-mysql-operator/api/v1alpha1"
1112
)
1213

1314
func TestPVC(t *testing.T) {
@@ -16,6 +17,17 @@ func TestPVC(t *testing.T) {
1617
requests := corev1.ResourceList{
1718
corev1.ResourceStorage: resource.MustParse("2Gi"),
1819
}
20+
dataSource := &corev1.TypedLocalObjectReference{
21+
APIGroup: ptr.To("some-api-group"),
22+
Kind: "some-kind",
23+
Name: "some-name",
24+
}
25+
dataSourceRef := &corev1.TypedObjectReference{
26+
APIGroup: ptr.To("some-api-group-2"),
27+
Kind: "some-kind-2",
28+
Name: "some-name-2",
29+
Namespace: ptr.To("namespace"),
30+
}
1931

2032
spec := &apiv1alpha1.VolumeSpec{
2133
PersistentVolumeClaim: &corev1.PersistentVolumeClaimSpec{
@@ -24,6 +36,8 @@ func TestPVC(t *testing.T) {
2436
Resources: corev1.VolumeResourceRequirements{
2537
Requests: requests,
2638
},
39+
DataSource: dataSource,
40+
DataSourceRef: dataSourceRef,
2741
},
2842
}
2943

@@ -36,4 +50,6 @@ func TestPVC(t *testing.T) {
3650
assert.Equal(t, storageClassName, *pvc.Spec.StorageClassName)
3751
assert.Equal(t, accessModes, pvc.Spec.AccessModes)
3852
assert.Equal(t, requests, pvc.Spec.Resources.Requests)
53+
assert.Equal(t, dataSource, pvc.Spec.DataSource)
54+
assert.Equal(t, dataSourceRef, pvc.Spec.DataSourceRef)
3955
}

0 commit comments

Comments
 (0)