MCPcopy
hub / github.com/firecracker-microvm/firecracker-containerd / AddFrom

Method AddFrom

volume/set.go:82–88  ·  view source on GitHub ↗

AddFrom adds volumes from the given provider.

(_ context.Context, vp Provider)

Source from the content-addressed store, hash-verified

80
81// AddFrom adds volumes from the given provider.
82func (vs *Set) AddFrom(_ context.Context, vp Provider) error {
83 if _, exists := vs.providers[vp.Name()]; exists {
84 return fmt.Errorf("failed to add %q: %w", vp.Name(), errdefs.ErrAlreadyExists)
85 }
86 vs.providers[vp.Name()] = vp
87 return nil
88}
89
90func (vs *Set) copyToHostFromProvider(ctx context.Context, vp Provider) error {
91 dir, err := os.MkdirTemp(vs.tempDir, "copyToHostFromProvider")

Callers 3

TestNewSetFunction · 0.95
testVolumeFromFunction · 0.95

Calls 1

NameMethod · 0.65

Tested by 3

TestNewSetFunction · 0.76
testVolumeFromFunction · 0.76