Skip to content

Commit

Permalink
fix earthly build args and remove deprecated k8s versions (#290)
Browse files Browse the repository at this point in the history
Signed-off-by: Nianyu Shen <[email protected]>
  • Loading branch information
nianyush authored Oct 4, 2024
1 parent 286c01a commit d7b3eef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 42 deletions.
46 changes: 8 additions & 38 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ ARG SPECTRO_LUET_REPO=us-docker.pkg.dev/palette-images/edge
ARG KAIROS_BASE_IMAGE_URL=$SPECTRO_PUB_REPO/edge
ARG LUET_PROJECT=luet-repo


# Spectro Cloud and Kairos tags.
ARG PE_VERSION=v4.5.0-rc4
ARG SPECTRO_LUET_VERSION=v1.3.8-alpha5
Expand Down Expand Up @@ -245,13 +244,16 @@ install-k8s:
WORKDIR /output

IF [ "$ARCH" = "arm64" ]
ARG LUET_REPO=$LUET_PROJECT-arm
LET LUET_REPO=$LUET_PROJECT-arm
ELSE IF [ "$ARCH" = "amd64" ]
ARG LUET_REPO=$LUET_PROJECT
LET LUET_REPO=$LUET_PROJECT
END

RUN mkdir -p /etc/luet/repos.conf.d && \
luet repo add spectro --type docker --url $SPECTRO_LUET_REPO/$LUET_REPO/$SPECTRO_LUET_VERSION --priority 1 -y && \
luet repo update
luet repo add spectro --type docker --url $SPECTRO_LUET_REPO/$LUET_REPO/$SPECTRO_LUET_VERSION --priority 1 -y
COPY --if-exists spectro-luet-auth.yaml spectro-luet-auth.yaml
RUN --no-cache if [ -f spectro-luet-auth.yaml ]; then cat spectro-luet-auth.yaml >> /etc/luet/repos.conf.d/spectro.yaml; fi
RUN --no-cache luet repo update

IF [ "$K8S_DISTRIBUTION" = "kubeadm" ]
RUN luet install -y container-runtime/containerd --system-target /output
Expand Down Expand Up @@ -504,7 +506,7 @@ provider-image:
RUN chmod 644 /etc/logrotate.d/stylus.conf
END

COPY --platform=linux/${ARCH} +kairos-provider-image/ /
COPY --platform=linux/${ARCH} +kairos-provider-image/ /
COPY +stylus-image/etc/kairos/branding /etc/kairos/branding
COPY +stylus-image/oem/stylus_config.yaml /etc/kairos/branding/stylus_config.yaml
COPY +stylus-image/etc/elemental/config.yaml /etc/elemental/config.yaml
Expand Down Expand Up @@ -611,26 +613,6 @@ base-image:
COPY cloudconfigs/80_stylus_uki.yaml /system/oem/80_stylus_uki.yaml
END

IF [ "$ARCH" = "arm64" ]
ARG LUET_REPO=$LUET_PROJECT-arm
ELSE IF [ "$ARCH" = "amd64" ]
ARG LUET_REPO=$LUET_PROJECT
END

RUN mkdir -p /etc/luet/repos.conf.d && \
SPECTRO_LUET_VERSION=$SPECTRO_LUET_VERSION luet repo add spectro --type docker --url $SPECTRO_LUET_REPO/$LUET_REPO/$SPECTRO_LUET_VERSION --priority 1 -y && \
luet repo update

IF [ "$K8S_DISTRIBUTION" = "kubeadm" ] || [ "$K8S_DISTRIBUTION" = "kubeadm-fips" ]
ARG BASE_K8S_VERSION=$K8S_VERSION
ELSE IF [ "$K8S_DISTRIBUTION" = "k3s" ]
ARG K8S_DISTRIBUTION_TAG=$K3S_FLAVOR_TAG
ARG BASE_K8S_VERSION=$K8S_VERSION-$K8S_DISTRIBUTION_TAG
ELSE IF [ "$K8S_DISTRIBUTION" = "rke2" ]
ARG K8S_DISTRIBUTION_TAG=$RKE2_FLAVOR_TAG
ARG BASE_K8S_VERSION=$K8S_VERSION-$K8S_DISTRIBUTION_TAG
END

# OS == Ubuntu
IF [ "$OS_DISTRIBUTION" = "ubuntu" ] && [ "$ARCH" = "amd64" ]
IF [ ! -z "$UBUNTU_PRO_KEY" ]
Expand Down Expand Up @@ -712,18 +694,6 @@ base-image:
RUN if [ ! -e /usr/bin/apparmor_parser ]; then cp /sbin/apparmor_parser /usr/bin/apparmor_parser; fi
END

IF [ "$ARCH" = "arm64" ]
ARG LUET_REPO=$LUET_PROJECT-arm
ELSE IF [ "$ARCH" = "amd64" ]
ARG LUET_REPO=$LUET_PROJECT
END
RUN --no-cache mkdir -p /etc/luet/repos.conf.d && \
SPECTRO_LUET_VERSION=$SPECTRO_LUET_VERSION luet repo add spectro --type docker --url $SPECTRO_LUET_REPO/$LUET_REPO/$SPECTRO_LUET_VERSION --priority 1 -y

COPY --if-exists spectro-luet-auth.yaml spectro-luet-auth.yaml
RUN --no-cache if [ -f spectro-luet-auth.yaml ]; then cat spectro-luet-auth.yaml >> /etc/luet/repos.conf.d/spectro.yaml; fi
RUN --no-cache luet repo update

IF [ "$OS_DISTRIBUTION" = "rhel" ]
RUN yum install -y openssl rsyslog logrotate
END
Expand Down
4 changes: 0 additions & 4 deletions k8s_version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"k3s": [
"1.24.6",
"1.25.2",
"1.26.4",
"1.26.12",
Expand All @@ -23,7 +22,6 @@
"1.30.5"
],
"kubeadm": [
"1.24.6",
"1.25.2",
"1.25.13",
"1.25.15",
Expand Down Expand Up @@ -55,7 +53,6 @@
"1.30.5"
],
"rke2": [
"1.24.6",
"1.25.2",
"1.25.13",
"1.26.4",
Expand Down Expand Up @@ -90,7 +87,6 @@
"1.30.4"
],
"kubeadm-fips": [
"1.24.13",
"1.25.9",
"1.26.4",
"1.26.12",
Expand Down

0 comments on commit d7b3eef

Please sign in to comment.