@@ -85,39 +85,39 @@ deploy_operator() {
85
85
}
86
86
87
87
upgrade_operator_image () {
88
- local image=$1
88
+ local image=$1
89
89
90
- kubectl -n ${OPERATOR_NS:- $NAMESPACE } set image deployment/percona-server-mysql-operator manager=${image}
90
+ kubectl -n ${OPERATOR_NS:- $NAMESPACE } set image deployment/percona-server-mysql-operator manager=${image}
91
91
}
92
92
93
93
deploy_operator_gh () {
94
- local git_tag=$1
94
+ local git_tag=$1
95
95
96
- echo " applying ${git_tag} /deploy/crd.yaml"
97
- kubectl apply \
98
- --server-side \
99
- --force-conflicts \
100
- -f " https://raw.githubusercontent.com/percona/percona-server-mysql-operator/${git_tag} /deploy/crd.yaml"
96
+ echo " applying ${git_tag} /deploy/crd.yaml"
97
+ kubectl apply \
98
+ --server-side \
99
+ --force-conflicts \
100
+ -f " https://raw.githubusercontent.com/percona/percona-server-mysql-operator/${git_tag} /deploy/crd.yaml"
101
101
102
- local rbac=" rbac"
103
- local operator=" operator"
104
- if [ -n " ${OPERATOR_NS} " ]; then
105
- rbac=" cw-rbac"
106
- operator=" cw-operator"
102
+ local rbac=" rbac"
103
+ local operator=" operator"
104
+ if [ -n " ${OPERATOR_NS} " ]; then
105
+ rbac=" cw-rbac"
106
+ operator=" cw-operator"
107
107
108
- create_namespace " ${OPERATOR_NS} "
109
- fi
108
+ create_namespace " ${OPERATOR_NS} "
109
+ fi
110
110
111
- echo " applying ${git_tag} /deploy/${rbac} .yaml"
111
+ echo " applying ${git_tag} /deploy/${rbac} .yaml"
112
112
kubectl apply \
113
- -n " ${OPERATOR_NS:- $NAMESPACE } " \
114
- -f " https://raw.githubusercontent.com/percona/percona-server-mysql-operator/${git_tag} /deploy/${rbac} .yaml"
113
+ -n " ${OPERATOR_NS:- $NAMESPACE } " \
114
+ -f " https://raw.githubusercontent.com/percona/percona-server-mysql-operator/${git_tag} /deploy/${rbac} .yaml"
115
115
116
- echo " applying ${git_tag} /deploy/${operator} .yaml"
117
- curl -s " https://raw.githubusercontent.com/percona/percona-server-mysql-operator/${git_tag} /deploy/${operator} .yaml" \
118
- | yq eval ' (select(documentIndex==1).spec.template.spec.containers[] | select(.name=="manager").env[] | select(.name=="DISABLE_TELEMETRY").value) = "true"' \
119
- | yq eval ' (select(documentIndex==1).spec.template.spec.containers[] | select(.name=="manager").env[] | select(.name=="LOG_LEVEL").value) = "DEBUG"' \
120
- | kubectl -n " ${OPERATOR_NS:- $NAMESPACE } " apply -f -
116
+ echo " applying ${git_tag} /deploy/${operator} .yaml"
117
+ curl -s " https://raw.githubusercontent.com/percona/percona-server-mysql-operator/${git_tag} /deploy/${operator} .yaml" \
118
+ | yq eval ' (select(documentIndex==1).spec.template.spec.containers[] | select(.name=="manager").env[] | select(.name=="DISABLE_TELEMETRY").value) = "true"' \
119
+ | yq eval ' (select(documentIndex==1).spec.template.spec.containers[] | select(.name=="manager").env[] | select(.name=="LOG_LEVEL").value) = "DEBUG"' \
120
+ | kubectl -n " ${OPERATOR_NS:- $NAMESPACE } " apply -f -
121
121
}
122
122
123
123
destroy_operator () {
@@ -369,20 +369,20 @@ get_operator_pod() {
369
369
}
370
370
371
371
get_operator_image () {
372
- kubectl get pods -n " ${OPERATOR_NS:- $NAMESPACE } " \
373
- --selector=app.kubernetes.io/name=percona-server-mysql-operator \
374
- -o ' jsonpath={.items[].spec.containers[].image}'
372
+ kubectl get pods -n " ${OPERATOR_NS:- $NAMESPACE } " \
373
+ --selector=app.kubernetes.io/name=percona-server-mysql-operator \
374
+ -o ' jsonpath={.items[].spec.containers[].image}'
375
375
}
376
376
377
377
get_cr () {
378
378
local name_suffix=$1
379
- local image_mysql=${2:- ${IMAGE_MYSQL} }
380
- local image_backup=${3:- ${IMAGE_BACKUP} }
381
- local image_orchestrator=${4:- ${IMAGE_ORCHESTRATOR} }
382
- local image_router=${5:- ${IMAGE_ROUTER} }
383
- local image_toolkit=${6:- ${IMAGE_TOOLKIT} }
384
- local image_haproxy=${7:- ${IMAGE_HAPROXY} }
385
- local image_pmm_client=${8:- ${IMAGE_PMM_CLIENT} }
379
+ local image_mysql=${2:- ${IMAGE_MYSQL} }
380
+ local image_backup=${3:- ${IMAGE_BACKUP} }
381
+ local image_orchestrator=${4:- ${IMAGE_ORCHESTRATOR} }
382
+ local image_router=${5:- ${IMAGE_ROUTER} }
383
+ local image_toolkit=${6:- ${IMAGE_TOOLKIT} }
384
+ local image_haproxy=${7:- ${IMAGE_HAPROXY} }
385
+ local image_pmm_client=${8:- ${IMAGE_PMM_CLIENT} }
386
386
387
387
yq eval " $( printf ' .metadata.name="%s"' " ${test_name}${name_suffix: +-$name_suffix } " ) " " ${DEPLOY_DIR} /cr.yaml" \
388
388
| yq eval " $( printf ' .spec.initImage="%s"' " ${IMAGE} " ) " - \
@@ -407,13 +407,13 @@ get_cr() {
407
407
}
408
408
409
409
get_cr_gh () {
410
- local name_suffix=$1
410
+ local name_suffix=$1
411
411
412
- curl -s " https://raw.githubusercontent.com/percona/percona-server-mysql-operator/${git_tag} /deploy/cr.yaml" \
413
- | yq eval " $( printf ' .metadata.name="%s"' " ${test_name}${name_suffix: +-$name_suffix } " ) " - \
414
- | yq eval ' .spec.secretsName="test-secrets"' - \
415
- | yq eval ' .spec.sslSecretName="test-ssl"' - \
416
- | yq eval ' .spec.upgradeOptions.apply="disabled"' -
412
+ curl -s " https://raw.githubusercontent.com/percona/percona-server-mysql-operator/${git_tag} /deploy/cr.yaml" \
413
+ | yq eval " $( printf ' .metadata.name="%s"' " ${test_name}${name_suffix: +-$name_suffix } " ) " - \
414
+ | yq eval ' .spec.secretsName="test-secrets"' - \
415
+ | yq eval ' .spec.sslSecretName="test-ssl"' - \
416
+ | yq eval ' .spec.upgradeOptions.apply="disabled"' -
417
417
}
418
418
419
419
get_client_pod () {
@@ -1205,41 +1205,41 @@ check_scheduled_backup_labels() {
1205
1205
fi
1206
1206
1207
1207
latest_operator_version_in_vs () {
1208
- local latest=$( curl -s https://check.percona.com/versions/v1/ps-operator | jq -r ' .versions[].operator' | sort -V | tail -n1)
1208
+ local latest=$( curl -s https://check.percona.com/versions/v1/ps-operator | jq -r ' .versions[].operator' | sort -V | tail -n1)
1209
1209
1210
- # if testing on release branch and version service is already updated with new operator images
1211
- # use the older version of operator as initial point for test
1212
- if [[ ${latest} == " ${OPERATOR_VERSION} " ]]; then
1213
- latest=$( curl -s https://check.percona.com/versions/v1/ps-operator | jq -r ' .versions[].operator' | sort -V | tail -n2 | head -n1)
1214
- fi
1210
+ # if testing on release branch and version service is already updated with new operator images
1211
+ # use the older version of operator as initial point for test
1212
+ if [[ ${latest} == " ${OPERATOR_VERSION} " ]]; then
1213
+ latest=$( curl -s https://check.percona.com/versions/v1/ps-operator | jq -r ' .versions[].operator' | sort -V | tail -n2 | head -n1)
1214
+ fi
1215
1215
1216
- echo ${latest}
1216
+ echo ${latest}
1217
1217
}
1218
1218
1219
1219
latest_operator_image_in_vs () {
1220
- local version=$( latest_operator_version_in_vs)
1220
+ local version=$( latest_operator_version_in_vs)
1221
1221
1222
- curl -s https://check.percona.com/versions/v1/ps-operator/${version} /latest | jq -r ' .versions[].matrix.operator[].imagePath'
1222
+ curl -s https://check.percona.com/versions/v1/ps-operator/${version} /latest | jq -r ' .versions[].matrix.operator[].imagePath'
1223
1223
}
1224
1224
1225
1225
get_cr_with_latest_versions_in_vs () {
1226
- local version=$( latest_operator_version_in_vs)
1227
- local latest_versions=$( curl -s https://check.percona.com/versions/v1/ps-operator/${version} /latest)
1228
-
1229
- local image_mysql=$( echo ${latest_versions} | jq -r ' .versions[].matrix.mysql[].imagePath' )
1230
- local image_backup=$( echo ${latest_versions} | jq -r ' .versions[].matrix.backup[].imagePath' )
1231
- local image_orchestrator=$( echo ${latest_versions} | jq -r ' .versions[].matrix.orchestrator[].imagePath' )
1232
- local image_router=$( echo ${latest_versions} | jq -r ' .versions[].matrix.orchestrator[].imagePath' )
1233
- local image_toolkit=$( echo ${latest_versions} | jq -r ' .versions[].matrix.toolkit[].imagePath' )
1234
- local image_haproxy=$( echo ${latest_versions} | jq -r ' .versions[].matrix.haproxy[].imagePath' )
1235
- local image_pmm_client=$( echo ${latest_versions} | jq -r ' .versions[].matrix.pmm[].imagePath' )
1236
-
1237
- get_cr " " \
1238
- ${image_mysql} \
1239
- ${image_backup} \
1240
- ${image_orchestrator} \
1241
- ${image_router} \
1242
- ${image_toolkit} \
1243
- ${image_haproxy} \
1244
- ${image_pmm_client}
1226
+ local version=$( latest_operator_version_in_vs)
1227
+ local latest_versions=$( curl -s https://check.percona.com/versions/v1/ps-operator/${version} /latest)
1228
+
1229
+ local image_mysql=$( echo ${latest_versions} | jq -r ' .versions[].matrix.mysql[].imagePath' )
1230
+ local image_backup=$( echo ${latest_versions} | jq -r ' .versions[].matrix.backup[].imagePath' )
1231
+ local image_orchestrator=$( echo ${latest_versions} | jq -r ' .versions[].matrix.orchestrator[].imagePath' )
1232
+ local image_router=$( echo ${latest_versions} | jq -r ' .versions[].matrix.orchestrator[].imagePath' )
1233
+ local image_toolkit=$( echo ${latest_versions} | jq -r ' .versions[].matrix.toolkit[].imagePath' )
1234
+ local image_haproxy=$( echo ${latest_versions} | jq -r ' .versions[].matrix.haproxy[].imagePath' )
1235
+ local image_pmm_client=$( echo ${latest_versions} | jq -r ' .versions[].matrix.pmm[].imagePath' )
1236
+
1237
+ get_cr " " \
1238
+ ${image_mysql} \
1239
+ ${image_backup} \
1240
+ ${image_orchestrator} \
1241
+ ${image_router} \
1242
+ ${image_toolkit} \
1243
+ ${image_haproxy} \
1244
+ ${image_pmm_client}
1245
1245
}
0 commit comments