From 85ff491b560351dc19c16d84a56027314b23bd97 Mon Sep 17 00:00:00 2001 From: Kirill Kapkov Date: Fri, 10 Apr 2026 12:04:58 +0100 Subject: [PATCH] =?UTF-8?q?Do=20not=20set=20gzipWriter.Name=20When=20dd=5F?= =?UTF-8?q?oci=5Fimage=20builds=20FIPS=20and=20non-FIPS=20variants,=20they?= =?UTF-8?q?=20get=20different=20target=20names=20(.fips.=20vs=20.internal.?= =?UTF-8?q?),=20which=20means=20the=20output=20filenames=20differ.=20The?= =?UTF-8?q?=20gzip=20blobs=20end=20up=204=20bytes=20apart=20in=20the=20hea?= =?UTF-8?q?der=20despite=20having=20byte-identical=20content,=20so=20the?= =?UTF-8?q?=20registry=20sees=20different=20SHA256=20digests=20and=20can't?= =?UTF-8?q?=20deduplicate=20them.=20The=20FNAME=20field=20is=20optional=20?= =?UTF-8?q?per=20RFC=201952,=20and=20Go's=20gzip.Writer=20omits=20it=20whe?= =?UTF-8?q?n=20Name=20is=20empty=20(the=20default).=20Nobody=20downstream?= =?UTF-8?q?=20reads=20it=20=E2=80=94=20OCI=20registries=20identify=20layer?= =?UTF-8?q?s=20by=20digest.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go/cmd/ocitool/createlayer_cmd.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/go/cmd/ocitool/createlayer_cmd.go b/go/cmd/ocitool/createlayer_cmd.go index df3adac..98c488c 100644 --- a/go/cmd/ocitool/createlayer_cmd.go +++ b/go/cmd/ocitool/createlayer_cmd.go @@ -7,7 +7,6 @@ import ( "fmt" "io" "os" - "path" "path/filepath" "slices" "strconv" @@ -44,7 +43,6 @@ func CreateLayerCmd(c *cli.Context) error { switch config.CompressionMethod { case "gzip": gzipWriter := gzip.NewWriter(wc) - gzipWriter.Name = path.Base(out.Name()) compressWriter = gzipWriter compressCloser = gzipWriter mediaType = ocispec.MediaTypeImageLayerGzip