api/server/router/container: containerRouter.postCommit: inline struct

Remove intermediate variable and inline the struct-literal.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-04-29 02:59:12 +02:00
parent 9613da63dc
commit bf5ae17c16
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -53,16 +53,14 @@ func (s *containerRouter) postCommit(ctx context.Context, w http.ResponseWriter,
return errdefs.InvalidParameter(err)
}
commitCfg := &backend.CreateImageConfig{
imgID, err := s.backend.CreateImageFromContainer(ctx, r.Form.Get("container"), &backend.CreateImageConfig{
Pause: pause,
Tag: ref,
Author: r.Form.Get("author"),
Comment: r.Form.Get("comment"),
Config: config,
Changes: r.Form["changes"],
}
imgID, err := s.backend.CreateImageFromContainer(ctx, r.Form.Get("container"), commitCfg)
})
if err != nil {
return err
}