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:
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user