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

Restore flow type as object? #1590

Closed
nicolaferraro opened this issue Jul 3, 2020 · 1 comment · Fixed by #1591
Closed

Restore flow type as object? #1590

nicolaferraro opened this issue Jul 3, 2020 · 1 comment · Fixed by #1591
Assignees

Comments

@nicolaferraro
Copy link
Member

I've seen now this commit @astefanutti : 1b95c5a

The flow type was "special" meaning that it allowed to create an integration like:

kind: Integration
apiVersion: camel.apache.org/v1
spec:
  flows:
  - from:
      uri: timer
      steps:
      - log:
        message: Hello

While, setting it as string the integration becomes "probably" like:

kind: Integration
apiVersion: camel.apache.org/v1
spec:
  flows:
  - |-
    from:
      uri: timer
      steps:
      - log:
        message: Hello

I don't think we have e2e tests (but we should add them). In terms of JSONSchema, it was an array of objects, now it's an array of strings.

The reason why this was important is because the Integration object was a unique YAML (also convertible to json) and when @lburgazzoli completes the YAML schema for validation, also the integration object can have autocompletion/verification by tooling.. And that is also more important for Kamelets..

Does the conversion to string affect everything as I've described @astefanutti ?

@astefanutti
Copy link
Member

Sorry, I failed to proactively warn you about this, but knew it would soon come back to haunt me :)

The previous type Flow map[string]interface{} was getting into the way of enabling CRD generation, and also leads to the question of schema validation.

I initially used type Flow json.RawMessage in 45bc5e9, and I fail to remember why I ultimately decided to go for type Flow string. I think it was just more convenient to use, without more context. While it worked, you're right it's not transparent from a schema standpoint.

I think using json.RawMessage or runtime.RawExtension should be less disruptive and enable to get back to what we had before.

More context can be found in kubernetes-sigs/controller-tools#294.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants