MCPcopy Create free account
hub / github.com/containerd/nerdctl / UpdateExplicitlyStoppedLabel

Function UpdateExplicitlyStoppedLabel

pkg/containerutil/containerutil.go:117–122  ·  view source on GitHub ↗

UpdateExplicitlyStoppedLabel updates the "containerd.io/restart.explicitly-stopped" label of the container according to the value of explicitlyStopped.

(ctx context.Context, container containerd.Container, explicitlyStopped bool)

Source from the content-addressed store, hash-verified

115// UpdateExplicitlyStoppedLabel updates the "containerd.io/restart.explicitly-stopped"
116// label of the container according to the value of explicitlyStopped.
117func UpdateExplicitlyStoppedLabel(ctx context.Context, container containerd.Container, explicitlyStopped bool) error {
118 opt := containerd.WithAdditionalContainerLabels(map[string]string{
119 restart.ExplicitlyStoppedLabel: strconv.FormatBool(explicitlyStopped),
120 })
121 return container.Update(ctx, containerd.UpdateContainerOpts(opt))
122}
123
124// UpdateErrorLabel updates the "nerdctl/error"
125// label of the container according to the container error.

Callers 4

killContainerFunction · 0.92
runActionFunction · 0.92
StartFunction · 0.85
StopFunction · 0.85

Calls 1

UpdateMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…