@@ -116,6 +116,7 @@ type builderEngineBase struct {
116116 noUpload bool
117117 dumpManifest bool
118118 referrer bool
119+ tarExport bool
119120}
120121
121122func (e * builderEngineBase ) isGzipLayer (ctx context.Context , idx int ) (bool , error ) {
@@ -171,6 +172,7 @@ func (e *builderEngineBase) mediaTypeImageLayer() string {
171172}
172173
173174func (e * builderEngineBase ) uploadManifestAndConfig (ctx context.Context ) (specs.Descriptor , error ) {
175+ shouldUploadBlob := ! e .noUpload || e .tarExport
174176 cbuf , err := json .Marshal (e .config )
175177 if err != nil {
176178 return specs.Descriptor {}, err
@@ -180,7 +182,7 @@ func (e *builderEngineBase) uploadManifestAndConfig(ctx context.Context) (specs.
180182 Digest : digest .FromBytes (cbuf ),
181183 Size : (int64 )(len (cbuf )),
182184 }
183- if ! e . noUpload {
185+ if shouldUploadBlob {
184186 if err = uploadBytes (ctx , e .pusher , e .manifest .Config , cbuf ); err != nil {
185187 return specs.Descriptor {}, errors .Wrapf (err , "failed to upload config" )
186188 }
@@ -204,7 +206,7 @@ func (e *builderEngineBase) uploadManifestAndConfig(ctx context.Context) (specs.
204206 Digest : digest .FromBytes (cbuf ),
205207 Size : (int64 )(len (cbuf )),
206208 }
207- if ! e . noUpload {
209+ if shouldUploadBlob {
208210 if err = uploadBytes (ctx , e .pusher , manifestDesc , cbuf ); err != nil {
209211 return specs.Descriptor {}, errors .Wrapf (err , "failed to upload manifest" )
210212 }
0 commit comments