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

Support for multiple integration definitions #235

Merged
merged 2 commits into from
Nov 22, 2018

Conversation

lburgazzoli
Copy link
Contributor

Fixes #45

Copy link
Member

@nicolaferraro nicolaferraro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good, just few minor notes but the overall setting is ok!


if idx := strings.LastIndexByte(filename, os.PathSeparator); idx > -1 {
codeName = codeName[idx+1:]
} else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should print a better message saying that if you use multiple sources, the name becomes mandatory. Also, it's dangerous to call the integration "integration" (the old way) when there's no other info, because new integrations override old ones..

@@ -42,7 +43,7 @@ func (d *deploymentTrait) apply(e *environment) error {
return nil
}

e.Resources.Add(d.getConfigMapFor(e))
e.Resources.AddAll(d.getConfigMapFor(e))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

configMapsFor

// set env vars needed by the runtime
environment["JAVA_MAIN_CLASS"] = "org.apache.camel.k.jvm.Application"

// camel-k runtime
environment["CAMEL_K_ROUTES_URI"] = "inline:" + e.Integration.Spec.Source.Content
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appreciate 👍, I didn't like "inline:"!


for _, s := range e.Integration.Spec.Sources {
meta := metadata.Extract(s)
channels = append(channels, knativeutil.ExtractChannelNames(meta.FromURIs)...)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should consider adding to the meta package some functions to inpect all sources without iterating on them each time.. For the future..

//l = components.get('log')
//l.exchangeFormatter = function(e) {
// return "log - body=" + e.in.body + ", headers=" + e.in.headers
//}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intend to change this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no leftover of testing

public static Reader resolveInline(String uri) {
if (!uri.startsWith(SCHEME_INLINE)) {
public static Reader resolveEnv(String uri) {
if (!uri.startsWith(Constants.SCHEME_ENV)) {
throw new IllegalArgumentException("The provided content is not inline: " + uri);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

env

@lburgazzoli
Copy link
Contributor Author

@nicolaferraro done

Copy link
Member

@nicolaferraro nicolaferraro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@nicolaferraro nicolaferraro merged commit 3e9d907 into apache:master Nov 22, 2018
@lburgazzoli lburgazzoli deleted the github-45-multi-integrations branch November 22, 2018 13:51
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 this pull request may close these issues.

3 participants