File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed
Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ create_namespace() {
154154
155155get_operator_pod () {
156156 kubectl_bin get pods \
157- --selector=name=percona-server-mongodb-operator \
157+ --selector=app.kubernetes.io/ name=percona-server-mongodb-operator \
158158 -o ' jsonpath={.items[].metadata.name}' ${OPERATOR_NS: +-n $OPERATOR_NS }
159159}
160160
@@ -229,6 +229,10 @@ wait_backup_agent() {
229229 set_debug
230230}
231231
232+ print_operator_logs () {
233+ kubectl_bin logs ${OPERATOR_NS: +-n $OPERATOR_NS } $( get_operator_pod)
234+ }
235+
232236wait_backup () {
233237 local backup_name=$1
234238 local target_state=${2:- " ready" }
@@ -243,15 +247,10 @@ wait_backup() {
243247 let retry+=1
244248 current_status=$( kubectl_bin get psmdb-backup $backup_name -o jsonpath=' {.status.state}' )
245249 if [[ $retry -ge 600 || ${current_status} == ' error' ]]; then
246- kubectl_bin logs ${OPERATOR_NS: +-n $OPERATOR_NS } $( get_operator_pod) \
247- | grep -v ' level=info' \
248- | grep -v ' level=debug' \
249- | grep -v ' Getting tasks for pod' \
250- | grep -v ' Getting pods from source' \
251- | tail -200
250+ print_operator_logs | tail -n 200
252251 kubectl_bin get psmdb-backup
252+ kubectl_bin describe psmdb-backup/${backup_name}
253253 echo " Backup object psmdb-backup/${backup_name} is in ${current_status} state."
254- echo something went wrong with operator or kubernetes cluster
255254 exit 1
256255 fi
257256 done
Original file line number Diff line number Diff line change 2222 enabled : true
2323 oplogSpanMin : 2
2424 oplogOnly : false
25- oplogSpanMin : 10
2625 compressionType : gzip
2726 compressionLevel : 6
2827 replsets :
You can’t perform that action at this time.
0 commit comments