mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
api: normalize comment formatting
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
580d3677c8
commit
c9b2a3cff5
8 changed files with 11 additions and 11 deletions
|
@ -41,7 +41,7 @@ func (s *containerRouter) postCommit(ctx context.Context, w http.ResponseWriter,
|
||||||
}
|
}
|
||||||
|
|
||||||
config, _, _, err := s.decoder.DecodeConfig(r.Body)
|
config, _, _, err := s.decoder.DecodeConfig(r.Body)
|
||||||
if err != nil && err != io.EOF { //Do not fail if body is empty.
|
if err != nil && err != io.EOF { // Do not fail if body is empty.
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ func (s *imageRouter) postImagesCreate(ctx context.Context, w http.ResponseWrite
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if image != "" { //pull
|
if image != "" { // pull
|
||||||
metaHeaders := map[string][]string{}
|
metaHeaders := map[string][]string{}
|
||||||
for k, v := range r.Header {
|
for k, v := range r.Header {
|
||||||
if strings.HasPrefix(k, "X-Meta-") {
|
if strings.HasPrefix(k, "X-Meta-") {
|
||||||
|
@ -76,7 +76,7 @@ func (s *imageRouter) postImagesCreate(ctx context.Context, w http.ResponseWrite
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
err = s.backend.PullImage(ctx, image, tag, platform, metaHeaders, authConfig, output)
|
err = s.backend.PullImage(ctx, image, tag, platform, metaHeaders, authConfig, output)
|
||||||
} else { //import
|
} else { // import
|
||||||
src := r.Form.Get("fromSrc")
|
src := r.Form.Get("fromSrc")
|
||||||
// 'err' MUST NOT be defined within this block, we need any error
|
// 'err' MUST NOT be defined within this block, we need any error
|
||||||
// generated from the download to be available to the output
|
// generated from the download to be available to the output
|
||||||
|
|
|
@ -211,7 +211,7 @@ func (pr *pluginRouter) createPlugin(ctx context.Context, w http.ResponseWriter,
|
||||||
if err := pr.backend.CreateFromContext(ctx, r.Body, options); err != nil {
|
if err := pr.backend.CreateFromContext(ctx, r.Body, options); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
//TODO: send progress bar
|
// TODO: send progress bar
|
||||||
w.WriteHeader(http.StatusNoContent)
|
w.WriteHeader(http.StatusNoContent)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ type ContainerAttachConfig struct {
|
||||||
// expectation is for the logger endpoints to assemble the chunks using this
|
// expectation is for the logger endpoints to assemble the chunks using this
|
||||||
// metadata.
|
// metadata.
|
||||||
type PartialLogMetaData struct {
|
type PartialLogMetaData struct {
|
||||||
Last bool //true if this message is last of a partial
|
Last bool // true if this message is last of a partial
|
||||||
ID string // identifies group of messages comprising a single record
|
ID string // identifies group of messages comprising a single record
|
||||||
Ordinal int // ordering of message in partial group
|
Ordinal int // ordering of message in partial group
|
||||||
}
|
}
|
||||||
|
|
|
@ -265,7 +265,7 @@ type ImagePullOptions struct {
|
||||||
// if the privilege request fails.
|
// if the privilege request fails.
|
||||||
type RequestPrivilegeFunc func() (string, error)
|
type RequestPrivilegeFunc func() (string, error)
|
||||||
|
|
||||||
//ImagePushOptions holds information to push images.
|
// ImagePushOptions holds information to push images.
|
||||||
type ImagePushOptions ImagePullOptions
|
type ImagePushOptions ImagePullOptions
|
||||||
|
|
||||||
// ImageRemoveOptions holds parameters to remove images.
|
// ImageRemoveOptions holds parameters to remove images.
|
||||||
|
|
|
@ -145,7 +145,7 @@ func (n NetworkMode) ConnectedContainer() string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
//UserDefined indicates user-created network
|
// UserDefined indicates user-created network
|
||||||
func (n NetworkMode) UserDefined() string {
|
func (n NetworkMode) UserDefined() string {
|
||||||
if n.IsUserDefined() {
|
if n.IsUserDefined() {
|
||||||
return string(n)
|
return string(n)
|
||||||
|
|
|
@ -154,7 +154,7 @@ func (args Args) Len() int {
|
||||||
func (args Args) MatchKVList(key string, sources map[string]string) bool {
|
func (args Args) MatchKVList(key string, sources map[string]string) bool {
|
||||||
fieldValues := args.fields[key]
|
fieldValues := args.fields[key]
|
||||||
|
|
||||||
//do not filter if there is no filter set or cannot determine filter
|
// do not filter if there is no filter set or cannot determine filter
|
||||||
if len(fieldValues) == 0 {
|
if len(fieldValues) == 0 {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
@ -200,7 +200,7 @@ func (args Args) Match(field, source string) bool {
|
||||||
// ExactMatch returns true if the source matches exactly one of the values.
|
// ExactMatch returns true if the source matches exactly one of the values.
|
||||||
func (args Args) ExactMatch(key, source string) bool {
|
func (args Args) ExactMatch(key, source string) bool {
|
||||||
fieldValues, ok := args.fields[key]
|
fieldValues, ok := args.fields[key]
|
||||||
//do not filter if there is no filter set or cannot determine filter
|
// do not filter if there is no filter set or cannot determine filter
|
||||||
if !ok || len(fieldValues) == 0 {
|
if !ok || len(fieldValues) == 0 {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
@ -213,7 +213,7 @@ func (args Args) ExactMatch(key, source string) bool {
|
||||||
// matches exactly the value.
|
// matches exactly the value.
|
||||||
func (args Args) UniqueExactMatch(key, source string) bool {
|
func (args Args) UniqueExactMatch(key, source string) bool {
|
||||||
fieldValues := args.fields[key]
|
fieldValues := args.fields[key]
|
||||||
//do not filter if there is no filter set or cannot determine filter
|
// do not filter if there is no filter set or cannot determine filter
|
||||||
if len(fieldValues) == 0 {
|
if len(fieldValues) == 0 {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ type Address struct {
|
||||||
// IPAM represents IP Address Management
|
// IPAM represents IP Address Management
|
||||||
type IPAM struct {
|
type IPAM struct {
|
||||||
Driver string
|
Driver string
|
||||||
Options map[string]string //Per network IPAM driver options
|
Options map[string]string // Per network IPAM driver options
|
||||||
Config []IPAMConfig
|
Config []IPAMConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue