You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2022/05/16 14:52:02 UTC

[camel-k] branch release-1.9.x updated (aa4be9f86 -> ab9e6d75f)

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a change to branch release-1.9.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git


    from aa4be9f86 Point to kamelets 0.8.1
     new 2f4a8c4f4 Preparing for next release: e2e preflight test improvement
     new e849377b5 fix(kamelet): migrate to Camel 3.15 yaml definition
     new ab9e6d75f fix(e2e): rest yaml definition as Camel 3.15

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../kamel-build-bundle/build-bundle-image.sh       |  2 +-
 .../kamel-build-bundle/build-index-image.sh        |  2 +-
 .../actions/kamel-preflight-test/preflight-test.sh | 27 ++++++++++++++++++----
 e2e/common/cli/bind_test.go                        |  8 +++++++
 e2e/common/files/cron-quartz.yaml                  | 20 ++++++++--------
 e2e/common/files/cron-timer.yaml                   | 20 ++++++++--------
 e2e/common/files/rest-consumer.yaml                |  7 +++---
 pkg/controller/kameletbinding/integration.go       |  8 +++----
 pkg/util/olm/operator.go                           | 10 ++++++++
 9 files changed, 69 insertions(+), 35 deletions(-)


[camel-k] 03/03: fix(e2e): rest yaml definition as Camel 3.15

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch release-1.9.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit ab9e6d75f27111b02230f3beacf5f007a96f30e8
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Fri May 6 10:43:00 2022 +0200

    fix(e2e): rest yaml definition as Camel 3.15
---
 e2e/common/files/rest-consumer.yaml | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/e2e/common/files/rest-consumer.yaml b/e2e/common/files/rest-consumer.yaml
index 2b01f13cf..b7b8e26bb 100644
--- a/e2e/common/files/rest-consumer.yaml
+++ b/e2e/common/files/rest-consumer.yaml
@@ -16,10 +16,9 @@
 # ---------------------------------------------------------------------------
 
 - rest:
-    verb:
-      - method: get
-        uri: "/customers/{name}"
-        to: "direct:start"
+    get:
+      - to: "direct:start"
+        path: "/customers/{name}"
 
 - from:
     uri: "direct:start"


[camel-k] 02/03: fix(kamelet): migrate to Camel 3.15 yaml definition

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch release-1.9.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit e849377b52da01786a97ec957a5d64a451e7ebff
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Thu May 5 15:27:29 2022 +0200

    fix(kamelet): migrate to Camel 3.15 yaml definition
    
    Closes #3255
---
 e2e/common/cli/bind_test.go                  |  8 ++++++++
 e2e/common/files/cron-quartz.yaml            | 20 ++++++++++----------
 e2e/common/files/cron-timer.yaml             | 20 ++++++++++----------
 pkg/controller/kameletbinding/integration.go |  8 ++++----
 4 files changed, 32 insertions(+), 24 deletions(-)

diff --git a/e2e/common/cli/bind_test.go b/e2e/common/cli/bind_test.go
index dc118cd65..d40d9be58 100644
--- a/e2e/common/cli/bind_test.go
+++ b/e2e/common/cli/bind_test.go
@@ -51,5 +51,13 @@ func TestKamelCLIBind(t *testing.T) {
 		t.Run("unsuccessful binding, no property", func(t *testing.T) {
 			Expect(Kamel("bind", "timer-source", "log:info", "-n", ns).Execute()).NotTo(Succeed())
 		})
+
+		t.Run("bind uris", func(t *testing.T) {
+			Expect(Kamel("bind", "timer:foo", "log:bar", "-n", ns).Execute()).To(Succeed())
+			Eventually(IntegrationPodPhase(ns, "timer-to-log"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
+			Eventually(IntegrationLogs(ns, "timer-to-log")).Should(ContainSubstring("Body is null"))
+
+			Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())
+		})
 	})
 }
diff --git a/e2e/common/files/cron-quartz.yaml b/e2e/common/files/cron-quartz.yaml
index a036b5ceb..6fcce4f73 100644
--- a/e2e/common/files/cron-quartz.yaml
+++ b/e2e/common/files/cron-quartz.yaml
@@ -21,13 +21,13 @@
       uri: "quartz:trigger"
       parameters:
         cron: "0/1 * * * * ?"
