@@ -19,15 +19,18 @@ var (
19
19
RunE : add ,
20
20
Args : cobra .MinimumNArgs (2 ),
21
21
ValidArgsFunction : common .AutocompleteArtifactAdd ,
22
- Example : `podman artifact add quay.io/myimage/myartifact:latest /tmp/foobar.txt` ,
23
- Annotations : map [string ]string {registry .EngineMode : registry .ABIMode },
22
+ Example : `podman artifact add quay.io/myimage/myartifact:latest /tmp/foobar.txt
23
+ podman artifact add --file-type text/yaml quay.io/myimage/myartifact:latest /tmp/foobar.yaml
24
+ podman artifact add --append quay.io/myimage/myartifact:latest /tmp/foobar.tar.gz` ,
25
+ Annotations : map [string ]string {registry .EngineMode : registry .ABIMode },
24
26
}
25
27
)
26
28
27
29
type artifactAddOptions struct {
28
30
ArtifactType string
29
31
Annotations []string
30
32
Append bool
33
+ FileType string
31
34
}
32
35
33
36
var (
@@ -51,6 +54,10 @@ func init() {
51
54
52
55
appendFlagName := "append"
53
56
flags .BoolVarP (& addOpts .Append , appendFlagName , "a" , false , "Append files to an existing artifact" )
57
+
58
+ fileTypeFlagName := "file-type"
59
+ flags .StringVarP (& addOpts .FileType , fileTypeFlagName , "" , "" , "Set file type to use for the artifact (layer)" )
60
+ _ = addCmd .RegisterFlagCompletionFunc (fileTypeFlagName , completion .AutocompleteNone )
54
61
}
55
62
56
63
func add (cmd * cobra.Command , args []string ) error {
@@ -63,6 +70,7 @@ func add(cmd *cobra.Command, args []string) error {
63
70
opts .Annotations = annots
64
71
opts .ArtifactType = addOpts .ArtifactType
65
72
opts .Append = addOpts .Append
73
+ opts .FileType = addOpts .FileType
66
74
67
75
report , err := registry .ImageEngine ().ArtifactAdd (registry .Context (), args [0 ], args [1 :], opts )
68
76
if err != nil {
0 commit comments