diff --git a/Earthfile b/Earthfile index 16a266cf..f2cc6938 100644 --- a/Earthfile +++ b/Earthfile @@ -509,6 +509,13 @@ provider-image: IF [ "$OS_DISTRIBUTION" = "ubuntu" ] && [ "$ARCH" = "amd64" ] && [ "$K8S_DISTRIBUTION" = "kubeadm" ] RUN kernel=$(printf '%s\n' /lib/modules/* | xargs -n1 basename | sort -V | tail -1) && if ! ls /usr/src | grep linux-headers-$kernel; then apt-get update && apt-get install -y "linux-headers-${kernel}"; fi END + # For FIPS builds, install headers for the FIPS kernel + IF [ "$OS_DISTRIBUTION" = "ubuntu" ] && [ "$ARCH" = "amd64" ] && [ "$K8S_DISTRIBUTION" = "kubeadm-fips" ] + RUN kernel=$(printf '%s\n' /lib/modules/* | xargs -n1 basename | grep fips | head -1) && \ + if [ -n "$kernel" ] && ! ls /usr/src | grep -q "linux-headers-$kernel"; then \ + apt-get update && apt-get install -y "linux-headers-${kernel}"; \ + fi + END ELSE IF [ "$K8S_DISTRIBUTION" = "k3s" ] ARG K8S_DISTRIBUTION_TAG=$K3S_FLAVOR_TAG ARG BASE_K8S_VERSION=$K8S_VERSION-$K8S_DISTRIBUTION_TAG