generate systemd: error on init containers

Init containers are currently not properly supported in
generate-systemd and there are no plans to do so since
all focus lies on Quadlet going forward.

Hence, generate systemd should through an error.

Closes: #18585
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
Valentin Rothberg
2023-05-17 14:50:23 +02:00
parent a1201843fd
commit a576fa3f14
3 changed files with 21 additions and 0 deletions

View File

@ -144,6 +144,10 @@ func generateContainerInfo(ctr *libpod.Container, options entities.GenerateSyste
}
config := ctr.Config()
if len(config.InitContainerType) > 0 {
return nil, fmt.Errorf("unsupported container %s: cannot generate systemd units for init containers", ctr.ID())
}
conmonPidFile := config.ConmonPidFile
if conmonPidFile == "" {
return nil, errors.New("conmon PID file path is empty, try to recreate the container with --conmon-pidfile flag")