1
0
mirror of https://github.com/kairos-io/osbuilder.git synced 2025-05-11 09:36:33 +00:00

Merge pull request from kairos-io/kairos-release

This commit is contained in:
Itxaka 2024-10-07 14:26:18 +02:00 committed by GitHub
commit ff80eae58f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 37 additions and 8 deletions

View File

@ -49,8 +49,9 @@ type OSArtifactSpec struct {
CloudConfigRef *SecretKeySelector `json:"cloudConfigRef,omitempty"`
GRUBConfig string `json:"grubConfig,omitempty"`
Bundles []string `json:"bundles,omitempty"`
OSRelease string `json:"osRelease,omitempty"`
Bundles []string `json:"bundles,omitempty"`
OSRelease string `json:"osRelease,omitempty"`
KairosRelease string `json:"kairosRelease,omitempty"`
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
Exporters []batchv1.JobSpec `json:"exporters,omitempty"`

View File

@ -107,6 +107,29 @@ func osReleaseContainer(containerImage string) corev1.Container {
}
}
func kairosReleaseContainer(containerImage string) corev1.Container {
return corev1.Container{
ImagePullPolicy: corev1.PullAlways,
Name: "kairos-release",
Image: containerImage,
Command: []string{"/bin/bash", "-cxe"},
Args: []string{
"cp -rfv /etc/kairos-release /rootfs/etc/kairos-release",
},
VolumeMounts: []corev1.VolumeMount{
{
Name: "config",
MountPath: "/etc/kairos-release",
SubPath: "kairos-release",
},
{
Name: "rootfs",
MountPath: "/rootfs",
},
},
}
}
func (r *OSArtifactReconciler) newArtifactPVC(artifact *osbuilder.OSArtifact) *corev1.PersistentVolumeClaim {
if artifact.Spec.Volume == nil {
artifact.Spec.Volume = &corev1.PersistentVolumeClaimSpec{
@ -358,6 +381,9 @@ func (r *OSArtifactReconciler) newBuilderPod(pvcName string, artifact *osbuilder
if artifact.Spec.OSRelease != "" {
podSpec.InitContainers = append(podSpec.InitContainers, osReleaseContainer(r.ToolImage))
}
if artifact.Spec.KairosRelease != "" {
podSpec.InitContainers = append(podSpec.InitContainers, kairosReleaseContainer(r.ToolImage))
}
if artifact.Spec.ISO || artifact.Spec.Netboot {
podSpec.Containers = append(podSpec.Containers, buildIsoContainer)

View File

@ -1,7 +1,7 @@
# https://quay.io/repository/kairos/packages?tab=tags&tag=latest
ARG LEAP_VERSION=15.5
ARG LUET_VERSION=0.35.5
ARG ENKI_VERSION=0.1.2
ARG ENKI_VERSION=0.2.0
FROM quay.io/luet/base:$LUET_VERSION AS luet
FROM quay.io/kairos/enki:v${ENKI_VERSION} as enki
@ -86,7 +86,7 @@ RUN mkdir /config
COPY ./config.yaml /config/manifest.yaml
COPY ./entrypoint.sh /entrypoint.sh
COPY ./add-cloud-init.sh /add-cloud-init.sh
COPY ./os-release.tmpl /os-release.tmpl
COPY ./kairos-release.tmpl /kairos-release.tmpl
COPY ./ipxe.tmpl /ipxe.tmpl
COPY ./update-os-release.sh /update-os-release.sh

View File

@ -13,4 +13,4 @@ repositories:
urls:
- "quay.io/kairos/packages"
# renovate: datasource=docker depName=quay.io/kairos/packages
reference: 202407181636-gitee2bb9c7-repository.yaml
reference: 202410070953-git9232f7ee-repository.yaml

View File

@ -13,4 +13,4 @@ repositories:
urls:
- "quay.io/kairos/packages-arm64"
# renovate: datasource=docker depName=quay.io/kairos/packages-arm64
reference: 202407181651-gitee2bb9c7-repository.yaml
reference: 202410071128-git9232f7ee-repository.yaml

View File

@ -17,7 +17,9 @@
set -ex
[ -f "/workspace/kairos-release" ] && sed -i -n '/KAIROS_/!p' /workspace/kairos-release
# Clean up old os-release just in case so we dont have stuff lying around
sed -i -n '/KAIROS_/!p' /workspace/os-release
envsubst >>/workspace/os-release < /os-release.tmpl
envsubst >>/workspace/kairos-release < /kairos-release.tmpl
cat /workspace/os-release
cat /workspace/kairos-release