MCPcopy Create free account
hub / github.com/containerd/containerd / Labels

Method Labels

core/metadata/namespaces.go:81–97  ·  view source on GitHub ↗
(ctx context.Context, namespace string)

Source from the content-addressed store, hash-verified

79}
80
81func (s *namespaceStore) Labels(ctx context.Context, namespace string) (map[string]string, error) {
82 labels := map[string]string{}
83
84 bkt := getNamespaceLabelsBucket(s.tx, namespace)
85 if bkt == nil {
86 return labels, nil
87 }
88
89 if err := bkt.ForEach(func(k, v []byte) error {
90 labels[string(k)] = string(v)
91 return nil
92 }); err != nil {
93 return nil, err
94 }
95
96 return labels, nil
97}
98
99func (s *namespaceStore) SetLabel(ctx context.Context, namespace, key, value string) error {
100 if err := l.Validate(key, value); err != nil {

Callers

nothing calls this directly

Calls 1

getNamespaceLabelsBucketFunction · 0.85

Tested by

no test coverage detected