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)
| 115 | // UpdateExplicitlyStoppedLabel updates the "containerd.io/restart.explicitly-stopped" |
| 116 | // label of the container according to the value of explicitlyStopped. |
| 117 | func 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. |
no test coverage detected
searching dependent graphs…