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 2018/12/11 19:24:28 UTC

[GitHub] macdonst opened a new issue #143: Updating package parameters doesn't seem to take affect

macdonst opened a new issue #143: Updating package parameters doesn't seem to take affect
URL: https://github.com/apache/incubator-openwhisk-client-js/issues/143
 
 
   I'm attempting to update my package parameters while executing an action. Unfortunately, no matter what I try the parameters don't seem to be updated. 
   
   Here is some sample action code that illustrates the problem:
   
   ```
   const openwhisk = require('openwhisk');
   
   function extractPackageName(action) {
     return action.split('/')[2];
   }
   
   function main(params) {
     const ow = openwhisk();
     const packageName = extractPackageName(process.env['__OW_ACTION_NAME']);
       
     return ow.packages
       .get(packageName)
       .then(pack => {
           // a and b not in package
           console.log(pack);
           pack.parameters.a = 'a';
           pack.parameters.b = 'b';
           // a and b included in the package
           console.log(pack);
           return ow.packages
             .update(pack)
             .then(updatedPackage => {
               // a and b not in package
               console.log(updatedPackage);
               return {
                 ...params
               };
             })
             .catch(err => {
               return err;
             });
       })
       .catch(function(err) {
         return err;
       });
   }
   ```
   
   As well subsequent calls to this action do not show the updated `a` and `b` parameters I've attempted to add.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services