MCPcopy
hub / github.com/containerd/containerd / Usage

Method Usage

client/image.go:181–201  ·  view source on GitHub ↗
(ctx context.Context, opts ...UsageOpt)

Source from the content-addressed store, hash-verified

179}
180
181func (i *image) Usage(ctx context.Context, opts ...UsageOpt) (int64, error) {
182 var config usageOptions
183 for _, opt := range opts {
184 if err := opt(&config); err != nil {
185 return 0, err
186 }
187 }
188
189 var usageOpts []usage.Opt
190 if config.manifestLimit != nil {
191 usageOpts = append(usageOpts, usage.WithManifestLimit(i.platform, *config.manifestLimit))
192 }
193 if config.snapshots {
194 usageOpts = append(usageOpts, usage.WithSnapshotters(i.client.SnapshotService))
195 }
196 if config.manifestOnly {
197 usageOpts = append(usageOpts, usage.WithManifestUsage())
198 }
199
200 return usage.CalculateImageUsage(ctx, i.i, i.client.ContentStore(), usageOpts...)
201}
202
203func (i *image) Config(ctx context.Context) (ocispec.Descriptor, error) {
204 provider := i.client.ContentStore()

Callers

nothing calls this directly

Calls 5

WithManifestLimitFunction · 0.92
WithSnapshottersFunction · 0.92
WithManifestUsageFunction · 0.92
CalculateImageUsageFunction · 0.92
ContentStoreMethod · 0.65

Tested by

no test coverage detected