MCPcopy
hub / github.com/containerd/containerd / WithImageStopSignal

Function WithImageStopSignal

client/container_opts.go:178–190  ·  view source on GitHub ↗

WithImageStopSignal sets a well-known containerd label (StopSignalLabel) on the container for storing the stop signal specified in the OCI image config

(image Image, defaultSignal string)

Source from the content-addressed store, hash-verified

176// on the container for storing the stop signal specified in the OCI image
177// config
178func WithImageStopSignal(image Image, defaultSignal string) NewContainerOpts {
179 return func(ctx context.Context, _ *Client, c *containers.Container) error {
180 if c.Labels == nil {
181 c.Labels = make(map[string]string)
182 }
183 stopSignal, err := GetOCIStopSignal(ctx, image, defaultSignal)
184 if err != nil {
185 return err
186 }
187 c.Labels[StopSignalLabel] = stopSignal
188 return nil
189 }
190}
191
192// WithSnapshotter sets the provided snapshotter for use by the container
193//

Callers

nothing calls this directly

Calls 1

GetOCIStopSignalFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…