1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Update compose-file to bc280351b9589b05c6da031d9f93c5c5d22db922

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
(cherry picked from commit b0903c9db0)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
This commit is contained in:
Vincent Demeester 2016-11-18 15:08:29 +01:00 committed by Victor Vieux
parent c8e2552827
commit f44e2dca56
5 changed files with 24 additions and 15 deletions

View file

@ -132,7 +132,7 @@ github.com/flynn-archive/go-shlex 3f9db97f856818214da2e1057f8ad84803971cff
github.com/docker/go-metrics 86138d05f285fd9737a99bee2d9be30866b59d72 github.com/docker/go-metrics 86138d05f285fd9737a99bee2d9be30866b59d72
# composefile # composefile
github.com/aanand/compose-file 8cff34df885ef07824138236bc4d27d359888b17 github.com/aanand/compose-file a70cb6ea5c403c383b5117dcd1dea78880a47824
github.com/mitchellh/mapstructure f3009df150dadf309fdee4a54ed65c124afad715 github.com/mitchellh/mapstructure f3009df150dadf309fdee4a54ed65c124afad715
github.com/xeipuuv/gojsonpointer e0fe6f68307607d540ed8eac07a342c33fa1b54a github.com/xeipuuv/gojsonpointer e0fe6f68307607d540ed8eac07a342c33fa1b54a
github.com/xeipuuv/gojsonreference e02fc20de94c78484cd5ffb007f8af96be030a45 github.com/xeipuuv/gojsonreference e02fc20de94c78484cd5ffb007f8af96be030a45

View file

@ -134,7 +134,7 @@ func GetUnsupportedProperties(configDetails types.ConfigDetails) []string {
func sortedKeys(set map[string]bool) []string { func sortedKeys(set map[string]bool) []string {
var keys []string var keys []string
for key, _ := range set { for key := range set {
keys = append(keys, key) keys = append(keys, key)
} }
sort.Strings(keys) sort.Strings(keys)
@ -467,6 +467,8 @@ func convertField(
switch fieldTag { switch fieldTag {
case "": case "":
return data, nil return data, nil
case "healthcheck":
return loadHealthcheck(data)
case "list_or_dict_equals": case "list_or_dict_equals":
return loadMappingOrList(data, "="), nil return loadMappingOrList(data, "="), nil
case "list_or_dict_colon": case "list_or_dict_colon":
@ -571,6 +573,13 @@ func loadShellCommand(value interface{}) (interface{}, error) {
return value, nil return value, nil
} }
func loadHealthcheck(value interface{}) (interface{}, error) {
if str, ok := value.(string); ok {
return append([]string{"CMD-SHELL"}, str), nil
}
return value, nil
}
func loadSize(value interface{}) (int64, error) { func loadSize(value interface{}) (int64, error) {
switch value := value.(type) { switch value := value.(type) {
case int: case int:

File diff suppressed because one or more lines are too long

View file

@ -32,7 +32,7 @@ func init() {
// Validate uses the jsonschema to validate the configuration // Validate uses the jsonschema to validate the configuration
func Validate(config map[string]interface{}) error { func Validate(config map[string]interface{}) error {
schemaData, err := Asset("data/config_schema_v3.json") schemaData, err := Asset("data/config_schema_v3.0.json")
if err != nil { if err != nil {
return err return err
} }

View file

@ -124,7 +124,7 @@ type DeployConfig struct {
} }
type HealthCheckConfig struct { type HealthCheckConfig struct {
Command []string `compose:"shell_command"` Test []string `compose:"healthcheck"`
Timeout string Timeout string
Interval string Interval string
Retries *uint64 Retries *uint64
@ -132,7 +132,7 @@ type HealthCheckConfig struct {
} }
type UpdateConfig struct { type UpdateConfig struct {
Parallelism uint64 Parallelism *uint64
Delay time.Duration Delay time.Duration
FailureAction string `mapstructure:"failure_action"` FailureAction string `mapstructure:"failure_action"`
Monitor time.Duration Monitor time.Duration