Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kola: Change --oscontainer to use new ostree native containers #3004

Merged
merged 1 commit into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions mantle/cmd/kola/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,6 @@ func syncOptionsImpl(useCosa bool) error {
})
}

if kola.Options.OSContainer != "" && kola.Options.Distribution != "rhcos" {
return fmt.Errorf("oscontainer is only supported on rhcos")
}

if kola.Options.Distribution == "" {
kola.Options.Distribution = kolaDistros[0]
} else if kola.Options.Distribution == "scos" {
Expand Down
23 changes: 10 additions & 13 deletions mantle/platform/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,25 +221,22 @@ enabled = false`, 0644)
}

if bc.bf.baseopts.OSContainer != "" {
if bc.Distribution() != "rhcos" {
return nil, fmt.Errorf("oscontainer is only supported on the rhcos distribution")
}
conf.AddSystemdUnitDropin("pivot.service", "00-before-sshd.conf", `[Unit]
Before=sshd.service`)
conf.AddSystemdUnit("pivot.service", "", platformConf.Enable)
conf.AddSystemdUnit("pivot-write-reboot-needed.service", `[Unit]
Description=Touch /run/pivot/reboot-needed
ConditionFirstBoot=true
conf.AddSystemdUnit("kola-container-rebase.service", fmt.Sprintf(`[Unit]
Description=Rebase to target container
ConditionPathExists=!/etc/kola-rebase-done
Before=sshd.service
Wants=network-online.target
After=network-online.target

[Service]
Type=oneshot
ExecStart=/usr/bin/mkdir -p /run/pivot
prestist marked this conversation as resolved.
Show resolved Hide resolved
ExecStart=/usr/bin/touch /run/pivot/reboot-needed
ExecStart=rpm-ostree rebase --experimental %s
ExecStart=touch /etc/kola-rebase-done
ExecStart=systemctl reboot

[Install]
WantedBy=multi-user.target
`, platformConf.Enable)
conf.AddFile("/etc/pivot/image-pullspec", bc.bf.baseopts.OSContainer, 0644)
`, bc.bf.baseopts.OSContainer), platformConf.Enable)
}

if conf.IsIgnition() {
Expand Down