This is an automated email from the ASF dual-hosted git repository.

wangyang0918 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/flink-kubernetes-operator.git

commit ab1893c61adddb580116186500297cb954f6f6cc
Author: SteNicholas <[email protected]>
AuthorDate: Tue May 10 12:06:26 2022 +0800

    [hotfix] Specify container in kubectl command
---
 e2e-tests/test_kubernetes_application_ha.sh | 4 ++--
 e2e-tests/test_last_state_upgrade.sh        | 2 +-
 e2e-tests/test_sessionjob_ha.sh             | 4 ++--
 e2e-tests/utils.sh                          | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/e2e-tests/test_kubernetes_application_ha.sh 
b/e2e-tests/test_kubernetes_application_ha.sh
index 2b2ffde..db32e00 100755
--- a/e2e-tests/test_kubernetes_application_ha.sh
+++ b/e2e-tests/test_kubernetes_application_ha.sh
@@ -34,11 +34,11 @@ wait_for_logs $jm_pod_name "Completed checkpoint [0-9]+ for 
job" ${TIMEOUT} || e
 wait_for_status flinkdep/flink-example-statemachine 
'.status.jobManagerDeploymentStatus' READY ${TIMEOUT} || exit 1
 wait_for_status flinkdep/flink-example-statemachine '.status.jobStatus.state' 
RUNNING ${TIMEOUT} || exit 1
 
-job_id=$(kubectl logs $jm_pod_name | grep -E -o 'Job [a-z0-9]+ is submitted' | 
awk '{print $2}')
+job_id=$(kubectl logs $jm_pod_name -c flink-main-container | grep -E -o 'Job 
[a-z0-9]+ is submitted' | awk '{print $2}')
 
 # Kill the JobManager
 echo "Kill the $jm_pod_name"
-kubectl exec $jm_pod_name -- /bin/sh -c "kill 1"
+kubectl exec $jm_pod_name -c flink-main-container -- /bin/sh -c "kill 1"
 
 # Check the new JobManager recovering from latest successful checkpoint
 wait_for_logs $jm_pod_name "Restoring job $job_id from Checkpoint" ${TIMEOUT} 
|| exit 1
diff --git a/e2e-tests/test_last_state_upgrade.sh 
b/e2e-tests/test_last_state_upgrade.sh
index a024c45..3a8cc7a 100755
--- a/e2e-tests/test_last_state_upgrade.sh
+++ b/e2e-tests/test_last_state_upgrade.sh
@@ -35,7 +35,7 @@ wait_for_status flinkdep/flink-example-statemachine 
'.status.jobManagerDeploymen
 wait_for_status flinkdep/flink-example-statemachine '.status.jobStatus.state' 
RUNNING ${TIMEOUT} || exit 1
 assert_available_slots 0 $CLUSTER_ID
 
-job_id=$(kubectl logs $jm_pod_name | grep -E -o 'Job [a-z0-9]+ is submitted' | 
awk '{print $2}')
+job_id=$(kubectl logs $jm_pod_name -c flink-main-container | grep -E -o 'Job 
[a-z0-9]+ is submitted' | awk '{print $2}')
 
 # Update the FlinkDeployment and trigger the last state upgrade
 kubectl patch flinkdep ${CLUSTER_ID} --type merge --patch '{"spec":{"job": 
{"parallelism": 1 } } }'
diff --git a/e2e-tests/test_sessionjob_ha.sh b/e2e-tests/test_sessionjob_ha.sh
index 0a1f744..f0fbe58 100755
--- a/e2e-tests/test_sessionjob_ha.sh
+++ b/e2e-tests/test_sessionjob_ha.sh
@@ -35,11 +35,11 @@ wait_for_logs $jm_pod_name "Completed checkpoint [0-9]+ for 
job" ${TIMEOUT} || e
 wait_for_status $SESSION_CLUSTER_IDENTIFIER 
'.status.jobManagerDeploymentStatus' READY ${TIMEOUT} || exit 1
 wait_for_status $SESSION_JOB_IDENTIFIER '.status.jobStatus.state' RUNNING 
${TIMEOUT} || exit 1
 
-job_id=$(kubectl logs $jm_pod_name | grep -E -o 'Job [a-z0-9]+ is submitted' | 
awk '{print $2}')
+job_id=$(kubectl logs $jm_pod_name -c flink-main-container | grep -E -o 'Job 
[a-z0-9]+ is submitted' | awk '{print $2}')
 
 # Kill the JobManager
 echo "Kill the $jm_pod_name"
-kubectl exec $jm_pod_name -- /bin/sh -c "kill 1"
+kubectl exec $jm_pod_name -c flink-main-container -- /bin/sh -c "kill 1"
 
 # Check the new JobManager recovering from latest successful checkpoint
 wait_for_logs $jm_pod_name "Restoring job $job_id from Checkpoint" ${TIMEOUT} 
|| exit 1
diff --git a/e2e-tests/utils.sh b/e2e-tests/utils.sh
index d49ef13..43d5e3e 100755
--- a/e2e-tests/utils.sh
+++ b/e2e-tests/utils.sh
@@ -25,7 +25,7 @@ function wait_for_logs {
   # wait or timeout until the log shows up
   echo "Waiting for log \"$2\"..."
   for i in $(seq 1 ${timeout}); do
-    if kubectl logs $jm_pod_name | grep -E "${successful_response_regex}" 
>/dev/null; then
+    if kubectl logs $jm_pod_name -c flink-main-container | grep -E 
"${successful_response_regex}" >/dev/null; then
       echo "Log \"$2\" shows up."
       return
     fi

Reply via email to