You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ts...@apache.org on 2022/09/07 04:31:13 UTC

[camel-k] branch release-1.8.x updated (cc828030a -> 871ea1ab3)

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

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


    from cc828030a test(e2e): add E2E test for Service trait
     new c69879463 Patch the Subscription to avoid conflicts with concurrent updates performed by OLM
     new 871ea1ab3 Test operator image installed by the OLM

The 2 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:
 e2e/upgrade/olm_upgrade_test.go       | 18 +++++++++++-------
 pkg/util/defaults/defaults_support.go |  5 +++++
 2 files changed, 16 insertions(+), 7 deletions(-)


[camel-k] 01/02: Patch the Subscription to avoid conflicts with concurrent updates performed by OLM

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

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

commit c69879463e0cd50e0c6dbd5a5213817326f2c78b
Author: Jan Bouska <jb...@redhat.com>
AuthorDate: Wed Aug 10 09:57:13 2022 +0200

    Patch the Subscription to avoid conflicts with concurrent updates performed by OLM
---
 e2e/upgrade/olm_upgrade_test.go | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/e2e/upgrade/olm_upgrade_test.go b/e2e/upgrade/olm_upgrade_test.go
index 4404c388f..6a3fdc3dc 100644
--- a/e2e/upgrade/olm_upgrade_test.go
+++ b/e2e/upgrade/olm_upgrade_test.go
@@ -24,7 +24,9 @@ package common
 
 import (
 	"fmt"
+	"k8s.io/apimachinery/pkg/types"
 	"os"
+	ctrl "sigs.k8s.io/controller-runtime/pkg/client"
 	"testing"
 	"time"
 
@@ -120,13 +122,14 @@ func TestOLMAutomaticUpgrade(t *testing.T) {
 
 			if crossChannelUpgrade {
 				t.Log("Updating Camel-K subscription OLM update channel.")
-				s := ckSubscription(ns)()
-				r, err := ctrlutil.CreateOrUpdate(TestContext, TestClient(), s, func() error {
-					s.Spec.Channel = newUpdateChannel
-					return nil
-				})
-				Expect(err).To(BeNil())
-				Expect(r).To(Equal(ctrlutil.OperationResultUpdated))
+				subscription := ckSubscription(ns)()
+				Expect(subscription).NotTo(BeNil())
+
+				// Patch the Subscription to avoid conflicts with concurrent updates performed by OLM
+				patch := fmt.Sprintf("{\"spec\":{\"channel\":%q}}", newUpdateChannel)
+				Expect(TestClient().Patch(TestContext, subscription, ctrl.RawPatch(types.MergePatchType, []byte(patch)))).To(Succeed())
+				// Assert the response back from the API server
+				Expect(subscription.Spec.Channel).To(Equal(newUpdateChannel))
 			}
 			// Check the previous CSV is being replaced
 			Eventually(clusterServiceVersionPhase(func(csv olm.ClusterServiceVersion) bool {


[camel-k] 02/02: Test operator image installed by the OLM

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

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

commit 871ea1ab363a0703ddbbbf92320473040ac63813
Author: Jan Bouska <jb...@redhat.com>
AuthorDate: Wed Aug 10 08:38:20 2022 +0200

    Test operator image installed by the OLM
---
 e2e/upgrade/olm_upgrade_test.go       | 1 +
 pkg/util/defaults/defaults_support.go | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/e2e/upgrade/olm_upgrade_test.go b/e2e/upgrade/olm_upgrade_test.go
index 6a3fdc3dc..cf84b4122 100644
--- a/e2e/upgrade/olm_upgrade_test.go
+++ b/e2e/upgrade/olm_upgrade_test.go
@@ -152,6 +152,7 @@ func TestOLMAutomaticUpgrade(t *testing.T) {
 			Expect(prevCSVVersion.Version.String()).NotTo(Equal(newCSVVersion.Version.String()))
 
 			Eventually(OperatorPodPhase(ns), TestTimeoutMedium).Should(Equal(corev1.PodRunning))
+			Eventually(OperatorImage(ns), TestTimeoutShort).Should(Equal(defaults.OperatorImage()))
 
 			// Check the IntegrationPlatform has been reconciled
 			Eventually(PlatformVersion(ns)).Should(ContainSubstring(newIPVersionPrefix))
diff --git a/pkg/util/defaults/defaults_support.go b/pkg/util/defaults/defaults_support.go
index 3eab69a58..71b890bb9 100644
--- a/pkg/util/defaults/defaults_support.go
+++ b/pkg/util/defaults/defaults_support.go
@@ -18,6 +18,7 @@ limitations under the License.
 package defaults
 
 import (
+	"fmt"
 	"os"
 	"strconv"
 
@@ -28,6 +29,10 @@ func BaseImage() string {
 	return envOrDefault(baseImage, "KAMEL_BASE_IMAGE", "RELATED_IMAGE_BASE")
 }
 
+func OperatorImage() string {
+	return envOrDefault(fmt.Sprintf("%s:%s", ImageName, Version), "KAMEL_OPERATOR_IMAGE", "KAMEL_K_TEST_OPERATOR_CURRENT_IMAGE")
+}
+
 func InstallDefaultKamelets() bool {
 	return boolEnvOrDefault(installDefaultKamelets, "KAMEL_INSTALL_DEFAULT_KAMELETS")
 }