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

Fix #1470: support inline YAML #1472

Merged
merged 3 commits into from
May 29, 2020
Merged

Conversation

nicolaferraro
Copy link
Member

Yaml can now be inlined in the integration spec (and it's the default behavior when running YAML files from CLI).

[nferraro@localhost camel-k]$ kamel run examples/routes.yaml -o yaml
apiVersion: camel.apache.org/v1
kind: Integration
metadata:
  creationTimestamp: null
  name: routes
  namespace: camel-flows
spec:
  flows:
  - from:
      parameters:
        period: "5000"
      steps:
      - set-body:
          constant: Hello Yaml !!!
      - transform:
          simple: ${body.toUpperCase()}
      - to: log:info
      uri: timer:tick
status: {}

And if you want to see the equivalent JSON output (JSON input is disabled for now):

[nferraro@localhost camel-k]$ kamel run examples/routes.yaml -o json
{
  "kind": "Integration",
  "apiVersion": "camel.apache.org/v1",
  "metadata": {
    "name": "routes",
    "namespace": "camel-flows",
    "creationTimestamp": null
  },
  "spec": {
    "flows": [
      {
        "from": {
          "parameters": {
            "period": "5000"
          },
          "steps": [
            {
              "set-body": {
                "constant": "Hello Yaml !!!"
              }
            },
            {
              "transform": {
                "simple": "${body.toUpperCase()}"
              }
            },
            {
              "to": "log:info"
            }
          ],
          "uri": "timer:tick"
        }
      }
    ]
  },
  "status": {}
}

Release Note

Camel YAML/JSON DSL can now be inlined with the integration custom resource

@nicolaferraro nicolaferraro added the kind/feature New feature or request label May 27, 2020
@lburgazzoli
Copy link
Contributor

lburgazzoli commented May 27, 2020

have the inspectors being updated ? or is it not needed ?

@nicolaferraro
Copy link
Member Author

It's currently turned into a generated source, that was already picket by inspectors..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants