1
0
mirror of https://github.com/docker/cli.git synced 2026-01-23 15:21:32 +03:00

Allow marshalling of Compose config to JSON

Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
Joffrey F
2018-08-29 14:29:39 -07:00
parent 8ec21567a7
commit e7788d6f9a
9 changed files with 852 additions and 187 deletions

View File

@@ -222,7 +222,7 @@ func fromComposeServiceConfig(s composeTypes.ServiceConfig) v1beta2.ServiceConfi
ReadOnly: s.ReadOnly,
Secrets: fromComposeServiceSecrets(s.Secrets),
StdinOpen: s.StdinOpen,
StopGracePeriod: s.StopGracePeriod,
StopGracePeriod: composetypes.ConvertDurationPtr(s.StopGracePeriod),
Tmpfs: s.Tmpfs,
Tty: s.Tty,
User: userID,
@@ -285,8 +285,8 @@ func fromComposeHealthcheck(h *composeTypes.HealthCheckConfig) *v1beta2.HealthCh
}
return &v1beta2.HealthCheckConfig{
Test: h.Test,
Timeout: h.Timeout,
Interval: h.Interval,
Timeout: composetypes.ConvertDurationPtr(h.Timeout),
Interval: composetypes.ConvertDurationPtr(h.Interval),
Retries: h.Retries,
}
}

View File

@@ -10,7 +10,7 @@ import (
)
func TestWarnings(t *testing.T) {
duration := 5 * time.Second
duration := composetypes.Duration(5 * time.Second)
attempts := uint64(3)
config := &composetypes.Config{
Version: "3.4",
@@ -26,9 +26,9 @@ func TestWarnings(t *testing.T) {
DependsOn: []string{"ignored"},
Deploy: composetypes.DeployConfig{
UpdateConfig: &composetypes.UpdateConfig{
Delay: 5 * time.Second,
Delay: composetypes.Duration(5 * time.Second),
FailureAction: "rollback",
Monitor: 10 * time.Second,
Monitor: composetypes.Duration(10 * time.Second),
MaxFailureRatio: 0.5,
},
RestartPolicy: &composetypes.RestartPolicy{