sources/ostree: set contenturl when pulling from remote

If a contenturl is specified, the url is used only for metadata. This is
useful when the actual content is hosted separately.
This commit is contained in:
Sanne Raymaekers 2022-10-11 18:57:11 +02:00 committed by Christian Kellner
parent cc9d05c201
commit 925ca9b41e
9 changed files with 24 additions and 0 deletions

View file

@ -38,6 +38,10 @@ SCHEMA = """
"type": "string",
"description": "URL of the repository."
},
"contenturl": {
"type": "string",
"description": "content URL of the repository."
},
"gpgkeys": {
"type": "array",
"items": {
@ -107,6 +111,9 @@ class OSTreeSource(sources.SourceService):
if not gpg:
remote_add_args = ["--no-gpg-verify"]
if "contenturl" in remote:
remote_add_args.append(f"--contenturl={remote['contenturl']}")
if remote.get("secrets", {}).get("name") == "org.osbuild.rhsm.consumer":
secrets = Subscriptions.get_consumer_secrets()
remote_add_args.append(f"--set=\"tls-client-key-path={secrets['consumer_key']}\"")

View file

@ -0,0 +1,13 @@
{
"expects": "success",
"org.osbuild.ostree": {
"items": {
"d6243b0d0ca3dc2aaef2e0eb3e9f1f4836512c2921007f124b285f7c466464d8": {
"remote": {
"url": "http://localhost/sources/org.osbuild.ostree/data/meta",
"contenturl": "http://localhost/sources/org.osbuild.ostree/data/content"
}
}
}
}
}

View file

@ -0,0 +1,3 @@
[core]
repo_version=1
mode=archive-z2

View file

@ -0,0 +1 @@
d6243b0d0ca3dc2aaef2e0eb3e9f1f4836512c2921007f124b285f7c466464d8