From 5bbc246e0c157216bebbe4c291f09b873b9394d1 Mon Sep 17 00:00:00 2001 From: lysu Date: Sun, 13 Jan 2019 16:58:11 +0800 Subject: [PATCH] address comment, check plugin name --- cmd/pluginpkg/pluginpkg.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/pluginpkg/pluginpkg.go b/cmd/pluginpkg/pluginpkg.go index fe646c6d78471..e1b1db5a3dba3 100644 --- a/cmd/pluginpkg/pluginpkg.go +++ b/cmd/pluginpkg/pluginpkg.go @@ -23,6 +23,7 @@ import ( "os/exec" "path" "path/filepath" + "strings" "text/template" "time" @@ -98,6 +99,10 @@ func main() { manifest["buildTime"] = time.Now().String() pluginName := manifest["name"].(string) + if strings.Contains(pluginName, "-") { + log.Printf("plugin name should not contain '-'\n") + os.Exit(1) + } if pluginName != filepath.Base(pkgDir) { log.Printf("plugin package must be same with plugin name in manifest file\n") os.Exit(1)