mirror of
https://github.com/containers/podman.git
synced 2025-06-24 03:08:13 +08:00
APIv2 add generate systemd endpoint
Add support for generating systemd units via the api and podman-remote. Change the GenerateSystemdReport type to return the units as map[string]string with the unit name as key. Add `--format` flag to `podman generate systemd` to allow the output to be formatted as json. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
This commit is contained in:
@ -58,7 +58,8 @@ KillMode=none
|
||||
Type=forking
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target default.target`
|
||||
WantedBy=multi-user.target default.target
|
||||
`
|
||||
|
||||
podGoodNamedNew := `# pod-123abc.service
|
||||
# autogenerated by Podman CI
|
||||
@ -84,7 +85,8 @@ KillMode=none
|
||||
Type=forking
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target default.target`
|
||||
WantedBy=multi-user.target default.target
|
||||
`
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
@ -130,8 +132,7 @@ WantedBy=multi-user.target default.target`
|
||||
test := tt
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
opts := entities.GenerateSystemdOptions{
|
||||
Files: false,
|
||||
New: test.new,
|
||||
New: test.new,
|
||||
}
|
||||
got, err := executePodTemplate(&test.info, opts)
|
||||
if (err != nil) != test.wantErr {
|
||||
|
Reference in New Issue
Block a user