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

Function Update

pkg/cmd/namespace/update.go:27–39  ·  view source on GitHub ↗
(ctx context.Context, client *containerd.Client, namespace string, options types.NamespaceUpdateOptions)

Source from the content-addressed store, hash-verified

25)
26
27func Update(ctx context.Context, client *containerd.Client, namespace string, options types.NamespaceUpdateOptions) error {
28 labelsArg := objectWithLabelArgs(options.Labels)
29 namespaces := client.NamespaceService()
30 if err := namespaceExists(ctx, namespaces, namespace); err != nil {
31 return err
32 }
33 for k, v := range labelsArg {
34 if err := namespaces.SetLabel(ctx, namespace, k, v); err != nil {
35 return err
36 }
37 }
38 return nil
39}

Callers 1

updateActionFunction · 0.92

Calls 2

objectWithLabelArgsFunction · 0.85
namespaceExistsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…