mirror of https://github.com/docker/cli.git
Merge pull request #2661 from akerouanton/fix-service-formatter
Pretty service inspect fails when TaskTemplate.Resources is nil
This commit is contained in:
commit
5f979eeac2
|
@ -502,6 +502,9 @@ func (ctx *serviceInspectContext) ResourceLimitMemory() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ctx *serviceInspectContext) ResourceLimitPids() int64 {
|
func (ctx *serviceInspectContext) ResourceLimitPids() int64 {
|
||||||
|
if ctx.Service.Spec.TaskTemplate.Resources == nil || ctx.Service.Spec.TaskTemplate.Resources.Limits == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
return ctx.Service.Spec.TaskTemplate.Resources.Limits.Pids
|
return ctx.Service.Spec.TaskTemplate.Resources.Limits.Pids
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue