WithSysctls sets the provided sysctls onto the spec
(sysctls map[string]string)
| 66 | |
| 67 | // WithSysctls sets the provided sysctls onto the spec |
| 68 | func WithSysctls(sysctls map[string]string) oci.SpecOpts { |
| 69 | return func(ctx context.Context, client oci.Client, c *containers.Container, s *specs.Spec) error { |
| 70 | if s.Linux == nil { |
| 71 | s.Linux = &specs.Linux{} |
| 72 | } |
| 73 | if s.Linux.Sysctl == nil { |
| 74 | s.Linux.Sysctl = make(map[string]string) |
| 75 | } |
| 76 | for k, v := range sysctls { |
| 77 | s.Linux.Sysctl[k] = v |
| 78 | } |
| 79 | return nil |
| 80 | } |
| 81 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…