You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2020/01/15 21:33:53 UTC

[GitHub] [openwhisk-runtime-go] sciabarracom commented on a change in pull request #118: propagate openwhisk vars to the underlying process

sciabarracom commented on a change in pull request #118: propagate openwhisk vars to the underlying process
URL: https://github.com/apache/openwhisk-runtime-go/pull/118#discussion_r367118683
 
 

 ##########
 File path: openwhisk/actionProxy.go
 ##########
 @@ -71,7 +72,14 @@ func NewActionProxy(baseDir string, compiler string, outFile *os.File, errFile *
 
 //SetEnv sets the environment
 func (ap *ActionProxy) SetEnv(env map[string]interface{}) {
-	ap.env["__OW_API_HOST"] = os.Getenv("__OW_API_HOST")
+	// propagate all the variables starting with "__OW_"
+	for _, v := range os.Environ() {
+		if strings.HasPrefix(v, "__OW_") {
 
 Review comment:
   Because for example in Kubernetes environment variables are used for service discovery and this way an action could read them and get access to some informations that it is better they do not see. I do not know how the KubernetesFactory created action exectors but I guessed it was better to be safe and only propagate enviroment variables somewhat "marked" to be exposed. Is it a reason good enough?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services