Close tarsplit gzip writer when creating tar-split.json.gz files during layer migration
Close tarsplit gzip writer when creating tar-split.json.gz files during layer migration

There is a missing call to Close on the gzip.Writer that is used to
compress newly created tar-split files during layer migration. This can
result in corrupt tar-split files that later cause docker push and
docker save to fail. The Close call is necessary to flush buffered data
to the stream.

Fixes: #20104

Signed-off-by: Aaron Lehmann <8ecfc6017a87905413dcd7d63696a2a4c351b604@docker.com>

ckeyer/docker,miminar/docker,jvanz/docker,yosifkit/docker,rremer/moby,scollier/docker,erikh/docker,rremer/moby,dsau/docker,sunyuan3/docker,KingEmet/docker,bdwill/docker.github.io,sanscontext/docker.github.io,medallia/docker,ripcurld0/moby,nguyentm83/docker,moul/docker,shubheksha/docker.github.io,isubuz/docker,KarthikNayak/docker,kunalkushwaha/docker,gschaetz/moby,mikedougherty/docker,mtanlee/docker,paralin/docker,allencloud/docker,mixja/docker,jvanz/docker,vdemeester/docker,tpounds/docker,eskaaren/docker,bluebreezecf/docker,Mashimiao/docker,JimGalasyn/docker.github.io,hypriot/docker,gjaskiewicz/moby,projectatomic/docker,ailispaw/docker,troy0820/docker.github.io,menglingwei/denverdino.github.io,Mashimiao/docker,davinashreddy/docker,thaJeztah/docker,flavio/docker,x1022as/docker,containers/storage,coreos/docker,13W/docker,yasiramin10p/moby,ailispaw/docker,inatatsu/docker,icecrime/docker,konstruktoid/docker-upstream,thaJeztah/docker.github.io,laijs/docker,mtesselH/docker,menglingwei/denverdino.github.io,afein/docker,harche/docker,allencloud/docker,gnailuy/docker,moby/moby,ripcurld0/moby,LuisBosquez/docker.github.io,mtrmac/docker,mahak/docker,Ramzec/docker,rkazak/docker,moul/docker,darrenstahlmsft/docker,tonistiigi/docker,amatsus/docker,bearstech/moby,nawawi/docker,contiv/docker,HuKeping/docker,endophage/docker,lixiaobing10051267/docker,danix800/docker.github.io,joeuo/docker.github.io,jzwlqx/denverdino.github.io,michelvocks/docker,zhuguihua/docker,denverdino/docker.github.io,Microsoft/docker,rillig/docker.github.io,coreos/docker,ibuildthecloud/docker,mahak/docker,Altiscale/docker,ColinHebert/docker,jimjag/docker,Mokolea/docker,geekylucas/docker,nghiant2710/docker,johnstep/docker.github.io,lixiaobing1/docker,pecameron/docker,prertik/docker,nghiant2710/docker,joaofnfernandes/docker.github.io,anweiss/docker.github.io,Mokolea/docker,michelvocks/docker,YujiOshima/docker,HideoYamauchi/docker,thaJeztah/docker.github.io,catinthesky/docker,qudongfang/docker,jimjag/docker,srust/docker,tophj-ibm/moby,mohmost12/docker,erikh/docker,mkumatag/docker,liaoqingwei/docker,brahmaroutu/docker,ffoysal/docker,ndeloof/docker,troy0820/docker.github.io,anujbahuguna/docker,darrenstahlmsft/moby,JimGalasyn/docker.github.io,yummypeng/docker,bfirsh/docker,AkihiroSuda/docker,mkumatag/docker,ZJU-SEL/docker,johnstep/docker.github.io,BenHall/docker,izarov/docker,nalind/docker,OnePaaS/docker,phiroict/docker,jc-m/docker,tianon/docker,ndeloof/docker,crosbymichael/docker,stevvooe/docker,dmcgowan/docker,14rcole/docker,yosifkit/docker,sunyuan3/docker,denverdino/docker.github.io,gdevillele/docker.github.io,runcom/docker,Syntaxide/docker,docker/docker,johnstep/docker.github.io,Shopify/docker,dmcgowan/docker,tagomoris/docker,darrenstahlmsft/moby,londoncalling/docker.github.io,rhatdan/docker,trebonian/docker,Tenk42/docker,wenchma/docker,jlhawn/docker,alexisbellido/docker.github.io,mstanleyjones/docker,tpounds/docker,jecarey/docker,docker-zh/docker.github.io,moxiegirl/docker,rillig/docker.github.io,bonczj/moby-json-file-logger,HackToday/docker,SvenDowideit/docker,cyli/docker,troy0820/docker.github.io,solganik/docker,isubuz/docker,mtrmac/docker,laijs/moby,Mashimiao/docker,jzwlqx/denverdino.github.io,scollier/docker,madhanrm/docker,TrumanLing/docker,afein/docker,mike1729/docker,bfirsh/docker,LuisBosquez/docker.github.io,jlebon/docker,rancher/docker,nguyentm83/docker,icaoweiwei/docker,POLJM242/docker,q384566678/docker,danyalKhaliq10p/moby,msabansal/docker,ColinHebert/docker,TheBigBear/docker,diogomonica/docker,alfred-landrum/docker,kolyshkin/moby,nalind/docker,gdevillele/docker.github.io,moul/docker,crosbymichael/docker,mixja/docker,KingEmet/docker,tpounds/docker,erikstmartin/docker,cr7pt0gr4ph7/docker,xiekeyang/docker,anortef/docker,mikebrow/docker,mtanlee/docker,cyphar/docker,shubheksha/docker.github.io,BenHall/docker,charleswhchan/docker,tianon/docker,duglin/docker,q384566678/docker,menglingwei/denverdino.github.io,pyotr777/docker,maxamillion/docker,gschaetz/moby,nawawi/docker,alexisbellido/docker.github.io,sunyuan3/docker,mgoelzer/docker,containers/storage,cr7pt0gr4ph7/docker,sarnautov/moby,jongiddy/docker,JimGalasyn/docker.github.io,duglin/docker,yongtang/docker,gnailuy/docker,hypriot/docker,Microsoft/docker,phiroict/docker,menglingwei/denverdino.github.io,pramodhkp/moby,aduermael/docker.github.io,tophj-ibm/docker,tkopczynski/docker,bfirsh/docker,shin-/docker.github.io,mathewkoshy493/docker,djs55/docker,dccurtis/docker,laijs/docker,mixja/docker,splunk/docker,shubheksha/docker.github.io,kolyshkin/docker,mtesselH/docker,Ramzec/docker,docker/docker.github.io,sanjeo/docker,jlhawn/docker,JimGalasyn/docker.github.io,yasiramin10p/moby,menglingwei/denverdino.github.io,KarthikNayak/docker,trebonian/docker,docker-zh/docker.github.io,sfsmithcha/docker,davinashreddy/docker,OnePaaS/docker,BSWANG/denverdino.github.io,YuPengZTE/docker,imkin/moby,pecameron/docker,cpuguy83/docker,moby/moby,dsau/docker,bonczj/moby-json-file-logger,endophage/docker,sterchelen/docker,shin-/docker.github.io,lixiaobing10051267/docker,mstanleyjones/docker,docker/docker.github.io,jecarey/docker,anweiss/docker.github.io,sanscontext/docker.github.io,rhardih/docker,justyntemme/docker,sanscontext/docker.github.io,dperny/docker,asbjornenge/docker,thtanaka/docker,imkin/moby,inatatsu/docker,mohmost12/docker,runcom/docker,jthelin/docker,runcom/docker,alexisbellido/docker.github.io,resin-io/docker,jzwlqx/denverdino.github.io,icecrime/docker,naveed-jamil-tenpearls/moby,michael-holzheu/docker,kencochrane/docker,mikedougherty/docker,13W/docker,davinashreddy/docker,docker/docker.github.io,sean-jc/docker,resin-io/docker,splunk/docker,sanjeo/docker,unclejack/docker,Shopify/docker,hustcat/docker,jc-m/docker,tklauser/docker,solganik/docker,jhorwit2/docker,yp-engineering/docker,gdevillele/docker.github.io,estesp/docker,pecameron/docker,paralin/docker,sfsmithcha/docker,AkihiroSuda/docker,kencochrane/docker,tophj-ibm/moby,SvenDowideit/docker,Tenk42/docker,cpuguy83/docker,mtrmac/docker,sdurrheimer/docker,londoncalling/docker.github.io,unclejack/docker,paralin/docker,q384566678/docker,amatsus/docker,cyli/docker,noxiouz/docker,umerazad/docker,johnstep/moby-moby,sterchelen/docker,jlebon/docker,phiroict/docker,dsheets/moby,ivansaracino/docker,vijaykilari/docker,sarnautov/moby,hustcat/docker,luxas/docker,catinthesky/docker,Shopify/docker,rhardih/docker,resin-io/docker,miminar/docker,joeuo/docker.github.io,LuisBosquez/docker.github.io,sheimi/docker,denverdino/denverdino.github.io,solganik/docker,abhinavdahiya/docker,OnePaaS/docker,portworx/docker,naveed-jamil-tenpearls/moby,eskaaren/docker,achanda/docker,umerazad/docker,cpuguy83/docker,alexisbellido/docker.github.io,phiroict/docker,whuwxl/docker,PatrickLang/moby,qudongfang/docker,fsoppelsa/docker,medallia/docker,dnephin/docker,tmp6154/docker,denverdino/denverdino.github.io,KarthikNayak/docker,sean-jc/docker,Syntaxide/docker,cyli/docker,zhuguihua/docker,containers/storage,konstruktoid/docker-upstream,sanscontext/docker.github.io,ZJUshuaizhou/docker,scotttlin/docker,kerneltime/docker,gjaskiewicz/moby,Altiscale/docker,raja-sami-10p/moby,toli/docker,troy0820/docker.github.io,thaJeztah/docker,haveatry/docker,trebonian/docker,denverdino/docker.github.io,danyalKhaliq10p/moby,dsau/docker,joaofnfernandes/docker.github.io,fcrisciani/docker,sarnautov/moby,dsheets/moby,michelvocks/docker,mtesselH/docker,darrenstahlmsft/docker,thtanaka/docker,LaynePeng/docker,ajaymdesai/docker,izarov/docker,danix800/docker.github.io,danix800/docker.github.io,nawawi/docker,pradipd/moby,gigidwan/docker,justincormack/docker,yasiramin10p/moby,denverdino/docker.github.io,trebonian/docker,vijaykilari/docker,yosifkit/docker,luxas/docker,shin-/docker.github.io,maxamillion/docker,rkazak/docker,TrumanLing/docker,laijs/moby,jwhonce/docker,dongjoon-hyun/docker,akira-baruah/docker,shhsu/docker,sean-jc/docker,rkazak/docker,mgoelzer/docker,gigidwan/docker,jc-m/docker,wenchma/docker,vdemeester/docker,akira-baruah/docker,BSWANG/denverdino.github.io,gnailuy/docker,TheBigBear/docker,docker/docker,JMesser81/docker,liaoqingwei/docker,rillig/docker.github.io,denverdino/denverdino.github.io,LuisBosquez/docker.github.io,willmtemple/docker,charleswhchan/docker,BenHall/docker,coreos/docker,sterchelen/docker,inatatsu/docker,xuxinkun/docker,dnephin/docker,mahak/docker,mtanlee/docker,prertik/docker,mgoelzer/docker,POLJM242/docker,BSWANG/denverdino.github.io,stevvooe/docker,ckeyer/docker,jwhonce/docker,bluebreezecf/docker,harche/docker,ripcurld0/moby,HackToday/docker,tonistiigi/docker,catinthesky/docker,anortef/docker,tklauser/docker,crosbymichael/docker,Mokolea/docker,noxiouz/docker,haveatry/docker,anweiss/docker.github.io,miminar/docker,rhatdan/storage,anujbahuguna/docker,contiv/docker,joeuo/docker.github.io,dsheets/moby,PatrickLang/moby,msabansal/docker,erikh/docker,shin-/docker.github.io,cyphar/docker,charleszheng44/moby,dccurtis/docker,moxiegirl/docker,icaoweiwei/docker,jlebon/docker,sanscontext/docker.github.io,xiekeyang/docker,achanda/docker,cnaize/docker,raja-sami-10p/moby,dgageot/docker,twaugh/docker,tkopczynski/docker,kolyshkin/moby,willmtemple/docker,pradipd/moby,portworx/docker,LaynePeng/docker,medallia/docker,bearstech/moby,rhatdan/storage,maxamillion/docker,gjaskiewicz/moby,moby/moby,ndeloof/docker,bluebreezecf/docker,yummypeng/docker,tmp6154/docker,justyntemme/docker,projectatomic/docker,prertik/docker,rancher/docker,michael-holzheu/docker,hustcat/docker,tophj-ibm/docker,xuxinkun/docker,estesp/docker,Ramzec/docker,stainboy/docker,toli/docker,JimGalasyn/docker.github.io,bdwill/docker.github.io,portworx/docker,justincormack/docker,nawawi/docker,shubheksha/docker.github.io,Altiscale/docker,yp-engineering/docker,vdemeester/docker,shubheksha/docker.github.io,joaofnfernandes/docker.github.io,thaJeztah/docker.github.io,abhinavdahiya/docker,brahmaroutu/docker,rhatdan/docker,13W/docker,brahmaroutu/docker,YujiOshima/docker,tagomoris/docker,thaJeztah/docker.github.io,konstruktoid/docker-1,docker/docker.github.io,noxiouz/docker,xiaods/docker,djs55/docker,aduermael/docker.github.io,sdurrheimer/docker,thaJeztah/docker,dongjoon-hyun/docker,shin-/docker.github.io,umerazad/docker,hqhq/moby,jongiddy/docker,ailispaw/docker,anweiss/docker.github.io,dccurtis/docker,naveed-jamil-tenpearls/moby,ajaymdesai/docker,joaofnfernandes/docker.github.io,ZJU-SEL/docker,danyalKhaliq10p/moby,bdwill/docker.github.io,x1022as/docker,YuPengZTE/docker,flavio/docker,denverdino/denverdino.github.io,kerneltime/docker,jameszhan/docker,lixiaobing1/docker,hypriot/docker,scotttlin/docker,konstruktoid/docker-upstream,whuwxl/docker,gdevillele/docker.github.io,charleszheng44/moby,flavio/docker,HideoYamauchi/docker,mkumatag/docker,abhinavdahiya/docker,isubuz/docker,ivansaracino/docker,icaoweiwei/docker,mikedougherty/docker,charleswhchan/docker,gnailuy/docker,rancher/docker,DoraALin/docker,tmp6154/docker,bearstech/moby,mahak/docker,Microsoft/docker,johnstep/docker.github.io,HuKeping/docker,pyotr777/docker,dims/docker,pyotr777/docker,yongtang/docker,kojiromike/docker,Ramzec/docker,charleszheng44/moby,Tenk42/docker,duglin/docker,darrenstahlmsft/moby,flavio/docker,BSWANG/denverdino.github.io,docker-zh/docker.github.io,laijs/moby,rhatdan/storage,achanda/docker,dongjoon-hyun/docker,stevvooe/docker,ColinHebert/docker,jzwlqx/denverdino.github.io,moypray/docker,Mokolea/docker,justincormack/docker,Morsicus/docker,HideoYamauchi/docker,13W/docker,gschaetz/moby,yosifkit/docker,splunk/docker,anortef/docker,geekylucas/docker,thtanaka/docker,fcrisciani/docker,konstruktoid/docker-1,rhatdan/docker,Morsicus/docker,SvenDowideit/docker,hqhq/moby,qudongfang/docker,vijaykilari/docker,icecrime/docker,JMesser81/docker,ffoysal/docker,HuKeping/docker,jwhonce/docker,nalind/docker,alexisbellido/docker.github.io,dgageot/docker,mikebrow/docker,yongtang/docker,joeuo/docker.github.io,stainboy/docker,cr7pt0gr4ph7/docker,sheimi/docker,sanjeo/docker,hqhq/moby,jameszhan/docker,erikstmartin/docker,johnstep/docker.github.io,jimjag/docker,bdwill/docker.github.io,BSWANG/denverdino.github.io,tophj-ibm/moby,kunalkushwaha/docker,imkin/moby,AkihiroSuda/docker,sheimi/docker,DoraALin/docker,cloudflare/docker,TrumanLing/docker,jvanz/docker,pramodhkp/moby,mathewkoshy493/docker,LuisBosquez/docker.github.io,mathewkoshy493/docker,nghiant2710/docker,haveatry/docker,tagomoris/docker,xiaods/docker,cnaize/docker,afein/docker,tkopczynski/docker,Morsicus/docker,alfred-landrum/docker,DoraALin/docker,docker/docker,estesp/docker,srust/docker,ibuildthecloud/docker,izarov/docker,mohmost12/docker,paralin/docker,sdurrheimer/docker,whuwxl/docker,lixiaobing10051267/docker,joeuo/docker.github.io,mike1729/docker,kerneltime/docker,13W/docker,rillig/docker.github.io,dperny/docker,luxas/docker,gdevillele/docker.github.io,jongiddy/docker,coolljt0725/docker,moul/docker,aduermael/docker.github.io,michael-holzheu/docker,pramodhkp/moby,LaynePeng/docker,harche/docker,14rcole/docker,ZJUshuaizhou/docker,xiekeyang/docker,cyphar/docker,alfred-landrum/docker,anujbahuguna/docker,kojiromike/docker,twaugh/docker,tklauser/docker,noironetworks/docker,darrenstahlmsft/docker,unclejack/docker,jhorwit2/docker,sfsmithcha/docker,diogomonica/docker,cloudflare/docker,jzwlqx/denverdino.github.io,zhuguihua/docker,twaugh/docker,kolyshkin/moby,msabansal/docker,docker-zh/docker.github.io,eskaaren/docker,ibuildthecloud/docker,dims/docker,thaJeztah/docker.github.io,dmcgowan/docker,errordeveloper/docker,TheBigBear/docker,bdwill/docker.github.io,joaofnfernandes/docker.github.io,gigidwan/docker,erikstmartin/docker,aduermael/docker.github.io,moypray/docker,ajaymdesai/docker,stainboy/docker,contiv/docker,shhsu/docker,kunalkushwaha/docker,denverdino/docker.github.io,konstruktoid/docker-upstream,nalind/docker,moypray/docker,dims/docker,tophj-ibm/docker,coolljt0725/docker,jthelin/docker,ZJUshuaizhou/docker,djs55/docker,ibuildthecloud/docker,madhanrm/docker,allencloud/docker,endophage/docker,jhorwit2/docker,wenchma/docker,raja-sami-10p/moby,JMesser81/docker,cpuguy83/docker,shishir-a412ed/docker,ckeyer/docker,lixiaobing1/docker,AkihiroSuda/docker,mike1729/docker,kolyshkin/docker,shishir-a412ed/docker,projectatomic/docker,coolljt0725/docker,londoncalling/docker.github.io,errordeveloper/docker,phiroict/docker,errordeveloper/docker,geekylucas/docker,moxiegirl/docker,jameszhan/docker,londoncalling/docker.github.io,asbjornenge/docker,ivansaracino/docker,tonistiigi/docker,scotttlin/docker,mikebrow/docker,kojiromike/docker,cnaize/docker,anweiss/docker.github.io,fcrisciani/docker,johnstep/moby-moby,YujiOshima/docker,kencochrane/docker,HackToday/docker,xuxinkun/docker,docker-zh/docker.github.io,thaJeztah/docker,dgageot/docker,rremer/moby,shishir-a412ed/docker,willmtemple/docker,johnstep/moby-moby,toli/docker,diogomonica/docker,ibuildthecloud/docker,docker/docker.github.io,bearstech/moby,KingEmet/docker,denverdino/denverdino.github.io,justyntemme/docker,srust/docker,dperny/docker,cloudflare/docker,yummypeng/docker,asbjornenge/docker,x1022as/docker,danix800/docker.github.io,jimjag/docker,mstanleyjones/docker,pradipd/moby,YuPengZTE/docker,dnephin/docker,amatsus/docker,londoncalling/docker.github.io,moby/moby,liaoqingwei/docker,PatrickLang/moby,madhanrm/docker,shhsu/docker,yp-engineering/docker,xiaods/docker,noironetworks/docker,laijs/docker,medallia/docker,jlhawn/docker,noironetworks/docker,bonczj/moby-json-file-logger,konstruktoid/docker-1,fsoppelsa/docker,ffoysal/docker,Syntaxide/docker,fsoppelsa/docker