csantanapr commented on a change in pull request #47: Unit Tests, Updated Signature, Go1.11 and Bash support, Better action-compiler and plenty of bug fix URL: https://github.com/apache/incubator-openwhisk-runtime-go/pull/47#discussion_r218230310
########## File path: common/gobuild.py.launcher.go ########## @@ -0,0 +1,119 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package main + +import ( + "bufio" + "bytes" + "encoding/json" + "fmt" + "io" + "log" + "os" +) + +func main() { + // debugging + var debug = os.Getenv("OW_DEBUG") != "" + + if debug { + filename := os.Getenv("OW_DEBUG") + f, err := os.OpenFile(filename, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) + if err == nil { + log.SetOutput(f) + defer f.Close() + } + log.Printf("ACTION ENV: %v", os.Environ()) + } + + // assign the main function + type Action func(event map[string]interface{}) map[string]interface{} + var action Action + action = Main + + // Params are the parameters sent to the action + type Params struct { + Value *map[string]interface{} `json:"value"` + Namespace string `json:"namespace"` Review comment: We should not hardcode the set of environment variables, other operator like public cloud multi-tenant would passing more environment variables, so the parsing of the json input should to take `value` as input params, and any other fields present if any treat them as environment variables by doing the upper case and appending the `__OW_` prefix. ---------------------------------------------------------------- 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
