Create mkosi image build pipeline

This commit is contained in:
Malte Poll 2022-10-19 13:10:15 +02:00 committed by Malte Poll
parent e5aaf0a42f
commit 34367ea3cc
107 changed files with 2733 additions and 105 deletions

View file

@ -14,7 +14,7 @@ const (
SSHCheckInterval = 30 * time.Second
DiscoverDebugdInterval = 30 * time.Second
BootstrapperDownloadRetryBackoff = 1 * time.Minute
BootstrapperDeployFilename = "/opt/bootstrapper"
BootstrapperDeployFilename = "/run/state/bin/bootstrapper"
Chunksize = 1024
BootstrapperSystemdUnitName = "bootstrapper.service"
BootstrapperSystemdUnitContents = `[Unit]
@ -25,12 +25,10 @@ After=network-online.target
Type=simple
RemainAfterExit=yes
Restart=on-failure
EnvironmentFile=/etc/constellation.env
EnvironmentFile=/run/constellation.env
Environment=PATH=/run/state/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
ExecStartPre=-setenforce Permissive
ExecStartPre=/usr/bin/mkdir -p /opt/cni/bin/
# merge all CNI binaries in writable folder until containerd can use multiple CNI bins: https://github.com/containerd/containerd/issues/6600
ExecStartPre=/bin/sh -c "/usr/bin/cp /usr/libexec/cni/* /opt/cni/bin/"
ExecStart=/opt/bootstrapper
ExecStart=/run/state/bin/bootstrapper
[Install]
WantedBy=multi-user.target
`

View file

@ -36,7 +36,7 @@ func TestMain(m *testing.M) {
}
func TestDownloadBootstrapper(t *testing.T) {
filename := "/opt/bootstrapper"
filename := "/run/state/bin/bootstrapper"
someErr := errors.New("failed")
testCases := map[string]struct {

View file

@ -18,7 +18,7 @@ import (
)
const (
systemdUnitFolder = "/etc/systemd/system"
systemdUnitFolder = "/run/systemd/system"
)
//go:generate stringer -type=SystemdAction

View file

@ -188,7 +188,7 @@ func TestUploadBootstrapper(t *testing.T) {
assert.Equal(tc.wantResponseStatus, resp.Status)
if tc.wantFile {
assert.Equal(tc.wantChunks, tc.streamer.writeStreamChunks)
assert.Equal("/opt/bootstrapper", tc.streamer.writeStreamFilename)
assert.Equal("/run/state/bin/bootstrapper", tc.streamer.writeStreamFilename)
} else {
assert.Empty(tc.streamer.writeStreamChunks)
assert.Empty(tc.streamer.writeStreamFilename)
@ -256,7 +256,7 @@ func TestDownloadBootstrapper(t *testing.T) {
}
require.NoError(err)
assert.Equal(tc.wantChunks, chunks)
assert.Equal("/opt/bootstrapper", tc.streamer.readStreamFilename)
assert.Equal("/run/state/bin/bootstrapper", tc.streamer.readStreamFilename)
})
}
}