From c6864289cb8a76528e1a7ddb4249cf964f31f6d8 Mon Sep 17 00:00:00 2001 From: Kota Kanbe Date: Tue, 14 Feb 2017 11:54:06 +0900 Subject: [PATCH] Fix error handling of detectOS --- scan/serverapi.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scan/serverapi.go b/scan/serverapi.go index c6662267d0..46945009b4 100644 --- a/scan/serverapi.go +++ b/scan/serverapi.go @@ -86,6 +86,8 @@ func detectOS(c config.ServerInfo) (osType osTypeInterface) { itsMe, osType, fatalErr = detectDebian(c) if fatalErr != nil { + osType.setErrs([]error{ + fmt.Errorf("Failed to detect OS: %s", fatalErr)}) return } @@ -282,7 +284,7 @@ func detectContainerOSesOnServer(containerHost osTypeInterface) (oses []osTypeIn copied.SetContainer(config.Container{ ContainerID: containerInfo.ContainerID, Name: containerInfo.Name, - Image: containerInfo.Image, + Image: containerInfo.Image, Type: containerHostInfo.Container.Type, }) os := detectOS(copied)