diff --git a/pkg/api/rest/controller/software.go b/pkg/api/rest/controller/software.go index fd760d9..3c15f9d 100644 --- a/pkg/api/rest/controller/software.go +++ b/pkg/api/rest/controller/software.go @@ -155,12 +155,14 @@ func RegisterSoftware(c echo.Context) error { return common.ReturnErrorMsg(c, "Please provide the version") } - if softwareRegisterReq.OS == "" { - return common.ReturnErrorMsg(c, "Please provide the os") - } + if softwareRegisterReq.InstallType != "container" { + if softwareRegisterReq.OS == "" { + return common.ReturnErrorMsg(c, "Please provide the os") + } - if softwareRegisterReq.OSVersion == "" { - return common.ReturnErrorMsg(c, "Please provide the os version") + if softwareRegisterReq.OSVersion == "" { + return common.ReturnErrorMsg(c, "Please provide the os version") + } } if len(softwareRegisterReq.MatchNames) == 0 { diff --git a/pkg/api/rest/model/software.go b/pkg/api/rest/model/software.go index 0e33275..ef99608 100644 --- a/pkg/api/rest/model/software.go +++ b/pkg/api/rest/model/software.go @@ -11,6 +11,8 @@ func CheckInstallType(input string) error { switch input { case "package": fallthrough + case "container": + fallthrough case "script": return nil default: