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']}\"")