--no-header flag implementation for generate systemd

Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
This commit is contained in:
Jakub Guzik
2021-02-22 14:47:08 +01:00
parent 4aaaa6c1df
commit d2f3098c6f
14 changed files with 175 additions and 21 deletions

View File

@ -18,6 +18,7 @@ func GenerateSystemd(w http.ResponseWriter, r *http.Request) {
query := struct {
Name bool `schema:"useName"`
New bool `schema:"new"`
NoHeader bool `schema:"noHeader"`
RestartPolicy string `schema:"restartPolicy"`
StopTimeout uint `schema:"stopTimeout"`
ContainerPrefix string `schema:"containerPrefix"`
@ -41,6 +42,7 @@ func GenerateSystemd(w http.ResponseWriter, r *http.Request) {
options := entities.GenerateSystemdOptions{
Name: query.Name,
New: query.New,
NoHeader: query.NoHeader,
RestartPolicy: query.RestartPolicy,
StopTimeout: &query.StopTimeout,
ContainerPrefix: query.ContainerPrefix,

View File

@ -32,6 +32,11 @@ func (s *APIServer) registerGenerateHandlers(r *mux.Router) error {
// default: false
// description: Create a new container instead of starting an existing one.
// - in: query
// name: noHeader
// type: boolean
// default: false
// description: Do not generate the header including the Podman version and the timestamp.
// - in: query
// name: time
// type: integer
// default: 10