// manifestSchema1FromComponents builds a new manifestSchema1 from the supplied data. func manifestSchema1FromComponents(ref reference.Named, fsLayers []fsLayersSchema1, history []historySchema1, architecture string) genericManifest { var name, tag string if ref != nil { // Well, what to do if it _is_ nil? Most consumers actually don't use these fields nowadays, so we might as well try not supplying them. name = ref.RemoteName() if tagged, ok := ref.(reference.NamedTagged); ok { tag = tagged.Tag() } } return &manifestSchema1{ Name: name, Tag: tag, Architecture: architecture, FSLayers: fsLayers, History: history, SchemaVersion: 1, } }