-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Add PR based override for machine-os-content #21919
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| FROM fedora:29 AS build | ||
|
|
||
| COPY --from=registry.svc.ci.openshift.org/openshift/origin-v4.0:machine-os-content /srv/ /srv/ | ||
| RUN yum install -y ostree yum-utils selinux-policy-targeted && \ | ||
| commit=$( find /srv -name *.commit | sed -Ee 's|.*objects/(.+)/(.+)\.commit|\1\2|' | head -1 ) && \ | ||
| mkdir /tmp/working && cd /tmp/working && \ | ||
| yumdownloader --destdir=/tmp/rpms origin-node origin-clients && \ | ||
| for i in $(find /tmp/rpms/ -name origin-* -iname *.rpm); do echo "Extracting $i ..."; rpm2cpio $i | cpio -div; done && \ | ||
| mv etc usr/ && \ | ||
| ostree --repo=/srv/repo commit --parent=$commit --tree=ref=$commit --tree=dir=. --selinux-policy / \ | ||
| -s "origin-ci-dev overlay RPMs" --branch=origin-ci-dev | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So,
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well...that makes it a bit harder to find ostree unfortunately 😢
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, yeah. So was looking at
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ahh OK, so one final gotcha here is that we also need to do the for i in $(find /tmp/rpms/ -name origin-*); do rpm2cpio $i | cpio -div; done && \
mv etc usr/ && \
... |
||
|
|
||
| FROM scratch | ||
| COPY --from=build /srv/ /srv/ | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to include the previous tree too so that it's a complete OSTree. See similar code in rpm-ostree: https://github.com/projectatomic/rpm-ostree/blob/master/tests/vmcheck/overlay.sh. It's a mouthful, but essentially:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, just
ostree commit --tree=ref=<parent-tree> --tree=dir=.should work too.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, add --tree-ref
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--tree-ref=$commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--tree=ref=$commit --tree=dir=.will basically start off with the same tree as$commitand then overlay.on top of that.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Another minor thing:
--orphanand--branchare contradictory. We should probably error out on that. :) You can drop the--orphanand we can tweakpivotas mentioned to just default to the one branch that exists if there's nocom.coreos.ostree-commit)