Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

PHP Function returns junk if event->data has more than one key in the input payload #1246

Open
flavioschuindt opened this issue Aug 9, 2021 · 0 comments

Comments

@flavioschuindt
Copy link

flavioschuindt commented Aug 9, 2021

Is this a BUG REPORT or FEATURE REQUEST?: BUG REPORT

What happened: PHP Function returns junk if event->data has more than one key

What you expected to happen: PHP Function should return the proper output no matter the quantity of keys in the input data

How to reproduce it (as minimally and precisely as possible):

  • Create a simple function that echoes the input passed:
kubeless function deploy hello-php-data --runtime php7.4 --handler foo --from-file hellowithdata.php

hellowithdata.php:

<?php

function foo($event, $context) {
  return json_encode($event->data);
}
  • Call the function with a simple payload. It works:
kubeless function call hello-php-data --data '{"foo": "bar"}'                                                                                                                                                        
{"foo":"bar"}
  • Call the same function with an extra key/value in the input. It outputs junk, i.e., something in binary:
kubeless function call hello-php-data --data '{"foo": "bar", "a":"b"}'                                                                                                                                              
�VJ��W�RJJ,R�QJ��j��

Anything else we need to know?: Tested same type of function in other runtimes (python, ruby and nodejs) and both scenarios above worked fine.

Environment:

  • Kubernetes version (use kubectl version): 1.18.9
  • Kubeless version (use kubeless version): 1.0.8
  • Cloud provider or physical cluster: physical cluster
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant