-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reflect changes in the pod trait
- Loading branch information
Showing
24 changed files
with
47,030 additions
and
86 deletions.
There are no files selected for viewing
5,133 changes: 5,133 additions & 0 deletions
5,133
config/crd/bases/camel.apache.org_integrations.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
5,388 changes: 5,388 additions & 0 deletions
5,388
config/crd/bases/camel.apache.org_kameletbindings.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
5,133 changes: 5,133 additions & 0 deletions
5,133
deploy/olm-catalog/camel-k-dev/1.4.0/camel.apache.org_integrations.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
5,388 changes: 5,388 additions & 0 deletions
5,388
deploy/olm-catalog/camel-k-dev/1.4.0/camel.apache.org_kameletbindings.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
5,133 changes: 5,133 additions & 0 deletions
5,133
deploy/olm-catalog/camel-k-dev/1.5.0-snapshot/camel.apache.org_integrations.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
5,388 changes: 5,388 additions & 0 deletions
5,388
deploy/olm-catalog/camel-k-dev/1.5.0-snapshot/camel.apache.org_kameletbindings.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4,528 changes: 4,528 additions & 0 deletions
4,528
docs/modules/ROOT/assets/attachments/schema/integration-schema.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
= Pod Trait | ||
|
||
// Start of autogenerated code - DO NOT EDIT! (description) | ||
The pod trait allows the customization of the Integration pods. | ||
It applies the `PodSpecTemplate` struct contained in the Integration `.spec.podTemplate` field, into the Integration deployment Pods template, using strategic merge patch. | ||
|
||
This can be used to customize the container where Camel routes execute, by using the `integration` container name. | ||
|
||
|
||
This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**. | ||
|
||
// End of autogenerated code - DO NOT EDIT! (description) | ||
// Start of autogenerated code - DO NOT EDIT! (configuration) | ||
== Configuration | ||
|
||
Trait properties can be specified when running any integration with the CLI: | ||
[source,console] | ||
---- | ||
$ kamel run --trait pod.[key]=[value] integration.groovy | ||
---- | ||
The following configuration options are available: | ||
|
||
[cols="2m,1m,5a"] | ||
|=== | ||
|Property | Type | Description | ||
|
||
| pod.enabled | ||
| bool | ||
| Can be used to enable or disable a trait. All traits share this common property. | ||
|
||
|=== | ||
|
||
// End of autogenerated code - DO NOT EDIT! (configuration) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// camel-k: language=groovy | ||
from('file:///var/log') | ||
.convertBodyTo(String.class) | ||
.routeId('groovy') | ||
.to('log:info') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
containers: | ||
- name: integration | ||
env: | ||
- name: TEST_VARIABLE | ||
value: pod_test_value | ||
volumeMounts: | ||
- name: var-logs | ||
mountPath: /var/log | ||
- name: sidecar-container | ||
image: busybox | ||
command: [ "/bin/sh" , "-c", "while true; do echo $(date -u) 'Content from the sidecar container' > /var/log/file.txt; sleep 1;done" ] | ||
|
||
resources: { } | ||
volumeMounts: | ||
- name: var-logs | ||
mountPath: /var/log | ||
volumes: | ||
- name: var-logs | ||
emptyDir: { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// +build integration | ||
|
||
// To enable compilation of this file in Goland, go to "Settings -> Go -> Vendoring & Build Tags -> Custom Tags" and add "integration" | ||
|
||
/* | ||
Licensed to the Apache Software Foundation (ASF) under one or more | ||
contributor license agreements. See the NOTICE file distributed with | ||
this work for additional information regarding copyright ownership. | ||
The ASF licenses this file to You under the Apache License, Version 2.0 | ||
(the "License"); you may not use this file except in compliance with | ||
the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package traits | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/apache/camel-k/e2e/support" | ||
camelv1 "github.com/apache/camel-k/pkg/apis/camel/v1" | ||
. "github.com/onsi/gomega" | ||
v1 "k8s.io/api/core/v1" | ||
) | ||
|
||
func TestPodTrait(t *testing.T) { | ||
WithNewTestNamespace(t, func(ns string) { | ||
name := "pod-template-test" | ||
Expect(Kamel("install", "-n", ns).Execute()).To(Succeed()) | ||
Expect(Kamel("run", "-n", ns, "files/PodTest.groovy", | ||
"--name", name, | ||
"--pod-template", "files/template.yaml", | ||
).Execute()).To(Succeed()) | ||
|
||
//check integration is deployed | ||
Eventually(IntegrationPodPhase(ns, name), TestTimeoutLong).Should(Equal(v1.PodRunning)) | ||
Eventually(IntegrationCondition(ns, name, camelv1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(v1.ConditionTrue)) | ||
|
||
//check that integrations is working and reading data created by sidecar container | ||
Eventually(IntegrationLogs(ns, name), TestTimeoutShort).Should(ContainSubstring("Content from the sidecar container")) | ||
pod := IntegrationPod(ns, name)() | ||
|
||
//check if ENV variable is applied | ||
envValue := getEnvVar("TEST_VARIABLE", pod.Spec) | ||
Expect(envValue).To(Equal("pod_test_value")) | ||
|
||
}) | ||
} | ||
|
||
func getEnvVar(name string, spec v1.PodSpec) string { | ||
for _, i := range spec.Containers[0].Env { | ||
if i.Name == name { | ||
return i.Value | ||
} | ||
} | ||
return "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.