@@ -141,7 +141,7 @@ func Service(
141141 Dir : service .WorkingDir ,
142142 User : service .User ,
143143 Mounts : mounts ,
144- StopGracePeriod : service .StopGracePeriod ,
144+ StopGracePeriod : composetypes . ConvertDurationPtr ( service .StopGracePeriod ) ,
145145 StopSignal : service .StopSignal ,
146146 TTY : service .Tty ,
147147 OpenStdin : service .StdinOpen ,
@@ -414,13 +414,13 @@ func convertHealthcheck(healthcheck *composetypes.HealthCheckConfig) (*container
414414
415415 }
416416 if healthcheck .Timeout != nil {
417- timeout = * healthcheck .Timeout
417+ timeout = time . Duration ( * healthcheck .Timeout )
418418 }
419419 if healthcheck .Interval != nil {
420- interval = * healthcheck .Interval
420+ interval = time . Duration ( * healthcheck .Interval )
421421 }
422422 if healthcheck .StartPeriod != nil {
423- startPeriod = * healthcheck .StartPeriod
423+ startPeriod = time . Duration ( * healthcheck .StartPeriod )
424424 }
425425 if healthcheck .Retries != nil {
426426 retries = int (* healthcheck .Retries )
@@ -458,11 +458,12 @@ func convertRestartPolicy(restart string, source *composetypes.RestartPolicy) (*
458458 return nil , errors .Errorf ("unknown restart policy: %s" , restart )
459459 }
460460 }
461+
461462 return & swarm.RestartPolicy {
462463 Condition : swarm .RestartPolicyCondition (source .Condition ),
463- Delay : source .Delay ,
464+ Delay : composetypes . ConvertDurationPtr ( source .Delay ) ,
464465 MaxAttempts : source .MaxAttempts ,
465- Window : source .Window ,
466+ Window : composetypes . ConvertDurationPtr ( source .Window ) ,
466467 }, nil
467468}
468469
@@ -476,9 +477,9 @@ func convertUpdateConfig(source *composetypes.UpdateConfig) *swarm.UpdateConfig
476477 }
477478 return & swarm.UpdateConfig {
478479 Parallelism : parallel ,
479- Delay : source .Delay ,
480+ Delay : time . Duration ( source .Delay ) ,
480481 FailureAction : source .FailureAction ,
481- Monitor : source .Monitor ,
482+ Monitor : time . Duration ( source .Monitor ) ,
482483 MaxFailureRatio : source .MaxFailureRatio ,
483484 Order : source .Order ,
484485 }
0 commit comments