Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLINK-30757] Upgrade busybox version to a pinned version for operator #530

Merged
merged 3 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.35.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.35.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: 28 additions & 11 deletions e2e-tests/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,20 +175,37 @@ function debug_and_show_logs {

echo "Flink logs:"
kubectl get pods -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' | while read pod;do
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
echo "Printing init container logs"
print_pod_container_logs "$pod" "{.spec.initContainers[*].name}" "{.status.initContainerStatuses[*].restartCount}"
echo "Printing main container logs"
print_pod_container_logs "$pod" "{.spec.containers[*].name}" "{.status.containerStatuses[*].restartCount}"
done
}

function print_pod_container_logs {
pod=$1
container_path=$2
restart_count_path=$3

containers=(`kubectl get pods $pod -o jsonpath=$container_path`)
restart_counts=(`kubectl get pod $pod -o jsonpath=$restart_count_path`)

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

for idx in "${!containers[@]}"; do
echo "--------BEGIN CURRENT LOG for $pod:${containers[idx]}--------"
kubectl logs $pod ${containers[idx]};
echo "--------END CURRENT LOG--------"
if [[ ${restart_counts[idx]} -gt 0 ]];then
echo "--------BEGIN PREVIOUS LOGS for $pod:${containers[idx]}--------"
kubectl logs $pod ${containers[idx]} --previous
echo "--------END PREVIOUS LOGS--------"
fi
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.35.0
volumeMounts:
- mountPath: /opt/flink/downloads
name: downloads
Expand Down