From 81a78dbdbebdb9d67aa71043fd3053eba77e2ad0 Mon Sep 17 00:00:00 2001 From: Michael McCracken Date: Wed, 18 Dec 2024 16:52:57 -0800 Subject: [PATCH] chore: temp: move to atomfs with fixed umount do not merge. Signed-off-by: Michael McCracken --- cmd/stacker/internal_go.go | 7 ------- go.mod | 1 + go.sum | 4 ++-- test/atomfs.bats | 4 ++-- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/cmd/stacker/internal_go.go b/cmd/stacker/internal_go.go index 2e8fd992..c161c895 100644 --- a/cmd/stacker/internal_go.go +++ b/cmd/stacker/internal_go.go @@ -3,7 +3,6 @@ package main import ( "fmt" "os" - "path" "runtime" "strings" @@ -177,14 +176,8 @@ func doAtomfsMount(ctx *cli.Context) error { tag := ctx.Args().Get(0) mountpoint := ctx.Args().Get(1) - wd, err := os.Getwd() - if err != nil { - return errors.WithStack(err) - } - opts := atomfs.MountOCIOpts{ OCIDir: config.OCIDir, - MetadataPath: path.Join(wd, "atomfs-metadata"), Tag: tag, Target: mountpoint, AllowMissingVerityData: true, diff --git a/go.mod b/go.mod index 07d78cc2..c890c23b 100644 --- a/go.mod +++ b/go.mod @@ -289,5 +289,6 @@ require ( replace ( github.com/opencontainers/umoci => github.com/project-stacker/umoci v0.0.0-20240906174318-e9397ba4ced0 + machinerun.io/atomfs => github.com/mikemccracken/atomfs v0.0.0-20241219002031-7673e529b9cd stackerbuild.io/stacker-bom => github.com/project-stacker/stacker-bom v0.0.0-20240509203427-4d685e046780 ) diff --git a/go.sum b/go.sum index 67559557..be532ab9 100644 --- a/go.sum +++ b/go.sum @@ -684,6 +684,8 @@ github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKju github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/miekg/pkcs11 v1.1.1 h1:Ugu9pdy6vAYku5DEpVWVFPYnzV+bxB+iRdbuFSu7TvU= github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= +github.com/mikemccracken/atomfs v0.0.0-20241219002031-7673e529b9cd h1:78AivBFUMgHBX7W2tIKVQC5yJaDhiQujQcc/I6aJOpM= +github.com/mikemccracken/atomfs v0.0.0-20241219002031-7673e529b9cd/go.mod h1:cidyEmsNeeo+9f7OiHl/nA+8KS7Vj5XOslR87VkIebM= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/mistifyio/go-zfs/v3 v3.0.0 h1:J5QK618xRcXnQYZ2GE5FdmpS1ufIrWue+lR/mpe6/14= @@ -1592,8 +1594,6 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -machinerun.io/atomfs v1.1.1 h1:EprTiYMzAlKL+3S7woe9DsCJGwO2dkHTlvmjlVNO8pY= -machinerun.io/atomfs v1.1.1/go.mod h1:cidyEmsNeeo+9f7OiHl/nA+8KS7Vj5XOslR87VkIebM= modernc.org/libc v1.37.6 h1:orZH3c5wmhIQFTXF+Nt+eeauyd+ZIt2BX6ARe+kD+aw= modernc.org/libc v1.37.6/go.mod h1:YAXkAZ8ktnkCKaN9sw/UDeUVkGYJ/YquGO4FTi5nmHE= modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= diff --git a/test/atomfs.bats b/test/atomfs.bats index 47210361..75430215 100644 --- a/test/atomfs.bats +++ b/test/atomfs.bats @@ -103,7 +103,7 @@ EOF # first layer should still exist since a is still mounted manifest=$(cat oci/index.json | jq -r .manifests[0].digest | cut -f2 -d:) first_layer_hash=$(cat oci/blobs/sha256/$manifest | jq -r .layers[0].digest | cut -f2 -d:) - [ ! -b "/dev/mapper/$last_layer_hash-verity" ] + [ ! -b "/dev/mapper/$first_layer_hash-verity" ] mkdir c stacker internal-go atomfs mount c-squashfs c @@ -120,7 +120,7 @@ EOF # first layer should still exist since c is still mounted manifest=$(cat oci/index.json | jq -r .manifests[0].digest | cut -f2 -d:) first_layer_hash=$(cat oci/blobs/sha256/$manifest | jq -r .layers[0].digest | cut -f2 -d:) - [ ! -b "/dev/mapper/$last_layer_hash-verity" ] + [ ! -b "/dev/mapper/$first_layer_hash-verity" ] # c should still be ok [ -f c/c ]