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

Function namespaceExists

pkg/cmd/namespace/common.go:53–63  ·  view source on GitHub ↗

namespaceExists checks if the namespace exists

(ctx context.Context, store namespaces.Store, namespace string)

Source from the content-addressed store, hash-verified

51
52// namespaceExists checks if the namespace exists
53func namespaceExists(ctx context.Context, store namespaces.Store, namespace string) error {
54 nsList, err := store.List(ctx)
55 if err != nil {
56 return err
57 }
58 if slices.Contains(nsList, namespace) {
59 return nil
60 }
61
62 return fmt.Errorf("namespace %s: %w", namespace, errdefs.ErrNotFound)
63}

Callers 2

InspectFunction · 0.85
UpdateFunction · 0.85

Calls 1

ListMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…