serverless / serverless-openwhisk

Adds Apache OpenWhisk support to the Serverless Framework!
http://openwhisk.org/
MIT License
143 stars 47 forks source link

Parameter Value with -(dash) is not correctly deploying #143

Open yakalra1 opened 5 years ago

yakalra1 commented 5 years ago

we are doing a serverless deploy and passing parameter values to it..and one of the value starts with -(dash), reading from environment properties of Deploy Job. But post deployment in parameters we see this value as true..rather than real value..

for eg - serverless deploy --CLOUDANT_API_KEY_VALUE $CLOUDANT_API_KEY where CLOUDANT_API_KEY is like -khu1232we And if i go to the parameters of my action, it shows value of CLOUDANT_API_KEY_VALUE as true.

I tried putting /(backslash) before the value with and without doublequotes, then it doesn't show true but adding some backslash.

jthomas commented 5 years ago

I'm unable to find where in the framework documentation this method of passing parameters is supported?

Reading the docs on variables, setting the env parameter CLOUDANT_API_KEY_VALUE in the shell allows you to import it into the serverless.yml as follows...

service: example

provider:
  name: openwhisk

functions:
  hello:
    handler: handler.hello
    parameters:
      CLOUDANT_API_KEY: ${env:CLOUDANT_API_KEY}

plugins:
  - serverless-openwhisk

Does this fix your issue?

yakalra1 commented 5 years ago

I am using the same way in serverless.yml, below is the example..but still issue is not resolved. Temporarily we are using the key that doesn't start with dash. But now again we have similar issue with some other variable. Do we have any solution to fix this?

service: service_name Sample serverless.yml provider: name: openwhisk runtime: nodejs:8 functions:

resources: packages: PACKAGE_NAME: parameters: CLOUDANT_APIKEY: ${opt:CLOUDANT_API_KEY_VALUE}

plugins:

yakalra1 commented 5 years ago

Just on top the above message, there is another observation that any value that has dash in it..is not getting deployed correctly and giving true value rather than actual value. For eg value - PG.J4XdPBYORf--8oMODZ0eVA.PGUnaGV8T-qymbIWEIe_ccV2UifQROFiEdC-JwIygYg