Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.
This repository was 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

@flavioschuindt

Description

@flavioschuindt

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions