Skip to content

Commit

Permalink
Fail fast if we cannot determine kubelet version (awslabs#1484)
Browse files Browse the repository at this point in the history
kubelet is likely to fail when there is a mismatch with GLIBC that is in
the image vs the one golang uses to build the kubelet. So fail the image
right away when this happens as this specific kubelet binary will NOT work
in any instance started with this image.
```
2023-10-25T10:11:38-04:00:     amazon-ebs: kubelet: /lib64/libc.so.6: version `GLIBC_2.32' not found (required by kubelet)
2023-10-25T10:11:38-04:00:     amazon-ebs: kubelet: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by kubelet)
```

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
  • Loading branch information
dims authored and atmosx committed Jun 18, 2024
1 parent 0a06ada commit 6875d8c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions scripts/generate-version-info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,19 @@ OUTPUT_FILE="$1"
sudo rpm --query --all --queryformat '\{"%{NAME}": "%{VERSION}-%{RELEASE}"\}\n' | jq --slurp --sort-keys 'add | {packages:(.)}' > "$OUTPUT_FILE"

# binaries
echo $(jq ".binaries.kubelet = \"$(kubelet --version | awk '{print $2}')\"" $OUTPUT_FILE) > $OUTPUT_FILE
echo $(jq ".binaries.awscli = \"$(aws --version | awk '{print $1}' | cut -d '/' -f 2)\"" $OUTPUT_FILE) > $OUTPUT_FILE
KUBELET_VERSION=$(kubelet --version | awk '{print $2}')
if [ "$?" != 0 ]; then
echo "unable to get kubelet version"
exit 1
fi
echo $(jq ".binaries.kubelet = \"$KUBELET_VERSION\"" $OUTPUT_FILE) > $OUTPUT_FILE

CLI_VERSION=$(aws --version | awk '{print $1}' | cut -d '/' -f 2)
if [ "$?" != 0 ]; then
echo "unable to get aws cli version"
exit 1
fi
echo $(jq ".binaries.awscli = \"$CLI_VERSION\"" $OUTPUT_FILE) > $OUTPUT_FILE

# cached images
if systemctl is-active --quiet containerd; then
Expand Down

0 comments on commit 6875d8c

Please sign in to comment.