[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:
Jan Rodák
2025-10-31 16:15:50 +01:00
parent f3a6457c8e
commit 6465c07d21
6 changed files with 290 additions and 36 deletions

View File

@@ -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",