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
Add --replace option to podman artifact add command
This commit implements the --replace functionality for the artifact add command,
allowing users to replace existing artifacts without having to manually remove
them first.
Changes made:
- Add Replace field to ArtifactAddOptions entity types
- Add --replace CLI flag with validation to prevent conflicts with --append
- Implement replace logic in ABI backend to remove existing artifacts before adding
- Update API handlers and tunnel implementation for podman-remote support
- Add comprehensive documentation and examples to man page
- Add e2e and system BATS tests for --replace functionality
- Fix code formatting in pkg/bindings/artifacts/types_pull_options.go:
* Reorder imports with proper spacing
* Fix function declaration spacing
* Convert spaces to proper tab indentation
* Remove extraneous blank lines
The --replace option follows the same pattern as other podman replace options
like 'podman container create --replace' and 'podman pod create --replace'.
It gracefully handles cases where no existing artifact exists (no error thrown).
Usage examples:
podman artifact add --replace quay.io/myimage/artifact:latest /path/to/file
podman artifact add --replace localhost/test/artifact /tmp/newfile.txt
Fixes: Implements requested --replace functionality for artifact add command
Signed-off-by: Daniel J Walsh <[email protected]>
Add an OCI artifact to the local store from the local filesystem. You must
12
12
provide at least one file to create the artifact, but several can also be
13
13
added.
14
14
15
+
Artifacts automatically include a creation timestamp in the
16
+
`org.opencontainers.image.created` annotation using RFC3339Nano format. When using
17
+
the `--append` option, the original creation timestamp is preserved.
18
+
15
19
16
20
## OPTIONS
17
21
18
22
@@option annotation.manifest
19
23
20
-
Note: Set annotations for each file being added.
24
+
@@option arch
21
25
22
-
#### **--append**, **-a**
26
+
#### **--append**
23
27
24
-
Append files to an existing artifact. This option cannot be used with the **--type** option.
28
+
Add files to an existing OCI Artifact. The default is **false**.
25
29
26
-
#### **--file-type**
30
+
#### **--artifact-type**
27
31
28
-
Set the media type of the artifact file instead of allowing detection to determine the type
32
+
Set the MIME type for the artifact config. This will be set in the media type of the artifact manifest. Setting the type for an artifact makes it easier to search and filter on the artifact type.
29
33
30
-
#### **--help**
34
+
#### **--file-type**
31
35
32
-
Print usage statement.
36
+
Set the MIME type for each of the added files. The default of the filesystem adds files as (application/octet-stream).
33
37
34
-
#### **--type**
38
+
#### **--replace**
35
39
36
-
Set a type for the artifact being added.
40
+
If an artifact with the same name already exists, replace and remove it. The default is **false**.
41
+
This option cannot be used with the **--append** option.
0 commit comments