Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameterization tutorial last step does not work #1855

Closed
oscar6echo opened this issue Apr 17, 2022 · 4 comments · Fixed by #1858
Closed

Parameterization tutorial last step does not work #1855

oscar6echo opened this issue Apr 17, 2022 · 4 comments · Fixed by #1858
Assignees
Labels
bug Something isn't working

Comments

@oscar6echo
Copy link

Describe the bug

Trigger template parameterization does not work.

To Reproduce
Follow the steps in tutorial https://argoproj.github.io/argo-events/tutorials/02-parameterization/#trigger-template-parameterization

In particular, update sensor:

kubectl -n argo-events apply -f https://raw.githubusercontent.com/argoproj/argo-events/stable/examples/tutorials/02-parameterization/sensor-05.yaml

Then test with curl:

curl -d '{"dependencyName":"test-dep", "dataKey": "body.message", "dest": "spec.arguments.parameters.0.value", "message": "amazing!!"}' -H "Content-Type: application/json" -X POST http://localhost:12000/example

Expected behavior

What is described in the tutorial ie.:

    ___________
    < amazing!! >
    -----------
    \
     \
      \
                    ##        .
              ## ## ##       ==
           ## ## ## ##      ===
       /""""""""""""""""___/ ===
    ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ /  ===- ~~~
       \______ o          __/
        \    \        __/
          \____\______/

What I see instead is the default message value:

    ___________
    < hello world !! >
    -----------
    \
     \
      \
                    ##        .
              ## ## ##       ==
           ## ## ## ##      ===
       /""""""""""""""""___/ ===
    ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ /  ===- ~~~
       \______ o          __/
        \    \        __/
          \____\______/

Environment (please complete the following information):

  • Kubernetes: v1.23.3
  • Argo: latest as of 16apr22
  • Argo Events: v1.6.3

Additional context

Then I fiddled around the sensor definition and tried:

apiVersion: argoproj.io/v1alpha1
kind: Sensor
metadata:
  name: webhook
spec:
  template:
    serviceAccountName: operate-workflow-sa
  dependencies:
    - name: test-dep
      eventSourceName: webhook
      eventName: example
  triggers:
    - template:
        name: webhook-workflow-trigger
        k8s:
          operation: create
          source:
            resource:
              apiVersion: argoproj.io/v1alpha1
              kind: Workflow
              metadata:
                generateName: webhook-
              spec:
                entrypoint: whalesay
                arguments:
                  parameters:
                    - name: message
                      value: toto
                templates:
                  - name: whalesay
                    inputs:
                      parameters:
                        - name: message
                    container:
                      image: docker/whalesay:latest
                      command: [cowsay]
                      args: ["{{inputs.parameters.message}}"]
          # parameters:
          #   - src:
          #       dependencyName: test-dep
          #       dataKey: body.message
          #     dest: spec.arguments.parameters.0.value
          parameters:
            - src:
                dependencyName: test-dep
                dataKey: THIS_WILL_BE_REPLACED
              dest: spec.arguments.parameters.0.value
            # - src:
            #     dependencyName: THIS_WILL_BE_REPLACED
            #     dataKey: THIS_WILL_BE_REPLACED
            #   dest: THIS_WILL_BE_REPLACED
        parameters:
          # - src:
          #     dependencyName: test-dep
          #     dataKey: body.dependencyName
          #   dest: parameters.0.src.dependencyName
          - src:
              dependencyName: test-dep
              dataKey: body.dataKey
            dest: parameters.0.src.dataKey
          # - src:
          #     dependencyName: test-dep
          #     dataKey: dest
          #   dest: parameters.0.dest

In this case the following curl:

curl -d '{ "dataKey": "body.message", "message": "amazing!!"}' -H "Content-Type: application/json" -X POST http://localhost:12000/example

yields the following result:

 _________________________________________ 
/ {"header":{"Accept":["*/*"],"Content-Le \
| ngth":["52"],"Content-Type":["applicati |
| on/json"],"User-Agent":["curl/7.68.0"]} |
| ,"body":{"dataKey":"body.message","mess |
\ age":"amazing!!"}}                      /
 ----------------------------------------- 
    \
     \
      \     
                    ##        .            
              ## ## ##       ==            
           ## ## ## ##      ===            
       /""""""""""""""""___/ ===        
  ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ /  ===- ~~~   
       \______ o          __/            
        \    \        __/             
          \____\______/   

So this bug seems at least loosely connected with that described in issue #1752
But it shows in the first steps the documentation tutorials.

Or did I miss something ?


Message from the maintainers:

If you wish to see this enhancement implemented please add a 👍 reaction to this issue! We often sort issues this way to know what to prioritize.

@oscar6echo oscar6echo added the bug Something isn't working label Apr 17, 2022
@juliev0
Copy link
Contributor

juliev0 commented Apr 18, 2022

@sarabala1979 Do you want to assign this to me?

@oscar6echo
Copy link
Author

Thank you for the swift correction !

@lsl-msft
Copy link
Contributor

Yeah I have met the same problem yesterday and the new change solved my problem. Thanks!

@juliev0
Copy link
Contributor

juliev0 commented Apr 21, 2022

sorry for the hassle! and thanks for pointing it out @oscar6echo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants