Skip to content

Commit

Permalink
Fail fast if we cannot determine kubelet version
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 committed Oct 25, 2023
1 parent dbf0d15 commit 879c1d4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions scripts/generate-version-info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,17 @@ 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"
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"
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 879c1d4

Please sign in to comment.