Skip to content

Commit

Permalink
chore(camel-k): Improve Camel K integration modeline support
Browse files Browse the repository at this point in the history
- Make sure to properly handle array type property values
- Support volumes config
- Support connects config (service bindings)
- Switch to camel.properties trait config instead of property configuration
- Support trait addons
  • Loading branch information
christophd committed Jun 19, 2024
1 parent b14700e commit 4fe7721
Show file tree
Hide file tree
Showing 13 changed files with 254 additions and 301 deletions.

Large diffs are not rendered by default.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private void createKamelet(TestContext context) {

if (template != null) {
specBuilder.withTemplate(new TemplateBuilder()
.withAdditionalProperties(KubernetesSupport.yaml(new KameletValuePropertyMapper()).load(context.replaceDynamicContentInString(template)))
.withAdditionalProperties(KubernetesSupport.yaml().load(context.replaceDynamicContentInString(template)))
.build());
}

Expand Down Expand Up @@ -319,7 +319,7 @@ public Builder fromBuilder(KameletBuilder builder) {
}

if (kamelet.getSpec().getTemplate() != null) {
template = KubernetesSupport.yaml(new KameletValuePropertyMapper()).dumpAsMap(kamelet.getSpec().getTemplate());
template = KubernetesSupport.dumpYaml(kamelet.getSpec().getTemplate());
}

return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public void doExecute(TestContext context) {
}

if (YaksSettings.isLocal(clusterType(context))) {
createLocal(KubernetesSupport.yaml(new KameletBindingValuePropertyMapper()).dumpAsMap(binding), bindingName, context);
createLocal(KubernetesSupport.dumpYaml(binding), bindingName, context);
} else {
createKameletBinding(getKubernetesClient(), namespace(context), binding, context);
}
Expand All @@ -149,7 +149,7 @@ public void doExecute(TestContext context) {
*/
private void createKameletBinding(KubernetesClient k8sClient, String namespace, KameletBinding binding, TestContext context) {
if (LOG.isDebugEnabled()) {
LOG.debug(KubernetesSupport.yaml(new KameletBindingValuePropertyMapper()).dumpAsMap(binding));
LOG.debug(KubernetesSupport.dumpYaml(binding));
}

k8sClient.resources(KameletBinding.class, KameletBindingList.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void doExecute(TestContext context) {
}

if (YaksSettings.isLocal(clusterType(context))) {
createLocal(KubernetesSupport.yaml(new PipeValuePropertyMapper()).dumpAsMap(pipe), pipeName, context);
createLocal(KubernetesSupport.dumpYaml(pipe), pipeName, context);
} else {
createPipe(getKubernetesClient(), namespace(context), pipe, context);
}
Expand All @@ -148,7 +148,7 @@ public void doExecute(TestContext context) {
*/
private void createPipe(KubernetesClient k8sClient, String namespace, Pipe pipe, TestContext context) {
if (LOG.isDebugEnabled()) {
LOG.debug(KubernetesSupport.yaml(new PipeValuePropertyMapper()).dumpAsMap(pipe));
LOG.debug(KubernetesSupport.dumpYaml(pipe));
}

k8sClient.resources(Pipe.class, PipeList.class)
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private boolean findKamelet(String name, TestContext context, String ... namespa
LOG.debug(String.format("Kamelet '%s' is not present in namespace '%s'", name, namespace));
} else {
LOG.debug(String.format("Found Kamelet in namespace '%s'", namespace));
LOG.debug(KubernetesSupport.yaml(new KameletValuePropertyMapper()).dumpAsMap(kamelet));
LOG.debug(KubernetesSupport.dumpYaml(kamelet));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private void verifyKameletBinding(String namespace, String name, TestContext con
}

if (LOG.isDebugEnabled()) {
LOG.debug(KubernetesSupport.yaml(new KameletBindingValuePropertyMapper()).dumpAsMap(binding));
LOG.debug(KubernetesSupport.dumpYaml(binding));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private void verifyPipe(String namespace, String name, TestContext context) {
}

if (LOG.isDebugEnabled()) {
LOG.debug(KubernetesSupport.yaml(new PipeValuePropertyMapper()).dumpAsMap(pipe));
LOG.debug(KubernetesSupport.dumpYaml(pipe));
}
}

Expand Down
Loading

0 comments on commit 4fe7721

Please sign in to comment.