You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
extractCmd:=parser.NewCommand("extract", "Run one or more extractors")
33
34
listCmd:=parser.NewCommand("list", "List plugins and known sections")
34
35
createCmd:=parser.NewCommand("create", "Create a compatibility artifact for the current host according to a definition")
36
+
checkCmd:=parser.NewCommand("check", "Check a manifest of container images / artifact pairs against a set of host fields")
35
37
36
38
// Shared arguments (likely this will break into check and extract, shared for now)
37
39
pluginNames:=parser.StringList("n", "name", &argparse.Options{Help: "One or more specific plugins to target names"})
38
40
39
41
// Extract arguments
40
42
filename:=extractCmd.String("o", "out", &argparse.Options{Help: "Save extraction to json file"})
41
43
44
+
// Check arguments
45
+
hostFields:=checkCmd.StringList("a", "append", &argparse.Options{Help: "Append one or more host fields to include in the check"})
46
+
manifestFile:=checkCmd.String("i", "in", &argparse.Options{Required: true, Help: "Input manifest list yaml that contains pairs of images and artifacts"})
47
+
42
48
// Create arguments
43
-
options:=parser.StringList("a", "append", &argparse.Options{Help: "One or more custom metadata fields to append"})
49
+
options:=parser.StringList("a", "append", &argparse.Options{Help: "Append one or more custom metadata fields to append"})
44
50
specname:=createCmd.String("i", "in", &argparse.Options{Required: true, Help: "Input yaml that contains spec for creation"})
45
51
specfile:=createCmd.String("o", "out", &argparse.Options{Help: "Save compatibility json artifact to this file"})
52
+
mediaType:=createCmd.String("m", "media-type", &argparse.Options{Help: "The expected media-type for the compatibility artifact"})
Note that if you provide (append) zero host fields with `-a` for each, you will basically get back the listing of ordered images.
204
+
The command logic and (very simple) algortithm works as follows.
205
+
206
+
1. Read in all entries from the list
207
+
2. Retrieve their artifacts, look for the "application/org.supercontainers.compspec" layer media type to identify it.
208
+
3. Retrieve it (within the application) and parse into the compatibility metadata
209
+
4. Create a flat graph with a node for each image, and annotations as the attributes
210
+
5. Search the graph based on the provided preferences
211
+
212
+
Note that the current prototype knows how to read in the manifest and print out the json. I am going to play around with graphs (and making a library) soon that we can use here.
0 commit comments