-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adapt to new ostree-container ociarchive #145
Comments
Options I can think of:
|
The semantics in this repo are slightly stricter, so I wouldn't just call the import function directly. Seems like the only shareable bit is the switch on the extension and using |
Something like diff --git a/coreos-ostree-importer/Dockerfile b/coreos-ostree-importer/Dockerfile
index 23b13c1..8c1a18f 100644
--- a/coreos-ostree-importer/Dockerfile
+++ b/coreos-ostree-importer/Dockerfile
@@ -11,7 +11,7 @@ RUN dnf update -y
RUN dnf -y install \
fedora-messaging \
python-requests \
- ostree \
+ rpm-ostree \
strace
# Configure a umask of 0002 which will allow for the group permissions
diff --git a/coreos-ostree-importer/coreos_ostree_importer.py b/coreos-ostree-importer/coreos_ostree_importer.py
index e80d7e8..15d3805 100755
--- a/coreos-ostree-importer/coreos_ostree_importer.py
+++ b/coreos-ostree-importer/coreos_ostree_importer.py
@@ -284,9 +284,14 @@ def untar_file_from_url(url: str, tmpdir: str, sha256sum: str):
if sha256sum != calcuatedsum:
raise Exception("Checksums do not match: " f"{sha256sum} != {calcuatedsum}")
- # Untar the file into the temporary directory
- with tarfile.open(filepath) as tar:
- tar.extractall(path=tmpdir)
+ if url.endswith(".ociarchive"):
+ runcmd(["ostree", "init", "--repo", tmpdir, "--mode=bare-user"])
+ runcmd(["rpm-ostree", "ex-container", "import", "--repo", tmpdir,
+ f"ostree-unverified-image:oci-archive:{filepath}"])
+ else:
+ # Assume tar and untar the file into the temporary directory
+ with tarfile.open(filepath) as tar:
+ tar.extractall(path=tmpdir)
def ostree_pull_local(srcrepo: str, dstrepo: str, branch: str, commit: str): ? |
seems reasonable to me |
hmm is |
FCOS rawhide is now producing archives in the new OCI format. We have to use `rpm-ostree ex-container import` to extract those. Closes: coreos#145
OK, threw it up in #146, though haven't tested it.
I based this off of https://github.com/coreos/coreos-assembler/blob/f5d003d2ebb81283c3e071ce2ac268884aa7232b/src/cosalib/cmdlib.py#L272-L275. There's a comment above about ex-container only writing to non-archive repos. |
ahh ok and pull-local between repos of different type works fine 👍 |
FCOS rawhide is now producing archives in the new OCI format. We have to use `rpm-ostree ex-container import` to extract those. Closes: coreos#145
FCOS rawhide is now producing archives in the new OCI format. We have to use `rpm-ostree ex-container import` to extract those. Closes: coreos#145
For coreos/fedora-coreos-tracker#812
https://jenkins-fedora-coreos.apps.ocp.ci.centos.org/job/fedora-coreos/job/fedora-coreos-fedora-coreos-pipeline/2919/
This is another copy of code like coreos/coreos-assembler#2487
The text was updated successfully, but these errors were encountered: