mirror of
https://github.com/containers/podman.git
synced 2026-07-10 23:35:04 -04:00
[v5.8] Add local artifact add API endpoint
Fixes: https://issues.redhat.com/browse/RUN-3385
Fixes: https://github.com/containers/podman/issues/26321
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
(cherry picked from commit 91af437471)
This commit is contained in:
@@ -84,6 +84,19 @@ class Artifact:
|
||||
os.remove(self.file.name)
|
||||
return r
|
||||
|
||||
def add_local(self) -> requests.Response:
|
||||
try:
|
||||
r = requests.post(
|
||||
self.uri + "/artifacts/local/add",
|
||||
params=self.parameters,
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if self.file is not None and os.path.exists(self.file.name):
|
||||
os.remove(self.file.name)
|
||||
return r
|
||||
|
||||
def do_artifact_inspect_request(self) -> requests.Response:
|
||||
r = requests.get(
|
||||
self.uri + "/artifacts/" + self.name + "/json",
|
||||
|
||||
Reference in New Issue
Block a user