mrutkows commented on a change in pull request #522: Check mandatory field 
Version and License
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/pull/522#discussion_r140278029
 
 

 ##########
 File path: parsers/manifest_parser.go
 ##########
 @@ -215,6 +215,29 @@ func (dm *YAMLParser) ComposePackage(pkg Package, 
packageName string, filePath s
        pub := false
        pag.Publish = &pub
 
+       //Version is a mandatory value
+       //If it is an empty string, it will be set to default value
+       //And print an warning message
+       if pkg.Version == "" {
+               warningString := wski18n.T("WARNING: Mandatory field Package 
Version must be set.\n")
+               whisk.Debug(whisk.DbgWarn, warningString)
+               warningString = wski18n.T("WARNING: Package Version is not 
saved in the current wskdeploy version.\n")
+               whisk.Debug(whisk.DbgWarn, warningString)
+               pkg.Version = "0.0.1"
+       }
+
+       //License is a mandatory value
+       //set license to unknown if it is an empty string
+       //And print an warning message
+       if pkg.License == "" {
+               warningString := wski18n.T("WARNING: Mandatory field Package 
License must be set.\n")
+               whisk.Debug(whisk.DbgWarn, warningString)
+               warningString = wski18n.T("WARNING: Package License is not 
saved in the current wskdeploy version.\n")
+               whisk.Debug(whisk.DbgWarn, warningString)
+               pkg.License = "unknown"
 
 Review comment:
   default should be 'unlicensed'; this was my mistake, should have referenced 
the spec. first before commenting on the issue.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to