mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
builder-next: explicitely ignore unhandled errors (errcheck)
``` builder/builder-next/adapters/containerimage/pull.go:278:23: Error return value of `resolveProgressDone` is not checked (errcheck) builder/builder-next/adapters/containerimage/pull.go:286:24: Error return value of `resolveProgressDone` is not checked (errcheck) builder/builder-next/adapters/containerimage/pull.go:303:24: Error return value of `resolveProgressDone` is not checked (errcheck) builder/builder-next/adapters/containerimage/pull.go:309:24: Error return value of `resolveProgressDone` is not checked (errcheck) builder/builder-next/adapters/containerimage/pull.go:315:22: Error return value of `resolveProgressDone` is not checked (errcheck) builder/builder-next/adapters/containerimage/pull.go:512:14: Error return value of `pw.Write` is not checked (errcheck) builder/builder-next/adapters/containerimage/pull.go:675:13: Error return value of `pw.Write` is not checked (errcheck) builder/builder-next/adapters/containerimage/pull.go:700:14: Error return value of `pw.Write` is not checked (errcheck) builder/builder-next/adapters/containerimage/pull.go:786:10: Error return value of `pw.Write` is not checked (errcheck) builder/builder-next/adapters/containerimage/pull.go:791:11: Error return value of `pw.Write` is not checked (errcheck) builder/builder-next/exporter/export.go:133:13: Error return value of `layersDone` is not checked (errcheck) builder/builder-next/exporter/export.go:163:12: Error return value of `configDone` is not checked (errcheck) builder/builder-next/exporter/export.go:172:11: Error return value of `tagDone` is not checked (errcheck) builder/builder-next/exporter/writer.go:207:10: Error return value of `pw.Write` is not checked (errcheck) builder/builder-next/exporter/writer.go:212:11: Error return value of `pw.Write` is not checked (errcheck) builder/builder-next/worker/worker.go:397:6: Error return value of `done` is not checked (errcheck) builder/builder-next/worker/worker.go:446:10: Error return value of `pw.Write` is not checked (errcheck) builder/builder-next/worker/worker.go:451:11: Error return value of `pw.Write` is not checked (errcheck) ``` Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
4e621a34ac
commit
e34c081354
4 changed files with 22 additions and 22 deletions
|
@ -275,7 +275,7 @@ func (p *puller) resolve(ctx context.Context) error {
|
|||
ref, err := distreference.ParseNormalizedNamed(p.src.Reference.String())
|
||||
if err != nil {
|
||||
p.resolveErr = err
|
||||
resolveProgressDone(err)
|
||||
_ = resolveProgressDone(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -283,7 +283,7 @@ func (p *puller) resolve(ctx context.Context) error {
|
|||
origRef, desc, err := p.resolver.Resolve(ctx, ref.String())
|
||||
if err != nil {
|
||||
p.resolveErr = err
|
||||
resolveProgressDone(err)
|
||||
_ = resolveProgressDone(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -300,19 +300,19 @@ func (p *puller) resolve(ctx context.Context) error {
|
|||
ref, err := distreference.WithDigest(ref, p.desc.Digest)
|
||||
if err != nil {
|
||||
p.resolveErr = err
|
||||
resolveProgressDone(err)
|
||||
_ = resolveProgressDone(err)
|
||||
return
|
||||
}
|
||||
_, dt, err := p.is.ResolveImageConfig(ctx, ref.String(), gw.ResolveImageConfigOpt{Platform: &p.platform, ResolveMode: resolveModeToString(p.src.ResolveMode)}, p.sm)
|
||||
if err != nil {
|
||||
p.resolveErr = err
|
||||
resolveProgressDone(err)
|
||||
_ = resolveProgressDone(err)
|
||||
return
|
||||
}
|
||||
|
||||
p.config = dt
|
||||
}
|
||||
resolveProgressDone(nil)
|
||||
_ = resolveProgressDone(nil)
|
||||
})
|
||||
return p.resolveErr
|
||||
}
|
||||
|
@ -509,7 +509,7 @@ func (p *puller) Snapshot(ctx context.Context) (cache.ImmutableRef, error) {
|
|||
tm := time.Now()
|
||||
end = &tm
|
||||
}
|
||||
pw.Write("extracting "+p.ID, progress.Status{
|
||||
_ = pw.Write("extracting "+p.ID, progress.Status{
|
||||
Action: "extract",
|
||||
Started: &st.st,
|
||||
Completed: end,
|
||||
|
@ -672,7 +672,7 @@ func showProgress(ctx context.Context, ongoing *jobs, cs content.Store, pw progr
|
|||
refKey := remotes.MakeRefKey(ctx, j.Descriptor)
|
||||
if a, ok := actives[refKey]; ok {
|
||||
started := j.started
|
||||
pw.Write(j.Digest.String(), progress.Status{
|
||||
_ = pw.Write(j.Digest.String(), progress.Status{
|
||||
Action: a.Status,
|
||||
Total: int(a.Total),
|
||||
Current: int(a.Offset),
|
||||
|
@ -685,7 +685,7 @@ func showProgress(ctx context.Context, ongoing *jobs, cs content.Store, pw progr
|
|||
info, err := cs.Info(context.TODO(), j.Digest)
|
||||
if err != nil {
|
||||
if containerderrors.IsNotFound(err) {
|
||||
// pw.Write(j.Digest.String(), progress.Status{
|
||||
// _ = pw.Write(j.Digest.String(), progress.Status{
|
||||
// Action: "waiting",
|
||||
// })
|
||||
continue
|
||||
|
@ -697,7 +697,7 @@ func showProgress(ctx context.Context, ongoing *jobs, cs content.Store, pw progr
|
|||
if done || j.done {
|
||||
started := j.started
|
||||
createdAt := info.CreatedAt
|
||||
pw.Write(j.Digest.String(), progress.Status{
|
||||
_ = pw.Write(j.Digest.String(), progress.Status{
|
||||
Action: "done",
|
||||
Current: int(info.Size),
|
||||
Total: int(info.Size),
|
||||
|
@ -783,13 +783,13 @@ func oneOffProgress(ctx context.Context, id string) func(err error) error {
|
|||
st := progress.Status{
|
||||
Started: &now,
|
||||
}
|
||||
pw.Write(id, st)
|
||||
_ = pw.Write(id, st)
|
||||
return func(err error) error {
|
||||
// TODO: set error on status
|
||||
now := time.Now()
|
||||
st.Completed = &now
|
||||
pw.Write(id, st)
|
||||
pw.Close()
|
||||
_ = pw.Write(id, st)
|
||||
_ = pw.Close()
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ func (e *imageExporterInstance) Export(ctx context.Context, inp exporter.Source)
|
|||
diffs[i] = digest.Digest(diffIDs[i])
|
||||
}
|
||||
|
||||
layersDone(nil)
|
||||
_ = layersDone(nil)
|
||||
}
|
||||
|
||||
if len(config) == 0 {
|
||||
|
@ -160,7 +160,7 @@ func (e *imageExporterInstance) Export(ctx context.Context, inp exporter.Source)
|
|||
if err != nil {
|
||||
return nil, configDone(err)
|
||||
}
|
||||
configDone(nil)
|
||||
_ = configDone(nil)
|
||||
|
||||
if e.opt.ReferenceStore != nil {
|
||||
for _, targetName := range e.targetNames {
|
||||
|
@ -169,7 +169,7 @@ func (e *imageExporterInstance) Export(ctx context.Context, inp exporter.Source)
|
|||
if err := e.opt.ReferenceStore.AddTag(targetName, digest.Digest(id), true); err != nil {
|
||||
return nil, tagDone(err)
|
||||
}
|
||||
tagDone(nil)
|
||||
_ = tagDone(nil)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -204,13 +204,13 @@ func oneOffProgress(ctx context.Context, id string) func(err error) error {
|
|||
st := progress.Status{
|
||||
Started: &now,
|
||||
}
|
||||
pw.Write(id, st)
|
||||
_ = pw.Write(id, st)
|
||||
return func(err error) error {
|
||||
// TODO: set error on status
|
||||
now := time.Now()
|
||||
st.Completed = &now
|
||||
pw.Write(id, st)
|
||||
pw.Close()
|
||||
_ = pw.Write(id, st)
|
||||
_ = pw.Close()
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
|
@ -394,7 +394,7 @@ func (ld *layerDescriptor) Download(ctx context.Context, progressOutput pkgprogr
|
|||
if err := contentutil.Copy(ctx, ld.w.ContentStore, ld.provider, ld.desc); err != nil {
|
||||
return nil, 0, done(err)
|
||||
}
|
||||
done(nil)
|
||||
_ = done(nil)
|
||||
|
||||
ra, err := ld.w.ContentStore.ReaderAt(ctx, ld.desc)
|
||||
if err != nil {
|
||||
|
@ -443,13 +443,13 @@ func oneOffProgress(ctx context.Context, id string) func(err error) error {
|
|||
st := progress.Status{
|
||||
Started: &now,
|
||||
}
|
||||
pw.Write(id, st)
|
||||
_ = pw.Write(id, st)
|
||||
return func(err error) error {
|
||||
// TODO: set error on status
|
||||
now := time.Now()
|
||||
st.Completed = &now
|
||||
pw.Write(id, st)
|
||||
pw.Close()
|
||||
_ = pw.Write(id, st)
|
||||
_ = pw.Close()
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue