This is an automated email from the ASF dual-hosted git repository.
squakez 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 36965a9e8 fix(ci): upgrade test and update to Quarkus 3.40.1
36965a9e8 is described below
commit 36965a9e856b66ec30837ed66bfde2d8dd4f7467
Author: Pasquale Congiusti <[email protected]>
AuthorDate: Sat Oct 3 09:13:40 2026 +0200
fix(ci): upgrade test and update to Quarkus 3.40.1
Closes #6769
---
.github/actions/registry-setting/action.yml | 31 +++--
.github/actions/registry-setting/registry.yaml | 12 +-
.github/workflows/install.yml | 2 +-
.github/workflows/{install.yml => upgrade.yml} | 20 ++-
e2e/{install => }/upgrade/files/yaml.yaml | 0
e2e/{install => }/upgrade/upgrade_test.go | 163 +++++++------------------
pkg/util/defaults/defaults.go | 2 +-
script/Makefile | 17 ++-
8 files changed, 84 insertions(+), 163 deletions(-)
diff --git a/.github/actions/registry-setting/action.yml
b/.github/actions/registry-setting/action.yml
index 6c9adc983..5fb48b4ed 100644
--- a/.github/actions/registry-setting/action.yml
+++ b/.github/actions/registry-setting/action.yml
@@ -28,23 +28,22 @@ runs:
run: |
kubectl create ns registry
# Create a self-signed certificate
- openssl req -x509 -newkey rsa:2048 -nodes -keyout registry.key -out
registry.crt -days 7 -subj "/CN=registry"
+ openssl req -x509 -newkey rsa:2048 -nodes -keyout registry.key -out
registry.crt -days 7 -subj "/CN=registry"
kubectl create secret tls registry-tls --cert=registry.crt
--key=registry.key -n registry
- kubectl apply -f .github/actions/ext-registry-setting/registry.yaml -n
registry
+ kubectl apply -f .github/actions/registry-setting/registry.yaml -n
registry
kubectl wait --for=condition=available deployment/registry -n registry
--timeout=60s
- KAMEL_INSTALL_REGISTRY="$(kubectl -n registry get service registry -o
jsonpath='{.spec.clusterIP}')"
- echo "KAMEL_INSTALL_REGISTRY=$KAMEL_INSTALL_REGISTRY" >> "$GITHUB_ENV"
- echo "Setting registry as $KAMEL_INSTALL_REGISTRY which is required by
certain tests"
- kubectl create secret docker-registry my-registry \
- --docker-server $KAMEL_INSTALL_REGISTRY \
- --docker-username admin \
- --docker-password password \
- -n camel-k
+ DEV_REGISTRY="$(kubectl -n registry get service registry -o
jsonpath='{.spec.clusterIP}')"
+
+ # Useful if we want to include a registry with authentication (we must
uncomment the registry deployment as well)
+ # kubectl create secret docker-registry my-registry \
+ # --docker-server $KAMEL_INSTALL_REGISTRY \
+ # --docker-username admin \
+ # --docker-password password \
+ # -n camel-k
+
kubectl create configmap camel-k-operator-configmap-configuration \
- --from-literal=REGISTRY_ADDRESS="$KAMEL_INSTALL_REGISTRY" \
- --from-literal=REGISTRY_SECRET="my-registry" \
-
--from-literal=MAVEN_REPOSITORIES_ALLOWED="https://maven.repository.redhat.com/ga@id=redhat"
\
+ --from-literal=REGISTRY_ADDRESS="$DEV_REGISTRY" \
-n camel-k
- E2E_TEST_REGISTRY_SECRET_COPY=true
- echo "E2E_TEST_REGISTRY_SECRET_COPY=$E2E_TEST_REGISTRY_SECRET_COPY" >>
$GITHUB_ENV
- echo "Setting E2E_TEST_REGISTRY_SECRET_COPY=true in order to automate
the copy of the pull secret and the setting in each test"
+ # Uncomment to provide a push secret
+ # --from-literal=REGISTRY_SECRET="my-registry"
+
\ No newline at end of file
diff --git a/.github/actions/registry-setting/registry.yaml
b/.github/actions/registry-setting/registry.yaml
index f8a1ba5bd..3e11f8284 100644
--- a/.github/actions/registry-setting/registry.yaml
+++ b/.github/actions/registry-setting/registry.yaml
@@ -71,12 +71,12 @@ spec:
value: /registry-data
# Required to include a secret credential
# We can skip them in case we want an open access
- - name: REGISTRY_AUTH
- value: htpasswd
- - name: REGISTRY_AUTH_HTPASSWD_REALM
- value: Registry Realm
- - name: REGISTRY_AUTH_HTPASSWD_PATH
- value: /auth/htpasswd
+ # - name: REGISTRY_AUTH
+ # value: htpasswd
+ # - name: REGISTRY_AUTH_HTPASSWD_REALM
+ # value: Registry Realm
+ # - name: REGISTRY_AUTH_HTPASSWD_PATH
+ # value: /auth/htpasswd
ports:
- containerPort: 5000
name: registry
diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml
index 4bba6055c..5a8da382b 100644
--- a/.github/workflows/install.yml
+++ b/.github/workflows/install.yml
@@ -58,7 +58,7 @@ concurrency:
cancel-in-progress: true
jobs:
- install-and-upgrade:
+ install:
runs-on: ubuntu-latest
steps:
diff --git a/.github/workflows/install.yml b/.github/workflows/upgrade.yml
similarity index 77%
copy from .github/workflows/install.yml
copy to .github/workflows/upgrade.yml
index 4bba6055c..43ccc06c0 100644
--- a/.github/workflows/install.yml
+++ b/.github/workflows/upgrade.yml
@@ -15,7 +15,7 @@
# limitations under the License.
# ---------------------------------------------------------------------------
-name: install
+name: upgrade
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -58,7 +58,7 @@ concurrency:
cancel-in-progress: true
jobs:
- install-and-upgrade:
+ upgrade:
runs-on: ubuntu-latest
steps:
@@ -71,21 +71,15 @@ jobs:
- name: Infra setting
uses: ./.github/actions/infra-setting
- - name: Install Helm
+ - name: Create upgrade test namespace
shell: bash
run: |
- sudo apt-get install curl gpg apt-transport-https --yes
- curl -fsSL
https://packages.buildkite.com/helm-linux/helm-debian/gpgkey | gpg --dearmor |
sudo tee /usr/share/keyrings/helm.gpg > /dev/null
- echo "deb [signed-by=/usr/share/keyrings/helm.gpg]
https://packages.buildkite.com/helm-linux/helm-debian/any/ any main" | sudo tee
/etc/apt/sources.list.d/helm-stable-debian.list
- sudo apt-get update
- sudo apt-get install helm
+ kubectl create ns camel-k
- - name: Build Helm chart
- shell: bash
- run: |
- make release-helm
+ - name: Registry setting
+ uses: ./.github/actions/registry-setting
- name: Run tests
shell: bash
run: |
- DO_TEST_PREBUILD=false GOTESTFMT="-json 2>&1 | gotestfmt" make
test-install
+ DO_TEST_PREBUILD=false GOTESTFMT="-json 2>&1 | gotestfmt" make
test-upgrade
diff --git a/e2e/install/upgrade/files/yaml.yaml b/e2e/upgrade/files/yaml.yaml
similarity index 100%
rename from e2e/install/upgrade/files/yaml.yaml
rename to e2e/upgrade/files/yaml.yaml
diff --git a/e2e/install/upgrade/upgrade_test.go b/e2e/upgrade/upgrade_test.go
similarity index 57%
rename from e2e/install/upgrade/upgrade_test.go
rename to e2e/upgrade/upgrade_test.go
index b5b6f90bc..0a4fd43ba 100644
--- a/e2e/install/upgrade/upgrade_test.go
+++ b/e2e/upgrade/upgrade_test.go
@@ -24,11 +24,8 @@ package upgrade
import (
"context"
- "fmt"
"os"
"os/exec"
- "path/filepath"
- "regexp"
"testing"
"time"
@@ -39,101 +36,29 @@ import (
. "github.com/apache/camel-k/v2/e2e/support"
v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
"github.com/apache/camel-k/v2/pkg/util/defaults"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func TestUpgrade(t *testing.T) {
- t.Skip("This test requires to be reworked in 2.12. It cannot work as it
is since the older registry is not compatible" +
- " (secret registry) with the one introduced in the last
version.")
-
- WithNewTestNamespace(t, func(ctx context.Context, g *WithT, operatorNs
string) {
+ WithExistingNamedTestNamespace(t, func(ctx context.Context, g *WithT,
operatorNs string) {
// Let's make sure no CRD is yet available in the cluster
// as we must make the procedure to install them accordingly
g.Expect(CRDs(t)()).Should(BeNil(), "No Camel K CRDs should be
previously installed for this test")
// We start the test by installing previous version operator
lastVersion, ok := os.LookupEnv("LAST_RELEASED_VERSION")
g.Expect(ok).To(BeTrue(), "Missing last released version: you
need to set it into LAST_RELEASED_VERSION env var")
- registry := os.Getenv("KAMEL_INSTALL_REGISTRY")
- g.Expect(registry).NotTo(BeEmpty(), "KAMEL_INSTALL_REGISTRY env
var must not be empty")
-
- // Install previous version
-
- lastVersionDir := fmt.Sprintf("/tmp/camel-k-v-%s", lastVersion)
- // We clone and install the previous installed operator
- // from source with tag
- ExpectExecSucceed(t, g,
- exec.Command(
- "rm",
- "-rf",
- lastVersionDir,
- ))
- ExpectExecSucceed(t, g,
- exec.Command(
- "git",
- "clone",
- "https://github.com/apache/camel-k.git",
- lastVersionDir,
- ))
- checkoutCmd := exec.Command(
- "git",
- "checkout",
- fmt.Sprintf("v%s", lastVersion),
- )
- checkoutCmd.Dir = lastVersionDir
- ExpectExecSucceed(t, g, checkoutCmd)
-
- // Change /install/overlays/platform/integration-platform.yaml
on the fly
- // to include the secret copied in this ns into the ITP
- filename := filepath.Join(lastVersionDir, "install",
"overlays", "platform", "integration-platform.yaml")
- data, err := os.ReadFile(filename)
- if err != nil {
- t.Fatal(err)
- }
- re := regexp.MustCompile(`(?m)^(\s*)insecure: true$`)
- updated := re.ReplaceAllString(
- string(data),
- "${1}insecure: true\n${1}secret: my-registry",
- )
- if err := os.WriteFile(filename, []byte(updated), 0644); err !=
nil {
- t.Fatal(err)
- }
-
- installPrevCmd := exec.Command(
- "make",
- "install-k8s-global",
- fmt.Sprintf("NAMESPACE=%s", operatorNs),
- fmt.Sprintf("REGISTRY=%s", registry),
+
+ // Install previous version: mind that the registry
configuration has to be stored by the action
+ // and expected in camel-k namespace
+ applyCmd := exec.Command(
+ "kubectl",
+ "apply",
+ "-k",
+
"github.com/apache/camel-k/install/overlays/all-namespaces?ref=v"+lastVersion,
+ "--server-side",
+ "--force-conflicts",
)
- installPrevCmd.Dir = lastVersionDir
- ExpectExecSucceed(t, g, installPrevCmd)
-
- // TODO: In 2.12 we should move to this one instead
- //
- // kustomizeCmd := exec.Command(
- // "kubectl",
- // "kustomize",
- //
"github.com/apache/camel-k/install/overlays/all-namespaces?ref=v"+lastVersion,
- // )
- // output, err := kustomizeCmd.Output()
- // g.Expect(err).To(BeNil())
- // modified := strings.ReplaceAll(
- // string(output),
- // "namespace: camel-k",
- // "namespace: "+ns,
- // )
- // applyCmd := exec.Command(
- // "kubectl",
- // "apply",
- // "-f",
- // "-",
- // "--server-side",
- // "--force-conflicts",
- // )
- // applyCmd.Stdin = strings.NewReader(modified)
- // ExpectExecSucceed(t, g, applyCmd)
-
- // Refresh the test client to account for the newly installed
CRDs
- RefreshClient(t)
+ ExpectExecSucceed(t, g, applyCmd)
+
// Check the operator image is the previous one
g.Eventually(OperatorImage(t, ctx,
operatorNs)).Should(ContainSubstring(lastVersion))
// Check the operator pod is running
@@ -144,22 +69,40 @@ func TestUpgrade(t *testing.T) {
// Run the Integration
name := RandomizedSuffixName("yaml")
g.Expect(Kamel(t, ctx, "run", "-n", nsIntegration,
"--name", name, "files/yaml.yaml").Execute()).To(Succeed())
- g.Eventually(IntegrationPodPhase(t, ctx, nsIntegration,
name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
- g.Eventually(IntegrationConditionStatus(t, ctx,
nsIntegration, name, v1.IntegrationConditionReady)).
+ g.Eventually(IntegrationConditionStatus(t, ctx,
nsIntegration, name, v1.IntegrationConditionReady), TestTimeoutMedium).
Should(Equal(corev1.ConditionTrue))
+ g.Eventually(IntegrationPodPhase(t, ctx, nsIntegration,
name)).Should(Equal(corev1.PodRunning))
// Check the Integration version
g.Eventually(IntegrationVersion(t, ctx, nsIntegration,
name)).Should(Equal(lastVersion))
// Get the info of the runtime, as we need for further
check later
lastRuntimeVersion := Integration(t, ctx,
nsIntegration, name)().Status.RuntimeVersion
- // Let's upgrade the operator with the newer
installation
+ // Let's upgrade the operator with the newer
installation (default in camel-k namespace)
installNextCmd := exec.Command(
- "make",
- "install-k8s-global",
- fmt.Sprintf("NAMESPACE=%s", operatorNs),
+ "kubectl",
+ "apply",
+ "-k",
+ "install/overlays/all-namespaces",
+ "--server-side",
+ "--force-conflicts",
)
- installNextCmd.Dir = "../../.."
+ installNextCmd.Dir = "../.."
ExpectExecSucceed(t, g, installNextCmd)
+ // The default installation come with a dev registry.
In this test we need to make sure
+ // it reuses the common registry used by previous
installation, so, we immediately disable the
+ // feature
+ disableDevRegistryCmd := exec.Command(
+ "kubectl",
+ "-n",
+ "camel-k",
+ "set",
+ "env",
+ "deployment/camel-k-operator",
+ "ENABLE_DEV_REGISTRY=\"false\"",
+ )
+ disableDevRegistryCmd.Dir = "../.."
+ ExpectExecSucceed(t, g, disableDevRegistryCmd)
+
// Refresh the test client to account for the newly
installed CRDs
RefreshClient(t)
@@ -168,11 +111,6 @@ func TestUpgrade(t *testing.T) {
// Check the operator pod is running
g.Eventually(OperatorPodPhase(t, ctx, operatorNs),
TestTimeoutMedium).Should(Equal(corev1.PodRunning))
- // TODO: In 2.12 we should remove the
IntegrationPlatform removal
- // which was still default in 2.10 and installed and it
is required
- // for this test to complete. Also remove the
DeleteIntegrationPlatform func
- g.Expect(DeleteIntegrationPlatform(t, ctx, operatorNs,
"camel-k")).To(Succeed())
-
// Check the Integration hasn't been upgraded
g.Consistently(IntegrationVersion(t, ctx,
nsIntegration, name), 15*time.Second, 3*time.Second).
Should(Equal(lastVersion))
@@ -184,8 +122,6 @@ func TestUpgrade(t *testing.T) {
// Force the Integration upgrade
g.Expect(Kamel(t, ctx, "rebuild", name, "-n",
nsIntegration).Execute()).To(Succeed())
- // A catalog should be created with the new
configuration
- g.Eventually(DefaultCamelCatalogPhase(t, ctx,
operatorNs), TestTimeoutMedium).Should(Equal(v1.CamelCatalogPhaseReady))
// Check the Integration version has been upgraded
g.Eventually(IntegrationVersion(t, ctx, nsIntegration,
name), TestTimeoutMedium).Should(Equal(defaults.Version))
@@ -205,25 +141,10 @@ func TestUpgrade(t *testing.T) {
g.Eventually(IntegrationPodImage(t, ctx, nsIntegration,
name)).Should(Equal(kit.Status.Image))
// Check the Integration runs correctly
- g.Eventually(IntegrationPodPhase(t, ctx, nsIntegration,
name), TestTimeoutMedium).
- Should(Equal(corev1.PodRunning))
- g.Eventually(IntegrationConditionStatus(t, ctx,
nsIntegration, name, v1.IntegrationConditionReady)).
+ g.Eventually(IntegrationConditionStatus(t, ctx,
nsIntegration, name, v1.IntegrationConditionReady), TestTimeoutMedium).
Should(Equal(corev1.ConditionTrue))
+ g.Eventually(IntegrationPodPhase(t, ctx, nsIntegration,
name)).
+ Should(Equal(corev1.PodRunning))
})
- // TODO: we should verify new CRDs installed are the same as
the one defined in the source core here
- })
-}
-
-func DeleteIntegrationPlatform(t *testing.T, ctx context.Context, ns string,
name string) error {
- itp := v1.IntegrationPlatform{
- TypeMeta: metav1.TypeMeta{
- Kind: "IntegrationPlatform",
- APIVersion: v1.SchemeGroupVersion.String(),
- },
- ObjectMeta: metav1.ObjectMeta{
- Namespace: ns,
- Name: name,
- },
- }
- return TestClient(t).Delete(ctx, &itp)
+ }, "camel-k")
}
diff --git a/pkg/util/defaults/defaults.go b/pkg/util/defaults/defaults.go
index ad55e1b70..162042efc 100644
--- a/pkg/util/defaults/defaults.go
+++ b/pkg/util/defaults/defaults.go
@@ -29,7 +29,7 @@ const (
DefaultRuntimeProvider = "plain-quarkus"
// DefaultRuntimeVersion --
- DefaultRuntimeVersion = "3.39.1"
+ DefaultRuntimeVersion = "3.40.1"
// CamelKRuntimeCatalogVersion --
CamelKRuntimeCatalogVersion = "3.15.3"
diff --git a/script/Makefile b/script/Makefile
index 14ca79a13..a4b154f40 100644
--- a/script/Makefile
+++ b/script/Makefile
@@ -28,7 +28,7 @@ VERSION ?= 2.12.0-SNAPSHOT
LAST_RELEASED_IMAGE_NAME := camel-k-operator
LAST_RELEASED_VERSION ?= 2.11.0
DEFAULT_RUNTIME_PROVIDER := plain-quarkus
-DEFAULT_RUNTIME_VERSION := 3.39.1
+DEFAULT_RUNTIME_VERSION := 3.40.1
# The last camel-k-runtime catalog
# we keep using it until we support the CamelCatalog CR
CK_RUNTIME_CATALOG_VERSION := 3.15.3
@@ -298,13 +298,20 @@ test-advanced: gotestfmt-install
exit $${FAILED}
#
-# Installation and upgrade procedure test using
+# Installation procedure test using
#
test-install: gotestfmt-install
FAILED=0; \
- go test -timeout 20m -v ./e2e/install/kustomize -tags=integration
$(GOTESTFMT) || ((FAILED++)); \
- go test -timeout 20m -v ./e2e/install/helm -tags=integration
$(GOTESTFMT) || ((FAILED++)); \
- go test -timeout 60m -v ./e2e/install/upgrade -tags=integration
$(GOTESTFMT) || ((FAILED++)); \
+ go test -timeout 15m -v ./e2e/install/kustomize -tags=integration
$(GOTESTFMT) || ((FAILED++)); \
+ go test -timeout 15m -v ./e2e/install/helm -tags=integration
$(GOTESTFMT) || ((FAILED++)); \
+ exit $${FAILED}
+
+#
+# Upgrade procedure test using
+#
+test-upgrade: gotestfmt-install
+ FAILED=0; \
+ go test -timeout 15m -v ./e2e/upgrade -tags=integration $(GOTESTFMT) ||
((FAILED++)); \
exit $${FAILED}
#