-
Notifications
You must be signed in to change notification settings - Fork 89
Payload from Trigger CronJob is not send to event.Data #102
Comments
Yes, nothing is wrong there. The cronjob trigger, by design, doesn't allow to modify the data to be sent, it's just a Let us know if you have some specific use case in mind for having this data. |
Hi @andresmgot Thank you for your answer. I will put more description of my use case because the purpose of the test example wast only to show missing transfer data from Trigger Cron to Function. In Kubeless I build a function that communicates with Kubernetes API and on-base what I thought that Trigger Cronjob has implemented such functionality, according to the documentions or I miss something. Thank you in advance for your reply |
ah, sorry @1Ricardo, you are correct, it's possible to set some data in the latest version of Kubeless. Are you running Kubeless v1.0.7 in your cluster? Also, is your trigger properly created? You can check it if you execute |
Hi @andresmgot I checked what you about asked: so to be sure that I use the latest version I check configmaps of kubeless ❯ kubectl get configmaps -n kubeless -o yaml
apiVersion: v1
items:
- apiVersion: v1
data:
builder-image: kubeless/function-image-builder:v1.0.7
... and here is result of ❯ kubectl get cronjobtrigger -n kbox test -o yaml
apiVersion: kubeless.io/v1beta1
kind: CronJobTrigger
metadata:
creationTimestamp: "2020-10-20T07:52:46Z"
finalizers:
- kubeless.io/cronjobtrigger
generation: 2
labels:
created-by: kubeless
name: test
namespace: kbox
resourceVersion: "23919434"
selfLink: /apis/kubeless.io/v1beta1/namespaces/kbox/cronjobtriggers/test
uid: b0ee8a64-8b36-47f0-ae92-b21eec5de46d
spec:
function-name: test
schedule: '*/1 * * * *' br |
Got it, I am able to reproduce it. It seems that the problem is that even if the CLI is able to parse the
When creating it, in the cluster, it loses the
Adding @delucca to the thread. You contributed this feature. Are you able to reproduce the issue? Would you mind taking a look? |
@andresmgot here is the commit where I've added the Since our workflow uses Gitops and we don't create resources directly from the CLI in our cluster, chances are that I forgot to test the deployment from the CLI directly to the cluster, and tested it only with the This week I'm deploying a new service, so I'll only be able to take a look at it in the weekend. If this issue is not time-sensitve I'll gladly fix it ;) |
I would like to ask you if there is any progress on that. Thank you in advance BR |
@1Ricardo as a workaround, you can edit your trigger and add the
...
spec:
function-name: test
schedule: '*/1 * * * *'
payload:
foo: bar |
Hi,
I noticed that
event.Data
is empty when it is triggered by payload of CronJob.I create my test function:
kubeless function deploy test -n kbox --runtime go1.14 --from-file test.go --handler test.Handler --dependencies go.mod
source of file test.go
then I created the Trigger cronjob:
kubeless trigger cronjob create -n kbox test --function test -f test.json --schedule "*/1 * * * *"
source of test.json
the logs from pod
test-6747bdf7b6-mz96f
show thatevent.Data
is emptyCan You please give me tip what I am doing wrong here.
Thank you in advance.
The text was updated successfully, but these errors were encountered: