зеркало из https://github.com/docker/engine-api.git
Merge pull request #63 from calavera/revert_pull_behavior
Revert "Moving Pull Behavior into engine-api to support docker pr#16609"
This commit is contained in:
Коммит
bdbab71ec2
|
@ -68,11 +68,14 @@ func imageBuildOptionsToQuery(options types.ImageBuildOptions) (url.Values, erro
|
|||
query.Set("forcerm", "1")
|
||||
}
|
||||
|
||||
if options.PullParent {
|
||||
query.Set("pull", "1")
|
||||
}
|
||||
|
||||
if !container.IsolationLevel.IsDefault(options.IsolationLevel) {
|
||||
query.Set("isolation", string(options.IsolationLevel))
|
||||
}
|
||||
|
||||
query.Set("pull", options.PullParent.String())
|
||||
query.Set("cpusetcpus", options.CPUSetCPUs)
|
||||
query.Set("cpusetmems", options.CPUSetMems)
|
||||
query.Set("cpushares", strconv.FormatInt(options.CPUShares, 10))
|
||||
|
|
|
@ -7,7 +7,6 @@ import (
|
|||
|
||||
"github.com/docker/engine-api/types/container"
|
||||
"github.com/docker/engine-api/types/filters"
|
||||
"github.com/docker/engine-api/types/image"
|
||||
"github.com/docker/go-units"
|
||||
)
|
||||
|
||||
|
@ -127,7 +126,7 @@ type ImageBuildOptions struct {
|
|||
NoCache bool
|
||||
Remove bool
|
||||
ForceRemove bool
|
||||
PullParent image.PullBehavior
|
||||
PullParent bool
|
||||
IsolationLevel container.IsolationLevel
|
||||
CPUSetCPUs string
|
||||
CPUSetMems string
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
package image
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// PullBehavior can be one of: never, always, or missing
|
||||
type PullBehavior int
|
||||
|
||||
// PullBehavior can be one of: never, always, or missing
|
||||
const (
|
||||
PullNever PullBehavior = iota
|
||||
PullAlways
|
||||
PullMissing
|
||||
)
|
||||
|
||||
// ParsePullBehavior validates and converts a string into a PullBehavior
|
||||
func ParsePullBehavior(pullVal string) (PullBehavior, error) {
|
||||
switch pullVal {
|
||||
case "never":
|
||||
return PullNever, nil
|
||||
case "always":
|
||||
return PullAlways, nil
|
||||
case "missing", "":
|
||||
return PullMissing, nil
|
||||
}
|
||||
return PullNever, fmt.Errorf("Invalid pull behavior '%s'", pullVal)
|
||||
}
|
||||
|
||||
// String returns a string representation of a PullBehavior
|
||||
func (p PullBehavior) String() string {
|
||||
switch p {
|
||||
case PullNever:
|
||||
return "never"
|
||||
case PullAlways:
|
||||
return "always"
|
||||
case PullMissing:
|
||||
return "missing"
|
||||
}
|
||||
return ""
|
||||
}
|
Загрузка…
Ссылка в новой задаче