-    steps:
-      - set-header:
-          name: "m"
-          constant: "string!"
-      - set-body:
-          simple: "Magic${header.m}"
-      - to: 
-          uri: "log:info"
-          parameters:
-            show-all: "false"
+      steps:
+        - set-header:
+            name: "m"
+            constant: "string!"
+        - set-body:
+            simple: "Magic${header.m}"
+        - to: 
+            uri: "log:info"
+            parameters:
+              show-all: "false"
diff --git a/e2e/common/files/cron-timer.yaml b/e2e/common/files/cron-timer.yaml
index 1b360233a..707d1974c 100644
--- a/e2e/common/files/cron-timer.yaml
+++ b/e2e/common/files/cron-timer.yaml
@@ -21,14 +21,14 @@
       uri: "timer:tick"
       parameters:
         period: "60000"
-    steps:
-      - set-header:
-          name: "m"
-          constant: "string!"
-      - set-body:
-          simple: "Magic${header.m}"
-      - to: 
-          uri: "log:info"
-          parameters:
-            show-all: "false"
+      steps:
+        - set-header:
+            name: "m"
+            constant: "string!"
+        - set-body:
+            simple: "Magic${header.m}"
+        - to: 
+            uri: "log:info"
+            parameters:
+              show-all: "false"
             
