MCPcopy Create free account
hub / github.com/linuxkit/linuxkit / WriteMetadataISO

Function WriteMetadataISO

src/cmd/linuxkit/metadata.go:11–19  ·  view source on GitHub ↗

WriteMetadataISO writes a metadata ISO file in a format usable by pkg/metadata

(path string, content []byte)

Source from the content-addressed store, hash-verified

9
10// WriteMetadataISO writes a metadata ISO file in a format usable by pkg/metadata
11func WriteMetadataISO(path string, content []byte) error {
12 outfh, err := os.OpenFile(path, os.O_CREATE|os.O_WRONLY, 0644)
13 if err != nil {
14 return err
15 }
16 defer func() { _ = outfh.Close() }()
17
18 return iso9660wrap.WriteBuffer(outfh, content, "config")
19}
20
21func metadataCreateCmd() *cobra.Command {
22 cmd := &cobra.Command{

Callers 2

metadataCreateCmdFunction · 0.85
CreateMetadataISOFunction · 0.85

Calls 1

CloseMethod · 0.45

Tested by

no test coverage detected