Closed smoser closed 1 year ago
Honestly this makes no sense:
ociPutBlob: called on types.StackerConfig{WorkDir:"", StackerDir:"/home/serge/sandbox/smoser4/.stacker", OCIDir:"/home/serge/sandbox/smoser4/oci", RootFSDir:"/home/serge/sandbox/smoser4/roots", Debug:false, StorageType:"overlay", EmbeddedFS:embed.FS{files:(*[]embed.file)(0x3482da0)}}
ociPutBlob: opened layout "/home/serge/sandbox/smoser4/oci"
ociPutBlob: calling putblob on &io.PipeReader{p:(*io.pipe)(0xc000701f80)}
error: copy to temporary blob: generate layer: unpriv.walk: unpriv.open: chmod +r: chmod /home/serge/sandbox/smoser4/roots/sha256_25c2c00faedd2c307ea94c1146337e8aabd53edc3085b0f26486f955ede5eb4d/overlay: function not implemented
We are opening the ${topdir}/oci as ocidir in umoci, then calling oci.PubBlob(), but it ends up trying to chown ${RootfsDir}/sha256_{blob}
Ok, yeah, so the problem is in pkg/overlay/pack.go:generateBlob(), we take in the target layerType. If we are building a tar layer, then we call umoci/oci/layer.GenerateInsertLayer(), if squash then mksquashfs. But if we are building a tar layer from a squashfs source layer, then the overlay/ dir where we start is a mountpoint. Now umoci tries to chmod the parent dir +r, which fails bc it's a mountpoint.
This only happens when we are re-building an intermediate layer - one which we already have as squash layer, but are now generating a tar layer for.
Easiest is probably to detect the situation (using IsMountpoint()) and then convert slightly differently.
Actually https://github.com/hallyn/umoci/commit/922fdb36e106b964c48d64d803e707564e45a179 fixes it for me
stacker version
v1.0.0-rc4-8e267fc
Describe the bug
Building the following stacker.yaml as root or non-root will fail with the stacktrace below. The problem is with trying to build a tar layer from a source layer that is only published as squashfs. You can avoid the problem by using
--layer-type=squashfs
stacker.yaml:
To reproduce
Expected behavior
No response
Additional context
No response