Skip to content

Commit

Permalink
[FLINK-30757] Upgrade busybox version to a pinned version for operator
Browse files Browse the repository at this point in the history
  • Loading branch information
xshipeng committed Feb 10, 2023
1 parent a9f4045 commit 3612645
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/content/docs/custom-resource/pod-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ spec:
initContainers:
# Sample sidecar container
- name: busybox
image: busybox:1.33.1
image: busybox:1.36.0
command: [ 'sh','-c','echo hello from task manager' ]
job:
jarURI: local:///opt/flink/examples/streaming/StateMachineExample.jar
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/data/flinkdep-cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
spec:
initContainers:
- name: artifacts-fetcher
image: busybox:1.33.1
image: busybox:1.36.0
imagePullPolicy: IfNotPresent
# Use wget or other tools to get user jars from remote storage
command: [ 'wget', 'https://repo1.maven.org/maven2/org/apache/flink/flink-examples-streaming_2.12/1.14.4/flink-examples-streaming_2.12-1.14.4.jar', '-O', '/flink-artifact/myjob.jar' ]
Expand Down
39 changes: 29 additions & 10 deletions e2e-tests/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,20 +175,39 @@ function debug_and_show_logs {

echo "Flink logs:"
kubectl get pods -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' | while read pod;do
init_containers=(`kubectl get pods $pod -o jsonpath='{.spec.initContainers[*].name}'`)
print_pod_container_logs "$pod" "$init_containers" true
containers=(`kubectl get pods $pod -o jsonpath='{.spec.containers[*].name}'`)
i=0
for container in "${containers[@]}"; do
echo "Current logs for $pod:$container: "
kubectl logs $pod $container;
restart_count=$(kubectl get pod $pod -o jsonpath='{.status.containerStatuses['$i'].restartCount}')
if [[ ${restart_count} -gt 0 ]];then
echo "Previous logs for $pod: "
kubectl logs $pod $container --previous
fi
done
print_pod_container_logs "$pod" "$containers" false
done
}

function print_pod_container_logs {
pod=$1
containers=$2
is_init_container=$3

if [[ -z "$containers" ]];then
return 0
fi

i=0
for container in "${containers[@]}"; do
echo "Current logs for $pod:$container: "
kubectl logs $pod $container;
if $is_init_container;then
restart_count=$(kubectl get pod $pod -o jsonpath='{.status.initContainerStatuses['$i'].restartCount}')
else
restart_count=$(kubectl get pod $pod -o jsonpath='{.status.containerStatuses['$i'].restartCount}')
fi
if [[ ${restart_count} -gt 0 ]];then
echo "Previous logs for $pod:$container: "
kubectl logs $pod $container --previous
fi
((i++))
done
}

function start_minikube {
if ! retry_times 5 30 start_minikube_if_not_running; then
echo "Could not start minikube. Aborting..."
Expand Down
2 changes: 1 addition & 1 deletion examples/pod-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ spec:
initContainers:
# Sample init container for fetching remote artifacts
- name: busybox
image: busybox:1.33.1
image: busybox:1.36.0
volumeMounts:
- mountPath: /opt/flink/downloads
name: downloads
Expand Down

0 comments on commit 3612645

Please sign in to comment.