\ No newline at end of file
diff --git a/pkg/controller/kameletbinding/integration.go b/pkg/controller/kameletbinding/integration.go
index 1f66e5d8b..ef8b0fc7d 100644
--- a/pkg/controller/kameletbinding/integration.go
+++ b/pkg/controller/kameletbinding/integration.go
@@ -189,14 +189,14 @@ func CreateIntegrationFor(ctx context.Context, c client.Client, kameletbinding *
 	dslSteps = append(dslSteps, s)
 
 	fromWrapper := map[string]interface{}{
-		"uri": from.URI,
+		"uri":   from.URI,
+		"steps": dslSteps,
 	}
 
 	flowRoute := map[string]interface{}{
 		"route": map[string]interface{}{
-			"id":    "binding",
-			"from":  fromWrapper,
-			"steps": dslSteps,
+			"id":   "binding",
+			"from": fromWrapper,
 		},
 	}
 	encodedRoute, err := json.Marshal(flowRoute)


[camel-k] 01/03: Preparing for next release: e2e preflight test improvement

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch release-1.9.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 2f4a8c4f4392320cbf4c23c9a35f59487cc0215d
Author: phantomjinx <p....@phantomjinx.co.uk>
AuthorDate: Thu Apr 28 17:02:19 2022 +0100

    Preparing for next release: e2e preflight test improvement
    
    * preflight-test.sh
     * Wait for the catalog source to become READY rather than assume it is
    
    * build-bundle-image.sh
    * build-index-image.sh
     * Change the upgrade-test channel to avoid a conflict with existing
       channels
    
    * .../operator.go
     * Functions assume existence of Config reference but this is no longer
       being created implicitly so add to avoid panics
---
 .../kamel-build-bundle/build-bundle-image.sh       |  2 +-
 .../kamel-build-bundle/build-index-image.sh        |  2 +-
 .../actions/kamel-preflight-test/preflight-test.sh | 27 ++++++++++++++++++----
 pkg/util/olm/operator.go                           | 10 ++++++++
 4 files changed, 34 insertions(+), 7 deletions(-)

diff --git a/.github/actions/kamel-build-bundle/build-bundle-image.sh b/.github/actions/kamel-build-bundle/build-bundle-image.sh
index ff5aef7b1..575ada06d 100755
--- a/.github/actions/kamel-build-bundle/build-bundle-image.sh
+++ b/.github/actions/kamel-build-bundle/build-bundle-image.sh
@@ -108,7 +108,7 @@ export CUSTOM_IMAGE=${IMAGE_NAME}
 
 export PREV_XY_CHANNEL="stable-$(make get-last-released-version | grep -Po '\d.\d')"
 echo "PREV_XY_CHANNEL=${PREV_XY_CHANNEL}" >> $GITHUB_ENV
-export NEW_XY_CHANNEL=stable-$(make get-version | grep -Po "\d.\d")
+export NEW_XY_CHANNEL=stable-dev-$(make get-version | grep -Po "\d.\d")
 echo "NEW_XY_CHANNEL=${NEW_XY_CHANNEL}" >> $GITHUB_ENV
 
 make bundle-build \
diff --git a/.github/actions/kamel-build-bundle/build-index-image.sh b/.github/actions/kamel-build-bundle/build-index-image.sh
index bfad918f0..8857d1531 100755
--- a/.github/actions/kamel-build-bundle/build-index-image.sh
+++ b/.github/actions/kamel-build-bundle/build-index-image.sh
@@ -211,7 +211,7 @@ cat << EOF >> ${CATALOG_DIR}/camel-k.yaml
 ---
 schema: olm.channel
 package: camel-k
-name: stable-$(make get-version | grep -Po "\d.\d")
+name: stable-dev-$(make get-version | grep -Po "\d.\d")
 entries:
   - name: camel-k.v$(make get-version | grep -Po "\d.\d.\d")
     replaces: $(make get-last-released-img-name).v$(make get-last-released-version | grep -Po "\d.\d.\d")
diff --git a/.github/actions/kamel-preflight-test/preflight-test.sh b/.github/actions/kamel-preflight-test/preflight-test.sh
index f85e41ef7..a815006da 100755
--- a/.github/actions/kamel-preflight-test/preflight-test.sh
+++ b/.github/actions/kamel-preflight-test/preflight-test.sh
@@ -113,11 +113,28 @@ if [ -n "${BUILD_CATALOG_SOURCE}" ]; then
   #
   # Check catalog source is actually available
   #
-  STATE=$(kubectl get catalogsource ${BUILD_CATALOG_SOURCE} -n ${IMAGE_NAMESPACE} -o=jsonpath='{.status.connectionState.lastObservedState}')
-  if [ "${STATE}" != "READY" ]; then
-    echo "Error: catalog source status is not ready."
-    exit 1
-  fi
+  timeout=5
+  catalog_ready=0
+  until [ ${catalog_ready} -eq 1 ] || [ ${timeout} -eq 0 ]
+  do
+    echo "Info: Awaiting catalog source to become ready"
+    let timeout=${timeout}-1
+
+    STATE=$(kubectl get catalogsource ${BUILD_CATALOG_SOURCE} -n ${IMAGE_NAMESPACE} -o=jsonpath='{.status.connectionState.lastObservedState}')
+    if [ "${STATE}" == "READY" ]; then
+      let catalog_ready=1
+      echo "Info: Catalog source is ready"
+      continue
+    else
+      echo "Warning: catalog source status is not ready."
+      if [ ${timeout} -eq 0 ]; then
+        echo "Error: timedout while awaiting catalog source to start"
+        exit 1
+      fi
+    fi
+
+    sleep 1m
+  done
 
   export KAMEL_INSTALL_OLM_SOURCE_NAMESPACE=${IMAGE_NAMESPACE}
   export KAMEL_INSTALL_OLM_SOURCE=${BUILD_CATALOG_SOURCE}
diff --git a/pkg/util/olm/operator.go b/pkg/util/olm/operator.go
index a2f30a9e7..9bc7a86e0 100644
--- a/pkg/util/olm/operator.go
+++ b/pkg/util/olm/operator.go
@@ -176,6 +176,7 @@ func Install(ctx context.Context, client client.Client, namespace string, global
 			Channel:                options.Channel,
 			StartingCSV:            options.StartingCSV,
 			InstallPlanApproval:    operatorsv1alpha1.ApprovalAutomatic,
+			Config:                 &operatorsv1alpha1.SubscriptionConfig{},
 		},
 	}
 	// Additional configuration
@@ -235,6 +236,15 @@ func maybeSetTolerations(sub *operatorsv1alpha1.Subscription, tolArray []string)
 		if err != nil {
 			return err
 		}
+		if sub == nil {
+			panic("sub is nil")
+		}
+		if sub.Spec == nil {
+			panic("sub.Spec is nil")
+		}
+		if sub.Spec.Config == nil {
+			panic("sub.Spec.Config is nil")
+		}
 		sub.Spec.Config.Tolerations = tolerations
 	}
 	return nil