You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "gansheer (via GitHub)" <gi...@apache.org> on 2023/11/23 16:42:25 UTC
[PR] fix(e2e): Upgrade helm procedure test [camel-k]
gansheer opened a new pull request, #4927:
URL: https://github.com/apache/camel-k/pull/4927
Ref #4923
Add helm upgrade test using manual upgrade of CRDs.
**Release Note**
```release-note
NONE
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(e2e): Upgrade helm procedure test [camel-k]
Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez merged PR #4927:
URL: https://github.com/apache/camel-k/pull/4927
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(e2e): Upgrade helm procedure test [camel-k]
Posted by "gansheer (via GitHub)" <gi...@apache.org>.
gansheer commented on code in PR #4927:
URL: https://github.com/apache/camel-k/pull/4927#discussion_r1404339304
##########
helm/camel-k/README.md:
##########
@@ -56,15 +56,30 @@ additional parameters that can be set during installation.
> **Tip**: List all releases using `helm list`
+## Upgrading the Chart
+
+If you are upgrading the `camel-k` Deployment, you should always use a specific version of the chart and pre-install the CRDS:
+
+```
+$ kubectl replace -k "https://github.com/apache/camel-k/config/crd?ref=vx.y.z"
Review Comment:
I am not sure of this. The charts also contains the edit cluster role, so it would replacing them be one by one.
AFAIK the CRDs in the charts should always be identical to the ones in config for one version. Also I wonder if we should improve the sync between both versions if we want consistency, WDYT?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(e2e): Upgrade helm procedure test [camel-k]
Posted by "gansheer (via GitHub)" <gi...@apache.org>.
gansheer commented on code in PR #4927:
URL: https://github.com/apache/camel-k/pull/4927#discussion_r1404065037
##########
e2e/install/upgrade/helm_upgrade_test.go:
##########
@@ -0,0 +1,150 @@
+//go:build integration
+// +build integration
+
+// To enable compilation of this file in Goland, go to "Settings -> Go -> Vendoring & Build Tags -> Custom Tags" and add "integration"
+
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package upgrade
+
+import (
+ "fmt"
+ "os"
+ "os/exec"
+ "testing"
+
+ . "github.com/apache/camel-k/v2/e2e/support"
+ "github.com/apache/camel-k/v2/pkg/util/defaults"
+ . "github.com/onsi/gomega"
+ corev1 "k8s.io/api/core/v1"
+)
+
+// WARNING: this test is not OLM specific but needs certain setting we provide in OLM installation scenario
+func TestHelmOperatorUpgrade(t *testing.T) {
+ RegisterTestingT(t)
+
+ KAMEL_INSTALL_REGISTRY := os.Getenv("KAMEL_INSTALL_REGISTRY")
+ // need to add last release version
+ releaseVersion := os.Getenv("KAMEL_VERSION")
+ customImage := fmt.Sprintf("%s/apache/camel-k", KAMEL_INSTALL_REGISTRY)
+
+ os.Setenv("CAMEL_K_TEST_MAKE_DIR", "../../../")
+
+ // Ensure no CRDs are already installed
+ UninstallAll()
+ Eventually(CRDs()).Should(HaveLen(0))
+
+ WithNewTestNamespace(t, func(ns string) {
+
+ // Install operator in last released version
+ ExpectExecSucceed(t,
+ exec.Command(
+ "helm",
+ "install",
+ "camel-k",
+ fmt.Sprintf("../../../docs/charts/camel-k-%s.tgz", releaseVersion),
+ "--set",
+ fmt.Sprintf("platform.build.registry.address=%s", KAMEL_INSTALL_REGISTRY),
+ "--set",
+ "platform.build.registry.insecure=true",
+ "-n",
+ ns,
+ ),
+ )
+
+ Eventually(OperatorPod(ns)).ShouldNot(BeNil())
+ Eventually(OperatorImage(ns)).Should(ContainSubstring(releaseVersion))
+ Eventually(CRDs()).Should(HaveLen(ExpectedCRDs))
+
+ //Test a simple route
+ t.Run("simple route", func(t *testing.T) {
+ name := RandomizedSuffixName("yaml")
+ Expect(KamelRun(ns, "files/yaml.yaml", "--name", name).Execute()).To(Succeed())
+ Eventually(IntegrationPodPhase(ns, name), TestTimeoutMedium).Should(Equal(corev1.PodRunning))
+ Eventually(IntegrationLogs(ns, name), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
+ })
+
+ // Upgrade CRDs with kustomize
+ ExpectExecSucceed(t,
Review Comment:
That's the plan for the next commit in this PR :wink:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(e2e): Upgrade helm procedure test [camel-k]
Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on code in PR #4927:
URL: https://github.com/apache/camel-k/pull/4927#discussion_r1404061885
##########
e2e/install/upgrade/helm_upgrade_test.go:
##########
@@ -0,0 +1,150 @@
+//go:build integration
+// +build integration
+
+// To enable compilation of this file in Goland, go to "Settings -> Go -> Vendoring & Build Tags -> Custom Tags" and add "integration"
+
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package upgrade
+
+import (
+ "fmt"
+ "os"
+ "os/exec"
+ "testing"
+
+ . "github.com/apache/camel-k/v2/e2e/support"
+ "github.com/apache/camel-k/v2/pkg/util/defaults"
+ . "github.com/onsi/gomega"
+ corev1 "k8s.io/api/core/v1"
+)
+
+// WARNING: this test is not OLM specific but needs certain setting we provide in OLM installation scenario
+func TestHelmOperatorUpgrade(t *testing.T) {
+ RegisterTestingT(t)
+
+ KAMEL_INSTALL_REGISTRY := os.Getenv("KAMEL_INSTALL_REGISTRY")
+ // need to add last release version
+ releaseVersion := os.Getenv("KAMEL_VERSION")
+ customImage := fmt.Sprintf("%s/apache/camel-k", KAMEL_INSTALL_REGISTRY)
+
+ os.Setenv("CAMEL_K_TEST_MAKE_DIR", "../../../")
+
+ // Ensure no CRDs are already installed
+ UninstallAll()
+ Eventually(CRDs()).Should(HaveLen(0))
+
+ WithNewTestNamespace(t, func(ns string) {
+
+ // Install operator in last released version
+ ExpectExecSucceed(t,
+ exec.Command(
+ "helm",
+ "install",
+ "camel-k",
+ fmt.Sprintf("../../../docs/charts/camel-k-%s.tgz", releaseVersion),
+ "--set",
+ fmt.Sprintf("platform.build.registry.address=%s", KAMEL_INSTALL_REGISTRY),
+ "--set",
+ "platform.build.registry.insecure=true",
+ "-n",
+ ns,
+ ),
+ )
+
+ Eventually(OperatorPod(ns)).ShouldNot(BeNil())
+ Eventually(OperatorImage(ns)).Should(ContainSubstring(releaseVersion))
+ Eventually(CRDs()).Should(HaveLen(ExpectedCRDs))
+
+ //Test a simple route
+ t.Run("simple route", func(t *testing.T) {
+ name := RandomizedSuffixName("yaml")
+ Expect(KamelRun(ns, "files/yaml.yaml", "--name", name).Execute()).To(Succeed())
+ Eventually(IntegrationPodPhase(ns, name), TestTimeoutMedium).Should(Equal(corev1.PodRunning))
+ Eventually(IntegrationLogs(ns, name), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
+ })
+
+ // Upgrade CRDs with kustomize
+ ExpectExecSucceed(t,
Review Comment:
If this is the expected flow, then we need to add these steps in the documentation page. Ideally we need to include a note in the same Helm description page.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(e2e): Upgrade helm procedure test [camel-k]
Posted by "gansheer (via GitHub)" <gi...@apache.org>.
gansheer commented on code in PR #4927:
URL: https://github.com/apache/camel-k/pull/4927#discussion_r1404339304
##########
helm/camel-k/README.md:
##########
@@ -56,15 +56,30 @@ additional parameters that can be set during installation.
> **Tip**: List all releases using `helm list`
+## Upgrading the Chart
+
+If you are upgrading the `camel-k` Deployment, you should always use a specific version of the chart and pre-install the CRDS:
+
+```
+$ kubectl replace -k "https://github.com/apache/camel-k/config/crd?ref=vx.y.z"
Review Comment:
I am not sure of this. The charts also contains the edit cluster role, so it would replacing them be one by one instead of the kustomize replace.
AFAIK the CRDs in the charts should always be identical to the ones in config for one version. Also I wonder if we should improve the sync between both versions if we want consistency, WDYT?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(e2e): Upgrade helm procedure test [camel-k]
Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on code in PR #4927:
URL: https://github.com/apache/camel-k/pull/4927#discussion_r1404202536
##########
helm/camel-k/README.md:
##########
@@ -56,15 +56,30 @@ additional parameters that can be set during installation.
> **Tip**: List all releases using `helm list`
+## Upgrading the Chart
+
+If you are upgrading the `camel-k` Deployment, you should always use a specific version of the chart and pre-install the CRDS:
+
+```
+$ kubectl replace -k "https://github.com/apache/camel-k/config/crd?ref=vx.y.z"
Review Comment:
We should use the CRDs contained into the chart for consistency.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(e2e): Upgrade helm procedure test [camel-k]
Posted by "gansheer (via GitHub)" <gi...@apache.org>.
gansheer commented on code in PR #4927:
URL: https://github.com/apache/camel-k/pull/4927#discussion_r1404339304
##########
helm/camel-k/README.md:
##########
@@ -56,15 +56,30 @@ additional parameters that can be set during installation.
> **Tip**: List all releases using `helm list`
+## Upgrading the Chart
+
+If you are upgrading the `camel-k` Deployment, you should always use a specific version of the chart and pre-install the CRDS:
+
+```
+$ kubectl replace -k "https://github.com/apache/camel-k/config/crd?ref=vx.y.z"
Review Comment:
I am not sure about this. The charts also contains the edit cluster role, so it would replacing them be one by one instead of the kustomize replace.
AFAIK the CRDs in the charts should always be identical to the ones in config for one version. Also I wonder if we should improve the sync between both versions if we want consistency, WDYT?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(e2e): Upgrade helm procedure test [camel-k]
Posted by "gansheer (via GitHub)" <gi...@apache.org>.
gansheer commented on code in PR #4927:
URL: https://github.com/apache/camel-k/pull/4927#discussion_r1410461749
##########
helm/camel-k/README.md:
##########
@@ -56,15 +56,30 @@ additional parameters that can be set during installation.
> **Tip**: List all releases using `helm list`
+## Upgrading the Chart
+
+If you are upgrading the `camel-k` Deployment, you should always use a specific version of the chart and pre-install the CRDS:
+
+```
+$ kubectl replace -k "https://github.com/apache/camel-k/config/crd?ref=vx.y.z"
Review Comment:
The procedure (and the test) are now using the chart CRDs files.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org