lint: Move out config reloader context from controller struct

Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
Petu Eusebiu
2022-03-24 14:49:51 +02:00
committed by Ramkumar Chinchani
parent 353b0c6034
commit be910cf01c
17 changed files with 91 additions and 84 deletions
+7 -6
View File
@@ -115,7 +115,7 @@ func TestRunAlreadyRunningServer(t *testing.T) {
ctlr.Config.Storage.RootDirectory = globalDir
go func() {
if err := ctlr.Run(); err != nil {
if err := ctlr.Run(context.Background()); err != nil {
return
}
}()
@@ -135,7 +135,7 @@ func TestRunAlreadyRunningServer(t *testing.T) {
_ = ctlr.Server.Shutdown(ctx)
}()
err := ctlr.Run()
err := ctlr.Run(context.Background())
So(err, ShouldNotBeNil)
})
}
@@ -156,7 +156,7 @@ func TestObjectStorageController(t *testing.T) {
ctlr.Config.Storage.RootDirectory = "zot"
err := ctlr.Run()
err := ctlr.Run(context.Background())
So(err, ShouldNotBeNil)
})
@@ -770,7 +770,7 @@ func TestMultipleInstance(t *testing.T) {
},
}
ctlr := api.NewController(conf)
err := ctlr.Run()
err := ctlr.Run(context.Background())
So(err, ShouldEqual, errors.ErrImgStoreNotFound)
globalDir := t.TempDir()
@@ -3006,7 +3006,7 @@ func TestImageSignatures(t *testing.T) {
ctlr.Config.Storage.RootDirectory = dir
go func(controller *api.Controller) {
// this blocks
if err := controller.Run(); err != nil {
if err := controller.Run(context.Background()); err != nil {
return
}
}(ctlr)
@@ -4198,7 +4198,8 @@ func getAllManifests(imagePath string) []string {
func startServer(c *api.Controller) {
// this blocks
if err := c.Run(); err != nil {
ctx := context.Background()
if err := c.Run(ctx); err != nil {
return
}
}