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:
parent
cc9d05c201
commit
925ca9b41e
9 changed files with 24 additions and 0 deletions
|
|
@ -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']}\"")
|
||||
|
|
|
|||
13
test/data/sources/org.osbuild.ostree/cases/contenturl.json
Normal file
13
test/data/sources/org.osbuild.ostree/cases/contenturl.json
Normal 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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3
test/data/sources/org.osbuild.ostree/data/meta/config
Normal file
3
test/data/sources/org.osbuild.ostree/data/meta/config
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[core]
|
||||
repo_version=1
|
||||
mode=archive-z2
|
||||
|
|
@ -0,0 +1 @@
|
|||
d6243b0d0ca3dc2aaef2e0eb3e9f1f4836512c2921007f124b285f7c466464d8
|
||||
Loading…
Add table
Add a link
Reference in a new issue