mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-10-21 03:27:33 +00:00
bug: Fix validator on long strings (#1194)
* 🐛 Fix validator on long strings Validator was mistakenly identifying a long yaml as a file and trying to open it, which failed with an error of filename too long. This was not catched in order to identify that the source is not a file but a yaml, so it was directly returning the error. This patch adds that error to the list in order ot identify the source to validate as yaml. Also adds a couple of tests for this functionality. Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com> * 🐛 Merge initramfs generation between distros Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com> --------- Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
This commit is contained in:
35
Earthfile
35
Earthfile
@@ -66,7 +66,7 @@ test:
|
|||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
COPY +luet/luet /usr/bin/luet
|
COPY +luet/luet /usr/bin/luet
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN go run github.com/onsi/ginkgo/v2/ginkgo --fail-fast --slow-spec-threshold 30s --covermode=atomic --coverprofile=coverage.out -p -r ./pkg ./internal ./cmd ./sdk
|
RUN go run github.com/onsi/ginkgo/v2/ginkgo --fail-fast --covermode=atomic --coverprofile=coverage.out -p -r ./pkg ./internal ./cmd ./sdk
|
||||||
SAVE ARTIFACT coverage.out AS LOCAL coverage.out
|
SAVE ARTIFACT coverage.out AS LOCAL coverage.out
|
||||||
|
|
||||||
OSRELEASE:
|
OSRELEASE:
|
||||||
@@ -341,25 +341,20 @@ base-image:
|
|||||||
IF [ "$FLAVOR" = "debian" ]
|
IF [ "$FLAVOR" = "debian" ]
|
||||||
RUN rm -rf /boot/initrd.img-*
|
RUN rm -rf /boot/initrd.img-*
|
||||||
END
|
END
|
||||||
# Regenerate initrd if necessary
|
|
||||||
IF [ "$FLAVOR" = "opensuse-leap" ] || [ "$FLAVOR" = "opensuse-leap-arm-rpi" ] || [ "$FLAVOR" = "opensuse-tumbleweed-arm-rpi" ] || [ "$FLAVOR" = "opensuse-tumbleweed" ]
|
|
||||||
RUN mkinitrd
|
IF [[ "$FLAVOR" =~ ^alpine.* ]] || [[ "$FLAVOR" =~ .*-arm-rpi$ ]]
|
||||||
ELSE IF [ "$FLAVOR" = "fedora" ] || [ "$FLAVOR" = "rockylinux" ]
|
# no dracut on those flavors, do nothing
|
||||||
RUN kernel=$(ls /boot/vmlinuz-* | head -n1) && \
|
ELSE
|
||||||
ln -sf "${kernel#/boot/}" /boot/vmlinuz
|
# Regenerate initrd if necessary
|
||||||
RUN kernel=$(ls /lib/modules | head -n1) && \
|
RUN --no-cache kernel=$(ls /boot/vmlinuz-* | head -n1) && ln -sf "${kernel#/boot/}" /boot/vmlinuz
|
||||||
dracut -v -N -f "/boot/initrd-${kernel}" "${kernel}" && \
|
RUN --no-cache kernel=$(ls /lib/modules | head -n1) && dracut -f "/boot/initrd-${kernel}" "${kernel}" && ln -sf "initrd-${kernel}" /boot/initrd
|
||||||
ln -sf "initrd-${kernel}" /boot/initrd
|
RUN --no-cache kernel=$(ls /lib/modules | head -n1) && depmod -a "${kernel}"
|
||||||
RUN kernel=$(ls /lib/modules | head -n1) && depmod -a "${kernel}"
|
END
|
||||||
# https://github.com/kairos-io/elemental-cli/blob/23ca64435fedb9f521c95e798d2c98d2714c53bd/pkg/elemental/elemental.go#L553
|
|
||||||
RUN rm -rf /boot/initramfs-*
|
IF [ "$FLAVOR" = "fedora" ] || [ "$FLAVOR" = "rockylinux" ]
|
||||||
ELSE IF [ "$FLAVOR" = "debian" ] || [ "$FLAVOR" = "ubuntu" ] || [ "$FLAVOR" = "ubuntu-20-lts" ] || [ "$FLAVOR" = "ubuntu-22-lts" ]
|
# https://github.com/kairos-io/elemental-cli/blob/23ca64435fedb9f521c95e798d2c98d2714c53bd/pkg/elemental/elemental.go#L553
|
||||||
RUN kernel=$(ls /boot/vmlinuz-* | head -n1) && \
|
RUN rm -rf /boot/initramfs-*
|
||||||
ln -sf "${kernel#/boot/}" /boot/vmlinuz
|
|
||||||
RUN kernel=$(ls /lib/modules | head -n1) && \
|
|
||||||
dracut -f "/boot/initrd-${kernel}" "${kernel}" && \
|
|
||||||
ln -sf "initrd-${kernel}" /boot/initrd
|
|
||||||
RUN kernel=$(ls /lib/modules | head -n1) && depmod -a "${kernel}"
|
|
||||||
END
|
END
|
||||||
|
|
||||||
IF [ ! -e "/boot/vmlinuz" ]
|
IF [ ! -e "/boot/vmlinuz" ]
|
||||||
|
Reference in New Issue
Block a user