Skip to content

Commit

Permalink
Use the new luet-mtree event for upgrade checks
Browse files Browse the repository at this point in the history
We were using a bash script to call luet-mtree on upgrade to check for
valid mtree checksums.

luet-mtree 0.0.6 now supports working with events from luet itself,
which will do the same as the bash script and extract the image metadata
to check the mtree checksums.

This patch removes the old bash script and uses the luet-mtree plugin
directly to check the checksums, it also bumps luet-mtree to 0.0.6

Signed-off-by: Itxaka <[email protected]>
  • Loading branch information
Itxaka committed Jun 16, 2021
1 parent f4d250f commit 3bcbaf9
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 72 deletions.
4 changes: 2 additions & 2 deletions packages/cos/collection.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
packages:
- name: "cos"
category: "system"
version: "0.5.3+1"
version: "0.5.3+2"
brand_name: "cOS"
labels:
autobump.revdeps: "true"
autobump.revbump_related: "recovery/cos-img recovery/cos-squash"
- name: "cos"
category: "recovery"
version: "0.5.3+1"
version: "0.5.3+2"
brand_name: "cOS recovery"
labels:
autobump.revdeps: "true"
Expand Down
1 change: 0 additions & 1 deletion packages/installer/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ steps:
- cp -rfv installer.sh /usr/sbin/cos-installer && chmod +x /usr/sbin/cos-installer
- cp -rfv upgrade.sh /usr/sbin/cos-upgrade && chmod +x /usr/sbin/cos-upgrade
- cp -rfv reset.sh /usr/sbin/cos-reset && chmod +x /usr/sbin/cos-reset
- cp -rfv image-mtree-check.sh /usr/sbin/image-mtree-check && chmod +x /usr/sbin/image-mtree-check
62 changes: 0 additions & 62 deletions packages/installer/image-mtree-check.sh

This file was deleted.

4 changes: 2 additions & 2 deletions packages/installer/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,14 @@ upgrade() {

if [ -n "$CHANNEL_UPGRADES" ] && [ "$CHANNEL_UPGRADES" == true ]; then
if [ -z "$VERIFY" ]; then
args="--plugin image-mtree-check"
args="--enable-logfile --logfile /tmp/luet.log --plugin luet-mtree"
fi
luet install $args --system-target $TARGET --system-engine memory -y $UPGRADE_IMAGE
luet cleanup
else
args=""
if [ -z "$VERIFY" ]; then
args="--plugin image-mtree-check"
args="--enable-logfile --logfile /tmp/luet.log --plugin luet-mtree"
fi
luet util unpack $args $UPGRADE_IMAGE /usr/local/tmp/rootfs
rsync -aqzAX --exclude='mnt' --exclude='proc' --exclude='sys' --exclude='dev' --exclude='tmp' /usr/local/tmp/rootfs/ $TARGET
Expand Down
6 changes: 3 additions & 3 deletions packages/toolchain/luet-mtree/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ prelude:
{{end}}
- |
PACKAGE_VERSION=${PACKAGE_VERSION%\+*} && \
mkdir -p /luetbuild/go/src/github.com/rancher-sandbox && cd /luetbuild/go/src/github.com/rancher-sandbox && \
git clone https://github.com/rancher-sandbox/luet-mtree && cd luet-mtree && git checkout "v${PACKAGE_VERSION}" -b build
mkdir -p /luetbuild/go/src/github.com/{{ ( index .Values.labels "github.owner" ) }} && cd /luetbuild/go/src/github.com/{{ ( index .Values.labels "github.owner" ) }} && \
git clone https://github.com/{{ ( index .Values.labels "github.owner" ) }}/luet-mtree && cd luet-mtree && git checkout "v${PACKAGE_VERSION}" -b build
steps:
- |
PACKAGE_VERSION=${PACKAGE_VERSION%\+*} && \
cd /luetbuild/go/src/github.com/rancher-sandbox/luet-mtree && make build && mv bin/luet-mtree /usr/bin/luet-mtree
cd /luetbuild/go/src/github.com/{{ ( index .Values.labels "github.owner" ) }}/luet-mtree && make build && mv bin/luet-mtree /usr/bin/luet-mtree
includes:
- /usr/bin/luet-mtree
4 changes: 2 additions & 2 deletions packages/toolchain/luet-mtree/definition.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: "luet-mtree"
category: "toolchain"
version: 0.0.4+7
version: "0.0.7"
labels:
github.repo: "luet-mtree"
github.owner: "rancher-sandbox"
github.owner: "itxaka"
autobump.revdeps: "true"
autobump.revbump_related: "system/cos"
1 change: 1 addition & 0 deletions tests/upgrades-images-signed/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var _ = Describe("cOS Upgrade tests - Images signed", func() {
s.GatherLog("/tmp/image-mtree-check.log")
s.GatherLog("/tmp/luet_mtree_failures.log")
s.GatherLog("/tmp/luet_mtree.log")
s.GatherLog("/tmp/luet.log")
}
s.Reset()
})
Expand Down

0 comments on commit 3bcbaf9

Please sign in to comment.