Переглянути джерело

daemon: remove intermediate var

The imgSvcConfig is defined locally, and discarded if an error occurs,
so no need to use the intermediate vars here.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 1 рік тому
батько
коміт
750c441dfd
1 змінених файлів з 1 додано та 3 видалено
  1. 1 3
      daemon/daemon.go

+ 1 - 3
daemon/daemon.go

@@ -1141,12 +1141,10 @@ func NewDaemon(ctx context.Context, config *config.Config, pluginStore *plugin.S
 			imgSvcConfig.Leases = d.containerdClient.LeasesService()
 			imgSvcConfig.ContentStore = d.containerdClient.ContentStore()
 		} else {
-			cs, lm, err := d.configureLocalContentStore(config.ContainerdNamespace)
+			imgSvcConfig.ContentStore, imgSvcConfig.Leases, err = d.configureLocalContentStore(config.ContainerdNamespace)
 			if err != nil {
 				return nil, err
 			}
-			imgSvcConfig.ContentStore = cs
-			imgSvcConfig.Leases = lm
 		}
 
 		// TODO: imageStore, distributionMetadataStore, and ReferenceStore are only