diff --git a/stages/org.osbuild.ostree.pull b/stages/org.osbuild.ostree.pull index 79a324a8..3329abca 100755 --- a/stages/org.osbuild.ostree.pull +++ b/stages/org.osbuild.ostree.pull @@ -26,6 +26,10 @@ SCHEMA_2 = """ "repo": { "description": "Location of the OSTree repo.", "type": "string" + }, + "remote": { + "description": "Add the 'remote' to the ref spec", + "type": "string" } } }, @@ -65,12 +69,18 @@ def parse_input(inputs): def main(tree, inputs, options): source_repo, commits = parse_input(inputs) repo = options["repo"] + remote = options.get("remote") target = os.path.join(tree, repo.lstrip("/")) for commit, data in commits.items(): ref = data.get("ref", commit) + extra_args = [] + if remote: + extra_args.append(f'--remote={remote}') + ostree("pull-local", source_repo, ref, + *extra_args, repo=target) diff --git a/test/data/manifests/fedora-ostree-image.json b/test/data/manifests/fedora-ostree-image.json index 0267fea2..e908c00a 100644 --- a/test/data/manifests/fedora-ostree-image.json +++ b/test/data/manifests/fedora-ostree-image.json @@ -813,7 +813,8 @@ { "type": "org.osbuild.ostree.pull", "options": { - "repo": "/ostree/repo" + "repo": "/ostree/repo", + "remote": "osbuild" }, "inputs": { "commits": { diff --git a/test/data/manifests/fedora-ostree-image.mpp.json b/test/data/manifests/fedora-ostree-image.mpp.json index b06da6c6..0f165568 100644 --- a/test/data/manifests/fedora-ostree-image.mpp.json +++ b/test/data/manifests/fedora-ostree-image.mpp.json @@ -253,7 +253,8 @@ { "type": "org.osbuild.ostree.pull", "options": { - "repo": "/ostree/repo" + "repo": "/ostree/repo", + "remote": "osbuild" }, "inputs": { "commits": {