This is an automated email from the ASF dual-hosted git repository. cdeppisch pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/main by this push: new 7ee129afc (#5489) Use yaml in e2e common 7ee129afc is described below commit 7ee129afcd7ee53b4f25f5dab1ecc55689b1f2cd Author: Thomas Diesler <tdies...@redhat.com> AuthorDate: Thu May 16 16:59:19 2024 +0200 (#5489) Use yaml in e2e common --- .../cli/files/resource-file-location-route.groovy | 20 --- e2e/common/config/config_reload_test.go | 8 +- e2e/common/config/config_test.go | 181 +++++++++++++++++---- .../config/files/build-property-file-route.groovy | 21 --- .../config/files/build-property-file-route.yaml | 23 +++ .../config/files/build-property-route.groovy | 21 --- e2e/common/config/files/build-property-route.yaml | 23 +++ .../files/config-configmap-properties-route.groovy | 21 --- .../files/config-configmap-properties-route.yaml | 23 +++ .../config/files/config-configmap-route.groovy | 23 --- .../config/files/config-configmap-route.yaml | 25 +++ e2e/common/config/files/config-file-route.groovy | 23 --- .../config/files/config-secret-key-route.groovy | 22 --- .../config/files/config-secret-key-route.yaml | 25 +++ e2e/common/config/files/config-secret-route.groovy | 23 --- e2e/common/config/files/config-secret-route.yaml | 25 +++ e2e/common/config/files/property-file-route.groovy | 21 --- e2e/common/config/files/property-file-route.yaml | 23 +++ e2e/common/config/files/property-route.groovy | 21 --- e2e/common/config/files/property-route.yaml | 23 +++ .../config/files/property-secret-route.groovy | 21 --- e2e/common/config/files/property-secret-route.yaml | 23 +++ .../resource-configmap-key-location-route.groovy | 20 --- .../resource-configmap-key-location-route.yaml | 23 +++ .../files/resource-configmap-location-route.groovy | 20 --- .../files/resource-configmap-location-route.yaml | 23 +++ .../config/files/resource-configmap-route.groovy | 20 --- .../config/files/resource-configmap-route.yaml | 23 +++ .../resource-file-base64-encoded-route.groovy | 23 --- .../config/files/resource-file-binary-route.groovy | 22 --- .../files/resource-file-location-route.groovy | 20 --- e2e/common/config/files/resource-file-route.groovy | 20 --- .../config/files/resource-secret-route.groovy | 20 --- e2e/common/config/files/resource-secret-route.yaml | 23 +++ e2e/common/traits/files/PodTest.groovy | 22 --- e2e/common/traits/files/PodTest.yaml | 23 +++ e2e/common/traits/files/openapi/petstore.groovy | 29 ---- e2e/common/traits/files/openapi/petstore.yaml | 37 +++++ e2e/common/traits/openapi_test.go | 2 +- e2e/common/traits/pod_test.go | 2 +- 40 files changed, 524 insertions(+), 487 deletions(-) diff --git a/e2e/common/cli/files/resource-file-location-route.groovy b/e2e/common/cli/files/resource-file-location-route.groovy deleted file mode 100644 index 076a2a9c7..000000000 --- a/e2e/common/cli/files/resource-file-location-route.groovy +++ /dev/null @@ -1,20 +0,0 @@ -// camel-k: language=groovy -/* - * 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. - */ - -from('file:/tmp/?fileName=file.txt&noop=true&idempotent=false') - .log('resource file content is: ${body}') diff --git a/e2e/common/config/config_reload_test.go b/e2e/common/config/config_reload_test.go index 7b5cf9d70..f829c8589 100644 --- a/e2e/common/config/config_reload_test.go +++ b/e2e/common/config/config_reload_test.go @@ -53,7 +53,7 @@ func TestConfigmapHotReload(t *testing.T) { cmData["my-configmap-key"] = "my configmap content" CreatePlainTextConfigmapWithLabels(t, ctx, ns, "my-hot-cm", cmData, map[string]string{"camel.apache.org/integration": "test"}) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/config-configmap-route.groovy", + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/config-configmap-route.yaml", "--config", "configmap:my-hot-cm", "-t", "mount.hot-reload=true", "--name", name).Execute()).To(Succeed()) @@ -84,7 +84,7 @@ func TestConfigmapHotReloadDefault(t *testing.T) { cmData["my-configmap-key"] = "my configmap content" CreatePlainTextConfigmapWithLabels(t, ctx, ns, "my-hot-cm-2", cmData, map[string]string{"camel.apache.org/integration": "test"}) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/config-configmap-route.groovy", + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/config-configmap-route.yaml", "--config", "configmap:my-hot-cm-2", "--name", name).Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, name), TestTimeoutLong).Should(Equal(corev1.PodRunning)) @@ -114,7 +114,7 @@ func TestSecretHotReload(t *testing.T) { secData["my-secret-key"] = "very top secret" CreatePlainTextSecretWithLabels(t, ctx, ns, "my-hot-sec", secData, map[string]string{"camel.apache.org/integration": "test"}) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/config-secret-route.groovy", + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/config-secret-route.yaml", "--config", "secret:my-hot-sec", "-t", "mount.hot-reload=true", "--name", name).Execute()).To(Succeed()) @@ -149,7 +149,7 @@ func CheckConfigmapWithOwnerRef(t *testing.T, hotreload bool) { name := RandomizedSuffixName("config-configmap-route") cmName := RandomizedSuffixName("my-hot-cm-") - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/config-configmap-route.groovy", + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/config-configmap-route.yaml", "--config", "configmap:"+cmName, "--name", name, "-t", "mount.hot-reload="+strconv.FormatBool(hotreload)).Execute()).To(Succeed()) diff --git a/e2e/common/config/config_test.go b/e2e/common/config/config_test.go index 4029285f1..aa191b73d 100644 --- a/e2e/common/config/config_test.go +++ b/e2e/common/config/config_test.go @@ -46,88 +46,130 @@ func TestRunConfigExamples(t *testing.T) { g.Eventually(SelectedPlatformPhase(t, ctx, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady)) + /* + kamel run --dev -p my.message=test-property ./e2e/common/config/files/property-route.yaml + */ + t.Run("Simple property", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/property-route.groovy", "-p", "my.message=test-property").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/property-route.yaml", "-p", "my.message=test-property").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "property-route"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "property-route", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "property-route"), TestTimeoutShort).Should(ContainSubstring("test-property")) g.Expect(Kamel(t, ctx, "delete", "property-route", "-n", ns).Execute()).To(Succeed()) }) + /* + kamel run --dev -p file:./e2e/common/config/files/my.properties ./e2e/common/config/files/property-file-route.yaml + */ + t.Run("Property file", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/property-file-route.groovy", "--property", "file:./files/my.properties").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/property-file-route.yaml", "--property", "file:./files/my.properties").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "property-file-route"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "property-file-route", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "property-file-route"), TestTimeoutShort).Should(ContainSubstring("hello world")) g.Expect(Kamel(t, ctx, "delete", "property-file-route", "-n", ns).Execute()).To(Succeed()) }) + /* + kamel run --dev -p my.key.2=universe -p file:./e2e/common/config/files/my.properties ./e2e/common/config/files/property-file-route.yaml + */ + t.Run("Property precedence", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/property-file-route.groovy", "-p", "my.key.2=universe", "-p", "file:./files/my.properties").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/property-file-route.yaml", "-p", "my.key.2=universe", "-p", "file:./files/my.properties").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "property-file-route"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "property-file-route", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "property-file-route"), TestTimeoutShort).Should(ContainSubstring("hello universe")) g.Expect(Kamel(t, ctx, "delete", "property-file-route", "-n", ns).Execute()).To(Succeed()) }) + /* + kubectl create configmap my-cm-test-property --from-literal=my.message="my-configmap-property-value" + + kamel run --dev -p configmap:my-cm-test-property ./e2e/common/config/files/property-route.yaml + */ + t.Run("Property from ConfigMap", func(t *testing.T) { var cmData = make(map[string]string) cmData["my.message"] = "my-configmap-property-value" err := CreatePlainTextConfigmap(t, ctx, ns, "my-cm-test-property", cmData) g.Expect(err).To(BeNil()) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/property-route.groovy", "-p", "configmap:my-cm-test-property").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/property-route.yaml", "-p", "configmap:my-cm-test-property").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "property-route"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "property-route", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "property-route"), TestTimeoutShort).Should(ContainSubstring("my-configmap-property-value")) g.Expect(Kamel(t, ctx, "delete", "property-route", "-n", ns).Execute()).To(Succeed()) }) + /* + kubectl create configmap my-cm-test-properties --from-literal=my.properties="my.message=my-configmap-property-entry" + + kamel run --dev -p configmap:my-cm-test-properties ./e2e/common/config/files/property-route.yaml + */ + t.Run("Property from ConfigMap as property file", func(t *testing.T) { var cmData = make(map[string]string) cmData["my.properties"] = "my.message=my-configmap-property-entry" err := CreatePlainTextConfigmap(t, ctx, ns, "my-cm-test-properties", cmData) g.Expect(err).To(BeNil()) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/property-route.groovy", "-p", "configmap:my-cm-test-properties").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/property-route.yaml", "-p", "configmap:my-cm-test-properties").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "property-route"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "property-route", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "property-route"), TestTimeoutShort).Should(ContainSubstring("my-configmap-property-entry")) g.Expect(Kamel(t, ctx, "delete", "property-route", "-n", ns).Execute()).To(Succeed()) }) + /* + kubectl create secret generic my-sec-test-property --from-literal=my.message="my-secret-property-value" + + kamel run --dev -p secret:my-sec-test-property ./e2e/common/config/files/property-route.yaml + */ + t.Run("Property from Secret", func(t *testing.T) { var secData = make(map[string]string) secData["my.message"] = "my-secret-property-value" err := CreatePlainTextSecret(t, ctx, ns, "my-sec-test-property", secData) g.Expect(err).To(BeNil()) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/property-route.groovy", "-p", "secret:my-sec-test-property").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/property-route.yaml", "-p", "secret:my-sec-test-property").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "property-route"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "property-route", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "property-route"), TestTimeoutShort).Should(ContainSubstring("my-secret-property-value")) g.Expect(Kamel(t, ctx, "delete", "property-route", "-n", ns).Execute()).To(Succeed()) }) + /* + kubectl create secret generic my-sec-test-properties --from-literal=my.properties="my.message=my-secret-property-entry" + + kamel run --dev --name property-route-secret -p secret:my-sec-test-properties ./e2e/common/config/files/property-route.yaml + */ + t.Run("Property from Secret as property file", func(t *testing.T) { var secData = make(map[string]string) secData["my.properties"] = "my.message=my-secret-property-entry" err := CreatePlainTextSecret(t, ctx, ns, "my-sec-test-properties", secData) g.Expect(err).To(BeNil()) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/property-route.groovy", "--name", "property-route-secret", "-p", "secret:my-sec-test-properties").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/property-route.yaml", "--name", "property-route-secret", "-p", "secret:my-sec-test-properties").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "property-route-secret"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "property-route-secret", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "property-route-secret"), TestTimeoutShort).Should(ContainSubstring("my-secret-property-entry")) }) + /* + kubectl create secret generic my-sec-inlined --from-literal=my-message="my-secret-external-value" + + kamel run --dev -t mount.configs=secret:my-sec-inlined ./e2e/common/config/files/property-secret-route.yaml + */ + t.Run("Property from Secret inlined", func(t *testing.T) { var secData = make(map[string]string) secData["my-message"] = "my-secret-external-value" err := CreatePlainTextSecret(t, ctx, ns, "my-sec-inlined", secData) g.Expect(err).To(BeNil()) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/property-secret-route.groovy", "-t", "mount.configs=secret:my-sec-inlined").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/property-secret-route.yaml", "-t", "mount.configs=secret:my-sec-inlined").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "property-secret-route"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "property-secret-route", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "property-secret-route"), TestTimeoutShort).Should(ContainSubstring("my-secret-external-value")) @@ -147,53 +189,79 @@ func TestRunConfigExamples(t *testing.T) { // Configmap // Store a configmap on the cluster + // kubectl create configmap my-cm --from-literal=my-configmap-key="my-configmap-content" + var cmData = make(map[string]string) cmData["my-configmap-key"] = "my-configmap-content" err := CreatePlainTextConfigmap(t, ctx, ns, "my-cm", cmData) g.Expect(err).To(BeNil()) // Store a configmap with multiple values + // kubectl create configmap my-cm-multi --from-literal=my-configmap-key="should-not-see-it" --from-literal=my-configmap-key-2="my-configmap-content-2" + var cmDataMulti = make(map[string]string) cmDataMulti["my-configmap-key"] = "should-not-see-it" cmDataMulti["my-configmap-key-2"] = "my-configmap-content-2" err = CreatePlainTextConfigmap(t, ctx, ns, "my-cm-multi", cmDataMulti) g.Expect(err).To(BeNil()) + /* + kamel run --dev --config configmap:my-cm ./e2e/common/config/files/config-configmap-route.yaml + */ + t.Run("Config configmap", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/config-configmap-route.groovy", "--config", "configmap:my-cm").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/config-configmap-route.yaml", "--config", "configmap:my-cm").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "config-configmap-route"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "config-configmap-route", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "config-configmap-route"), TestTimeoutShort).Should(ContainSubstring(cmData["my-configmap-key"])) }) + /* + kamel run --dev --resource configmap:my-cm ./e2e/common/config/files/resource-configmap-route.yaml + */ + t.Run("Resource configmap", func(t *testing.T) { // We can reuse the configmap created previously - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/resource-configmap-route.groovy", "--resource", "configmap:my-cm").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/resource-configmap-route.yaml", "--resource", "configmap:my-cm").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "resource-configmap-route"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "resource-configmap-route", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "resource-configmap-route"), TestTimeoutShort).Should(ContainSubstring(cmData["my-configmap-key"])) }) + /* + kamel run --dev --resource configmap:my-cm@/tmp/app ./e2e/common/config/files/resource-configmap-location-route.yaml + */ + t.Run("Resource configmap with destination", func(t *testing.T) { // We can reuse the configmap created previously - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/resource-configmap-location-route.groovy", "--resource", "configmap:my-cm@/tmp/app").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/resource-configmap-location-route.yaml", "--resource", "configmap:my-cm@/tmp/app").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "resource-configmap-location-route"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "resource-configmap-location-route", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "resource-configmap-location-route"), TestTimeoutShort).Should(ContainSubstring(cmData["my-configmap-key"])) }) + /* + kamel run --dev --resource configmap:my-cm-multi/my-configmap-key-2@/tmp/app/test.txt ./e2e/common/config/files/resource-configmap-key-location-route.yaml + */ + t.Run("Resource configmap with filtered key and destination", func(t *testing.T) { - // We'll use the configmap contaning 2 values filtering only 1 key + // We'll use the configmap containing 2 values filtering only 1 key - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/resource-configmap-key-location-route.groovy", "--resource", "configmap:my-cm-multi/my-configmap-key-2@/tmp/app/test.txt").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/resource-configmap-key-location-route.yaml", "--resource", "configmap:my-cm-multi/my-configmap-key-2@/tmp/app/test.txt").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "resource-configmap-key-location-route"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "resource-configmap-key-location-route", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "resource-configmap-key-location-route"), TestTimeoutShort).ShouldNot(ContainSubstring(cmDataMulti["my-configmap-key"])) g.Eventually(IntegrationLogs(t, ctx, ns, "resource-configmap-key-location-route"), TestTimeoutShort).Should(ContainSubstring(cmDataMulti["my-configmap-key-2"])) }) + /* + kubectl create configmap my-cm-properties --from-literal=my.key.1=hello --from-literal=my.key.2=world + + kamel run --dev --config configmap:my-cm-properties ./e2e/common/config/files/config-configmap-properties-route.yaml + */ + t.Run("Config configmap as property file", func(t *testing.T) { // Store a configmap as property file var cmDataProps = make(map[string]string) @@ -201,7 +269,7 @@ func TestRunConfigExamples(t *testing.T) { err = CreatePlainTextConfigmap(t, ctx, ns, "my-cm-properties", cmDataProps) g.Expect(err).To(BeNil()) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/config-configmap-properties-route.groovy", "--config", "configmap:my-cm-properties").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/config-configmap-properties-route.yaml", "--config", "configmap:my-cm-properties").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "config-configmap-properties-route"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "config-configmap-properties-route", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "config-configmap-properties-route"), TestTimeoutShort).Should(ContainSubstring("hello world")) @@ -210,35 +278,51 @@ func TestRunConfigExamples(t *testing.T) { // Secret // Store a secret on the cluster + // kubectl create secret generic my-sec --from-literal=my-secret-key="very top secret" + var secData = make(map[string]string) secData["my-secret-key"] = "very top secret" err = CreatePlainTextSecret(t, ctx, ns, "my-sec", secData) g.Expect(err).To(BeNil()) // Store a secret with multi values + // kubectl create secret generic my-sec-multi --from-literal=my-secret-key="very top secret" --from-literal=my-secret-key-2="even more secret" + var secDataMulti = make(map[string]string) secDataMulti["my-secret-key"] = "very top secret" secDataMulti["my-secret-key-2"] = "even more secret" err = CreatePlainTextSecret(t, ctx, ns, "my-sec-multi", secDataMulti) g.Expect(err).To(BeNil()) + /* + kamel run --dev --config secret:my-sec ./e2e/common/config/files/config-secret-route.yaml + */ + t.Run("Config secret", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/config-secret-route.groovy", "--config", "secret:my-sec").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/config-secret-route.yaml", "--config", "secret:my-sec").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "config-secret-route"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "config-secret-route", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "config-secret-route"), TestTimeoutShort).Should(ContainSubstring(secData["my-secret-key"])) }) + /* + kamel run --dev --resource secret:my-sec ./e2e/common/config/files/resource-secret-route.yaml + */ + t.Run("Resource secret", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/resource-secret-route.groovy", "--resource", "secret:my-sec").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/resource-secret-route.yaml", "--resource", "secret:my-sec").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "resource-secret-route"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "resource-secret-route", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "resource-secret-route"), TestTimeoutShort).Should(ContainSubstring(secData["my-secret-key"])) g.Expect(Kamel(t, ctx, "delete", "--all", "-n", ns).Execute()).To(Succeed()) }) + /* + kamel run --dev --config secret:my-sec-multi/my-secret-key-2 ./e2e/common/config/files/config-secret-key-route.yaml + */ + t.Run("Secret with filtered key", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/config-secret-key-route.groovy", "--config", "secret:my-sec-multi/my-secret-key-2").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/config-secret-key-route.yaml", "--config", "secret:my-sec-multi/my-secret-key-2").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "config-secret-key-route"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "config-secret-key-route", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "config-secret-key-route"), TestTimeoutShort).ShouldNot(ContainSubstring(secDataMulti["my-secret-key"])) @@ -247,17 +331,26 @@ func TestRunConfigExamples(t *testing.T) { }) // Build-Properties + + /* + kamel run --dev --build-property quarkus.application.name=my-super-application ./e2e/common/config/files/build-property-route.yaml + */ + t.Run("Build time property", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/build-property-route.groovy", "--build-property", "quarkus.application.name=my-super-application").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/build-property-route.yaml", "--build-property", "quarkus.application.name=my-super-application").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "build-property-route"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "build-property-route", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "build-property-route"), TestTimeoutShort).Should(ContainSubstring("my-super-application")) // Don't delete - we need it for next test execution }) - // We need to check also that the property (which is available in the IntegrationKit) is correctly replaced and we don't reuse the same kit + /* + kamel run --dev --name build-property-route-updated --build-property quarkus.application.name=my-super-application-updated ./e2e/common/config/files/build-property-route.yaml + */ + + // We need to check also that the property (which is available in the IntegrationKit) is correctly replaced and that we don't reuse the same kit t.Run("Build time property updated", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/build-property-route.groovy", "--name", "build-property-route-updated", "--build-property", "quarkus.application.name=my-super-application-updated").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/build-property-route.yaml", "--name", "build-property-route-updated", "--build-property", "quarkus.application.name=my-super-application-updated").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "build-property-route-updated"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "build-property-route-updated", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "build-property-route-updated"), TestTimeoutShort).Should(ContainSubstring("my-super-application-updated")) @@ -266,72 +359,104 @@ func TestRunConfigExamples(t *testing.T) { g.Expect(Kamel(t, ctx, "delete", "--all", "-n", ns).Execute()).To(Succeed()) }) + /* + kamel run --dev --build-property file:./e2e/common/config/files/quarkus.properties ./e2e/common/config/files/build-property-file-route.yaml + */ + // Build-Properties file t.Run("Build time property file", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/build-property-file-route.groovy", "--build-property", "file:./files/quarkus.properties").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/build-property-file-route.yaml", "--build-property", "file:./files/quarkus.properties").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "build-property-file-route"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "build-property-file-route", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "build-property-file-route"), TestTimeoutShort).Should(ContainSubstring("my-super-application")) g.Expect(Kamel(t, ctx, "delete", "build-property-file-route", "-n", ns).Execute()).To(Succeed()) }) + /* + kamel run --dev --name build-property-file-route-precedence --build-property quarkus.application.name=my-overridden-application --build-property file:./e2e/common/config/files/quarkus.properties ./e2e/common/config/files/build-property-file-route.yaml + */ + t.Run("Build time property file with precedence", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/build-property-file-route.groovy", "--name", "build-property-file-route-precedence", "--build-property", "quarkus.application.name=my-overridden-application", "--build-property", "file:./files/quarkus.properties").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/build-property-file-route.yaml", "--name", "build-property-file-route-precedence", "--build-property", "quarkus.application.name=my-overridden-application", "--build-property", "file:./files/quarkus.properties").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "build-property-file-route-precedence"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "build-property-file-route-precedence", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "build-property-file-route-precedence"), TestTimeoutShort).Should(ContainSubstring("my-overridden-application")) g.Expect(Kamel(t, ctx, "delete", "build-property-file-route-precedence", "-n", ns).Execute()).To(Succeed()) }) + /* + kubectl create configmap my-cm-test-build-property --from-literal=quarkus.application.name="my-cool-application" + + kamel run --dev --build-property configmap:my-cm-test-build-property ./e2e/common/config/files/build-property-file-route.yaml + */ + t.Run("Build time property from ConfigMap", func(t *testing.T) { var cmData = make(map[string]string) cmData["quarkus.application.name"] = "my-cool-application" err = CreatePlainTextConfigmap(t, ctx, ns, "my-cm-test-build-property", cmData) g.Expect(err).To(BeNil()) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/build-property-file-route.groovy", "--build-property", "configmap:my-cm-test-build-property").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/build-property-file-route.yaml", "--build-property", "configmap:my-cm-test-build-property").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "build-property-file-route"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "build-property-file-route", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "build-property-file-route"), TestTimeoutShort).Should(ContainSubstring("my-cool-application")) g.Expect(Kamel(t, ctx, "delete", "build-property-file-route", "-n", ns).Execute()).To(Succeed()) }) + /* + kubectl create configmap my-cm-test-build-properties --from-literal=my.properties="quarkus.application.name=my-super-cool-application" + + kamel run --dev --name build-property-file-route-cm --build-property configmap:my-cm-test-build-properties ./e2e/common/config/files/build-property-file-route.yaml + */ + t.Run("Build time property from ConfigMap as property file", func(t *testing.T) { var cmData = make(map[string]string) cmData["my.properties"] = "quarkus.application.name=my-super-cool-application" err = CreatePlainTextConfigmap(t, ctx, ns, "my-cm-test-build-properties", cmData) g.Expect(err).To(BeNil()) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/build-property-file-route.groovy", "--name", "build-property-file-route-cm", "--build-property", "configmap:my-cm-test-build-properties").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/build-property-file-route.yaml", "--name", "build-property-file-route-cm", "--build-property", "configmap:my-cm-test-build-properties").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "build-property-file-route-cm"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "build-property-file-route-cm", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "build-property-file-route-cm"), TestTimeoutShort).Should(ContainSubstring("my-super-cool-application")) g.Expect(Kamel(t, ctx, "delete", "build-property-file-route-cm", "-n", ns).Execute()).To(Succeed()) }) + /* + kubectl create secret generic my-sec-test-build-property --from-literal=quarkus.application.name="my-great-application" + + kamel run --dev --build-property secret:my-sec-test-build-property ./e2e/common/config/files/build-property-file-route.yaml + */ + t.Run("Build time property from Secret", func(t *testing.T) { var secData = make(map[string]string) secData["quarkus.application.name"] = "my-great-application" err = CreatePlainTextSecret(t, ctx, ns, "my-sec-test-build-property", secData) g.Expect(err).To(BeNil()) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/build-property-file-route.groovy", "--build-property", "secret:my-sec-test-build-property").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/build-property-file-route.yaml", "--build-property", "secret:my-sec-test-build-property").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "build-property-file-route"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "build-property-file-route", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "build-property-file-route"), TestTimeoutShort).Should(ContainSubstring("my-great-application")) g.Expect(Kamel(t, ctx, "delete", "build-property-file-route", "-n", ns).Execute()).To(Succeed()) }) + /* + kubectl create secret generic my-sec-test-build-properties --from-literal=my.properties="quarkus.application.name=my-awesome-application" + + kamel run --dev --name build-property-file-route-secret --build-property secret:my-sec-test-build-properties ./e2e/common/config/files/build-property-file-route.yaml + */ + t.Run("Build time property from Secret as property file", func(t *testing.T) { var secData = make(map[string]string) - secData["my.properties"] = "quarkus.application.name=my-awsome-application" + secData["my.properties"] = "quarkus.application.name=my-awesome-application" err = CreatePlainTextSecret(t, ctx, ns, "my-sec-test-build-properties", secData) g.Expect(err).To(BeNil()) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/build-property-file-route.groovy", "--name", "build-property-file-route-secret", "--build-property", "secret:my-sec-test-build-properties").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "./files/build-property-file-route.yaml", "--name", "build-property-file-route-secret", "--build-property", "secret:my-sec-test-build-properties").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "build-property-file-route-secret"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "build-property-file-route-secret", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) - g.Eventually(IntegrationLogs(t, ctx, ns, "build-property-file-route-secret"), TestTimeoutShort).Should(ContainSubstring("my-awsome-application")) + g.Eventually(IntegrationLogs(t, ctx, ns, "build-property-file-route-secret"), TestTimeoutShort).Should(ContainSubstring("my-awesome-application")) g.Expect(Kamel(t, ctx, "delete", "build-property-file-route-secret", "-n", ns).Execute()).To(Succeed()) }) diff --git a/e2e/common/config/files/build-property-file-route.groovy b/e2e/common/config/files/build-property-file-route.groovy deleted file mode 100644 index ecb065f75..000000000 --- a/e2e/common/config/files/build-property-file-route.groovy +++ /dev/null @@ -1,21 +0,0 @@ -// camel-k: language=groovy -/* - * 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. - */ - -from('timer:build-property') - .routeId('build-property') - .log('The application name: {{quarkus.application.name}}') diff --git a/e2e/common/config/files/build-property-file-route.yaml b/e2e/common/config/files/build-property-file-route.yaml new file mode 100644 index 000000000..76e38ced7 --- /dev/null +++ b/e2e/common/config/files/build-property-file-route.yaml @@ -0,0 +1,23 @@ +# camel-k: language=yaml + +# 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. + +- from: + uri: "timer:build-property" + steps: + - setBody: + simple: "The application name: {{quarkus.application.name}}" + - to: "log:info" diff --git a/e2e/common/config/files/build-property-route.groovy b/e2e/common/config/files/build-property-route.groovy deleted file mode 100644 index ecb065f75..000000000 --- a/e2e/common/config/files/build-property-route.groovy +++ /dev/null @@ -1,21 +0,0 @@ -// camel-k: language=groovy -/* - * 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. - */ - -from('timer:build-property') - .routeId('build-property') - .log('The application name: {{quarkus.application.name}}') diff --git a/e2e/common/config/files/build-property-route.yaml b/e2e/common/config/files/build-property-route.yaml new file mode 100644 index 000000000..76e38ced7 --- /dev/null +++ b/e2e/common/config/files/build-property-route.yaml @@ -0,0 +1,23 @@ +# camel-k: language=yaml + +# 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. + +- from: + uri: "timer:build-property" + steps: + - setBody: + simple: "The application name: {{quarkus.application.name}}" + - to: "log:info" diff --git a/e2e/common/config/files/config-configmap-properties-route.groovy b/e2e/common/config/files/config-configmap-properties-route.groovy deleted file mode 100644 index 370337b27..000000000 --- a/e2e/common/config/files/config-configmap-properties-route.groovy +++ /dev/null @@ -1,21 +0,0 @@ -// camel-k: language=groovy -/* - * 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. - */ - -from('timer:configmap') - .routeId('configmap') - .log('configmap content is: {{my.key.1}} {{my.key.2}}') diff --git a/e2e/common/config/files/config-configmap-properties-route.yaml b/e2e/common/config/files/config-configmap-properties-route.yaml new file mode 100644 index 000000000..89e359746 --- /dev/null +++ b/e2e/common/config/files/config-configmap-properties-route.yaml @@ -0,0 +1,23 @@ +# camel-k: language=yaml + +# 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. + +- from: + uri: "timer:configmap" + steps: + - setBody: + simple: "configmap content is: {{my.key.1}} {{my.key.2}}" + - to: "log:info" diff --git a/e2e/common/config/files/config-configmap-route.groovy b/e2e/common/config/files/config-configmap-route.groovy deleted file mode 100644 index 8c829127f..000000000 --- a/e2e/common/config/files/config-configmap-route.groovy +++ /dev/null @@ -1,23 +0,0 @@ -// camel-k: language=groovy -/* - * 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. - */ - -from('timer:configmap') - .routeId('configmap') - .setBody() - .simple("resource:classpath:my-configmap-key") - .log('configmap content is: ${body}') diff --git a/e2e/common/config/files/config-configmap-route.yaml b/e2e/common/config/files/config-configmap-route.yaml new file mode 100644 index 000000000..4b526d41e --- /dev/null +++ b/e2e/common/config/files/config-configmap-route.yaml @@ -0,0 +1,25 @@ +# camel-k: language=yaml + +# 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. + +- from: + uri: "timer:configmap" + steps: + - setBody: + simple: "resource:classpath:my-configmap-key" + - setBody: + simple: "configmap content is: ${body}" + - to: "log:info" diff --git a/e2e/common/config/files/config-file-route.groovy b/e2e/common/config/files/config-file-route.groovy deleted file mode 100644 index 37b947359..000000000 --- a/e2e/common/config/files/config-file-route.groovy +++ /dev/null @@ -1,23 +0,0 @@ -// camel-k: language=groovy -/* - * 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. - */ - -from('timer:resources') - .routeId('resources') - .setBody() - .simple("resource:classpath:resources-data.txt") - .log('resource file content is: ${body}') diff --git a/e2e/common/config/files/config-secret-key-route.groovy b/e2e/common/config/files/config-secret-key-route.groovy deleted file mode 100644 index 21919af65..000000000 --- a/e2e/common/config/files/config-secret-key-route.groovy +++ /dev/null @@ -1,22 +0,0 @@ -// camel-k: language=groovy -/* - * 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. - */ - - from('timer:secret') - .setBody() - .simple("resource:classpath:my-secret-key-2") - .log('secret content is: ${body}') diff --git a/e2e/common/config/files/config-secret-key-route.yaml b/e2e/common/config/files/config-secret-key-route.yaml new file mode 100644 index 000000000..ab76506a3 --- /dev/null +++ b/e2e/common/config/files/config-secret-key-route.yaml @@ -0,0 +1,25 @@ +# camel-k: language=yaml + +# 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. + +- from: + uri: "timer:secret" + steps: + - setBody: + simple: "resource:classpath:my-secret-key-2" + - setBody: + simple: "secret content is: ${body}" + - to: "log:info" diff --git a/e2e/common/config/files/config-secret-route.groovy b/e2e/common/config/files/config-secret-route.groovy deleted file mode 100644 index ac369aa8c..000000000 --- a/e2e/common/config/files/config-secret-route.groovy +++ /dev/null @@ -1,23 +0,0 @@ -// camel-k: language=groovy -/* - * 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. - */ - -from('timer:secret') - .routeId('secret') - .setBody() - .simple("resource:classpath:my-secret-key") - .log('secret content is: ${body}') diff --git a/e2e/common/config/files/config-secret-route.yaml b/e2e/common/config/files/config-secret-route.yaml new file mode 100644 index 000000000..03bd7440e --- /dev/null +++ b/e2e/common/config/files/config-secret-route.yaml @@ -0,0 +1,25 @@ +# camel-k: language=yaml + +# 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. + +- from: + uri: "timer:secret" + steps: + - setBody: + simple: "resource:classpath:my-secret-key" + - setBody: + simple: "secret content is: ${body}" + - to: "log:info" diff --git a/e2e/common/config/files/property-file-route.groovy b/e2e/common/config/files/property-file-route.groovy deleted file mode 100644 index e9718dff7..000000000 --- a/e2e/common/config/files/property-file-route.groovy +++ /dev/null @@ -1,21 +0,0 @@ -// camel-k: language=groovy -/* - * 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. - */ - -from('timer:property-file') - .routeId('property-file') - .log('property file content is: {{my.key.1}} {{my.key.2}}') diff --git a/e2e/common/config/files/property-file-route.yaml b/e2e/common/config/files/property-file-route.yaml new file mode 100644 index 000000000..ea33d2a95 --- /dev/null +++ b/e2e/common/config/files/property-file-route.yaml @@ -0,0 +1,23 @@ +# camel-k: language=yaml + +# 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. + +- from: + uri: "timer:property-file" + steps: + - setBody: + simple: "property file content is: {{my.key.1}} {{my.key.2}}" + - to: "log:info" diff --git a/e2e/common/config/files/property-route.groovy b/e2e/common/config/files/property-route.groovy deleted file mode 100644 index a609ea706..000000000 --- a/e2e/common/config/files/property-route.groovy +++ /dev/null @@ -1,21 +0,0 @@ -// camel-k: language=groovy -/* - * 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. - */ - -from('timer:property') - .routeId('property') - .log('property content is: {{my.message}}') diff --git a/e2e/common/config/files/property-route.yaml b/e2e/common/config/files/property-route.yaml new file mode 100644 index 000000000..4d7a924b7 --- /dev/null +++ b/e2e/common/config/files/property-route.yaml @@ -0,0 +1,23 @@ +# camel-k: language=yaml + +# 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. + +- from: + uri: "timer:property" + steps: + - setBody: + simple: "property content is: {{my.message}}" + - to: "log:info" diff --git a/e2e/common/config/files/property-secret-route.groovy b/e2e/common/config/files/property-secret-route.groovy deleted file mode 100644 index 90a2dcade..000000000 --- a/e2e/common/config/files/property-secret-route.groovy +++ /dev/null @@ -1,21 +0,0 @@ -// camel-k: language=groovy -/* - * 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. - */ - -from('timer:property') - .routeId('property') - .log('property content is: {{secret:my-sec-inlined/my-message}}') diff --git a/e2e/common/config/files/property-secret-route.yaml b/e2e/common/config/files/property-secret-route.yaml new file mode 100644 index 000000000..b826aed97 --- /dev/null +++ b/e2e/common/config/files/property-secret-route.yaml @@ -0,0 +1,23 @@ +# camel-k: language=yaml + +# 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. + +- from: + uri: "timer:property" + steps: + - setBody: + simple: "property content is: {{secret:my-sec-inlined/my-message}}" + - to: "log:info" diff --git a/e2e/common/config/files/resource-configmap-key-location-route.groovy b/e2e/common/config/files/resource-configmap-key-location-route.groovy deleted file mode 100644 index 36f59a97b..000000000 --- a/e2e/common/config/files/resource-configmap-key-location-route.groovy +++ /dev/null @@ -1,20 +0,0 @@ -// camel-k: language=groovy -/* - * 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. - */ - -from('file:/tmp/app/?fileName=test.txt&noop=true&idempotent=false') - .log('resource file content is: ${body}') diff --git a/e2e/common/config/files/resource-configmap-key-location-route.yaml b/e2e/common/config/files/resource-configmap-key-location-route.yaml new file mode 100644 index 000000000..428ec1c3b --- /dev/null +++ b/e2e/common/config/files/resource-configmap-key-location-route.yaml @@ -0,0 +1,23 @@ +# camel-k: language=yaml + +# 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. + +- from: + uri: "file:/tmp/app/?fileName=test.txt&noop=true&idempotent=false" + steps: + - setBody: + simple: "resource file content is: ${body}" + - to: "log:info" diff --git a/e2e/common/config/files/resource-configmap-location-route.groovy b/e2e/common/config/files/resource-configmap-location-route.groovy deleted file mode 100644 index 08c2f9ccb..000000000 --- a/e2e/common/config/files/resource-configmap-location-route.groovy +++ /dev/null @@ -1,20 +0,0 @@ -// camel-k: language=groovy -/* - * 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. - */ - -from('file:/tmp/app/?fileName=my-configmap-key&noop=true&idempotent=false') - .log('resource file content is: ${body}') diff --git a/e2e/common/config/files/resource-configmap-location-route.yaml b/e2e/common/config/files/resource-configmap-location-route.yaml new file mode 100644 index 000000000..fe4638b11 --- /dev/null +++ b/e2e/common/config/files/resource-configmap-location-route.yaml @@ -0,0 +1,23 @@ +# camel-k: language=yaml + +# 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. + +- from: + uri: "file:/tmp/app/?fileName=my-configmap-key&noop=true&idempotent=false" + steps: + - setBody: + simple: "resource file content is: ${body}" + - to: "log:info" diff --git a/e2e/common/config/files/resource-configmap-route.groovy b/e2e/common/config/files/resource-configmap-route.groovy deleted file mode 100644 index 6cccf02a7..000000000 --- a/e2e/common/config/files/resource-configmap-route.groovy +++ /dev/null @@ -1,20 +0,0 @@ -// camel-k: language=groovy -/* - * 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. - */ - -from('file:/etc/camel/resources/my-cm/?fileName=my-configmap-key&noop=true&idempotent=false') - .log('resource file content is: ${body}') diff --git a/e2e/common/config/files/resource-configmap-route.yaml b/e2e/common/config/files/resource-configmap-route.yaml new file mode 100644 index 000000000..d5e823f63 --- /dev/null +++ b/e2e/common/config/files/resource-configmap-route.yaml @@ -0,0 +1,23 @@ +# camel-k: language=yaml + +# 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. + +- from: + uri: "file:/etc/camel/resources/my-cm/?fileName=my-configmap-key&noop=true&idempotent=false" + steps: + - setBody: + simple: "resource file content is: ${body}" + - to: "log:info" diff --git a/e2e/common/config/files/resource-file-base64-encoded-route.groovy b/e2e/common/config/files/resource-file-base64-encoded-route.groovy deleted file mode 100644 index 8cbff0b3f..000000000 --- a/e2e/common/config/files/resource-file-base64-encoded-route.groovy +++ /dev/null @@ -1,23 +0,0 @@ -// camel-k: language=groovy -/* - * 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. - */ - -from('timer:resources-bas64') - .routeId('resources-base64') - .setBody() - .simple("resource:classpath:resources-data.txt") - .log('resource file base64 content is: ${body}') diff --git a/e2e/common/config/files/resource-file-binary-route.groovy b/e2e/common/config/files/resource-file-binary-route.groovy deleted file mode 100644 index ff50ad174..000000000 --- a/e2e/common/config/files/resource-file-binary-route.groovy +++ /dev/null @@ -1,22 +0,0 @@ -// camel-k: language=groovy -/* - * 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. - */ - -from('file:/etc/camel/resources/?fileName=resources-data.zip&noop=true&idempotent=false') - .routeId('resources-zip') - .unmarshal().zipFile() - .log('resource file unzipped content is: ${body}') diff --git a/e2e/common/config/files/resource-file-location-route.groovy b/e2e/common/config/files/resource-file-location-route.groovy deleted file mode 100644 index 076a2a9c7..000000000 --- a/e2e/common/config/files/resource-file-location-route.groovy +++ /dev/null @@ -1,20 +0,0 @@ -// camel-k: language=groovy -/* - * 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. - */ - -from('file:/tmp/?fileName=file.txt&noop=true&idempotent=false') - .log('resource file content is: ${body}') diff --git a/e2e/common/config/files/resource-file-route.groovy b/e2e/common/config/files/resource-file-route.groovy deleted file mode 100644 index d515385c8..000000000 --- a/e2e/common/config/files/resource-file-route.groovy +++ /dev/null @@ -1,20 +0,0 @@ -// camel-k: language=groovy -/* - * 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. - */ - -from('file:/etc/camel/resources/?fileName=resources-data.txt&noop=true&idempotent=false') - .log('resource file content is: ${body}') diff --git a/e2e/common/config/files/resource-secret-route.groovy b/e2e/common/config/files/resource-secret-route.groovy deleted file mode 100644 index 63f4c7668..000000000 --- a/e2e/common/config/files/resource-secret-route.groovy +++ /dev/null @@ -1,20 +0,0 @@ -// camel-k: language=groovy -/* - * 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. - */ - -from('file:/etc/camel/resources/my-sec/?fileName=my-secret-key&noop=true&idempotent=false') - .log('resource file content is: ${body}') diff --git a/e2e/common/config/files/resource-secret-route.yaml b/e2e/common/config/files/resource-secret-route.yaml new file mode 100644 index 000000000..9407c7921 --- /dev/null +++ b/e2e/common/config/files/resource-secret-route.yaml @@ -0,0 +1,23 @@ +# camel-k: language=yaml + +# 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. + +- from: + uri: "file:/etc/camel/resources/my-sec/?fileName=my-secret-key&noop=true&idempotent=false" + steps: + - setBody: + simple: "resource file content is: ${body}" + - to: "log:info" diff --git a/e2e/common/traits/files/PodTest.groovy b/e2e/common/traits/files/PodTest.groovy deleted file mode 100644 index 114eb6178..000000000 --- a/e2e/common/traits/files/PodTest.groovy +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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. - */ - -// camel-k: language=groovy -from('file:///var/log') - .convertBodyTo(String.class) - .setBody().simple('${body}: {{TEST_VARIABLE}} ') - .log('${body}') diff --git a/e2e/common/traits/files/PodTest.yaml b/e2e/common/traits/files/PodTest.yaml new file mode 100644 index 000000000..08f71974b --- /dev/null +++ b/e2e/common/traits/files/PodTest.yaml @@ -0,0 +1,23 @@ +# camel-k: language=yaml + +# 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. + +- from: + uri: "file:///var/log" + steps: + - setBody: + simple: "${body}: {{TEST_VARIABLE}}" + - to: "log:info" diff --git a/e2e/common/traits/files/openapi/petstore.groovy b/e2e/common/traits/files/openapi/petstore.groovy deleted file mode 100644 index d382b217c..000000000 --- a/e2e/common/traits/files/openapi/petstore.groovy +++ /dev/null @@ -1,29 +0,0 @@ -// camel-k: language=groovy -/* - * 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. - */ - -// -// kamel run --dev --name petstore --open-api examples/petstore-api.yaml examples/petstore.groovy -// - -from('direct:listPets') - .log('listPets') -from('direct:createPets') - .log('createPets') -from('direct:showPetById') - .log('showPetById') - diff --git a/e2e/common/traits/files/openapi/petstore.yaml b/e2e/common/traits/files/openapi/petstore.yaml new file mode 100644 index 000000000..1031c5ed3 --- /dev/null +++ b/e2e/common/traits/files/openapi/petstore.yaml @@ -0,0 +1,37 @@ +# camel-k: language=yaml + +# 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. + +- from: + uri: "direct:listPets" + steps: + - setBody: + simple: "listPets" + - to: "log:info" + +- from: + uri: "direct:createPets" + steps: + - setBody: + simple: "createPets" + - to: "log:info" + +- from: + uri: "direct:showPetById" + steps: + - setBody: + simple: "showPetById" + - to: "log:info" diff --git a/e2e/common/traits/openapi_test.go b/e2e/common/traits/openapi_test.go index ef3de8e35..ea3bd7d32 100644 --- a/e2e/common/traits/openapi_test.go +++ b/e2e/common/traits/openapi_test.go @@ -53,7 +53,7 @@ func TestOpenAPI(t *testing.T) { cmDataProps["petstore-api.yaml"] = string(openapiContent) CreatePlainTextConfigmap(t, ctx, ns, "my-openapi", cmDataProps) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "--name", "petstore", "--open-api", "configmap:my-openapi", "files/openapi/petstore.groovy").Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "--name", "petstore", "--open-api", "configmap:my-openapi", "files/openapi/petstore.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "petstore"), TestTimeoutLong). Should(Equal(corev1.PodRunning)) diff --git a/e2e/common/traits/pod_test.go b/e2e/common/traits/pod_test.go index 54726a574..04a2f6672 100644 --- a/e2e/common/traits/pod_test.go +++ b/e2e/common/traits/pod_test.go @@ -92,7 +92,7 @@ func TestPodTrait(t *testing.T) { test := tc[i] t.Run(test.name, func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/PodTest.groovy", "--name", name, "--pod-template", test.templateName).Execute()).To(Succeed()) + g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/PodTest.yaml", "--name", name, "--pod-template", test.templateName).Execute()).To(Succeed()) // check integration is deployed g.Eventually(IntegrationPodPhase(t, ctx, ns, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))