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
commit c0f3c253b6b99062827219a143d2e5cfcece4b9e Author: Pasquale Congiusti <[email protected]> AuthorDate: Sat May 23 11:04:59 2026 +0200 feat(ctrl): default plain quarkus runtime Closes #6623 --- .../workflows/nightly-quarkus-plain-runtime.yml | 140 --------------------- e2e/support/test_support.go | 2 +- pkg/builder/quarkus_test.go | 6 +- pkg/controller/catalog/initialize.go | 122 +++++++++++++++++- pkg/controller/integration/build_kit_test.go | 14 +-- pkg/controller/integration/build_test.go | 2 +- pkg/controller/integration/monitor_test.go | 3 +- pkg/controller/integrationplatform/create.go | 2 +- pkg/controller/integrationplatform/create_test.go | 15 +-- .../integrationplatform/initialize_test.go | 2 +- pkg/controller/integrationplatform/monitor.go | 95 -------------- pkg/controller/integrationplatform/monitor_test.go | 14 +-- pkg/platform/defaults.go | 2 +- pkg/trait/camel.go | 27 ++-- pkg/trait/trait_test.go | 4 +- pkg/util/camel/camel_runtime_test.go | 6 +- pkg/util/camel/catalog.go | 2 +- pkg/util/camel/catalog_test.go | 8 +- pkg/util/defaults/defaults.go | 8 +- script/Makefile | 26 ++-- script/package_maven_artifacts.sh | 80 ------------ 21 files changed, 201 insertions(+), 379 deletions(-) diff --git a/.github/workflows/nightly-quarkus-plain-runtime.yml b/.github/workflows/nightly-quarkus-plain-runtime.yml deleted file mode 100644 index ab2187bbc..000000000 --- a/.github/workflows/nightly-quarkus-plain-runtime.yml +++ /dev/null @@ -1,140 +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. -# --------------------------------------------------------------------------- - -name: Nightly check against plain Quarkus runtime - -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CAMEL_K_TEST_TIMEOUT_SHORT: 2m - CAMEL_K_TEST_TIMEOUT_MEDIUM: 5m - CAMEL_K_TEST_TIMEOUT_LONG: 10m - CAMEL_K_TEST_TIMEOUT_VERY_LONG: 30m - -on: - schedule: - - cron: "30 3 * * *" - workflow_dispatch: - -jobs: - common: - strategy: - matrix: - # We want to check this on latest development branch only - ref-branch: [main] - - if: github.repository == 'apache/camel-k' - runs-on: ubuntu-latest - steps: - - - name: "Checkout code" - uses: actions/checkout@v4 - with: - ref: ${{ matrix.ref-branch }} - persist-credentials: false - submodules: recursive - - - name: Infra setting - uses: ./.github/actions/infra-setting - - - name: Install operator - shell: bash - run: | - kubectl create ns camel-k - make install-k8s-global - kubectl wait --for=jsonpath='{.status.phase}'=Ready itp camel-k -n camel-k --timeout=60s - kubectl patch itp camel-k -n camel-k -p '{"spec":{"traits":{"camel":{"runtimeProvider":"plain-quarkus", "runtimeVersion":"3.32.1"}}}}' --type=merge - kubectl wait --for=jsonpath='{.status.phase}'=Ready itp camel-k -n camel-k --timeout=60s - - - name: Run test - shell: bash - run: | - DO_TEST_PREBUILD=false GOTESTFMT="-json 2>&1 | gotestfmt" make test-common - - quarkus-native: - strategy: - matrix: - # We want to check this on latest development branch only - ref-branch: [main] - - if: github.repository == 'apache/camel-k' - runs-on: ubuntu-latest - steps: - - - name: "Checkout code" - uses: actions/checkout@v4 - with: - ref: ${{ matrix.ref-branch }} - persist-credentials: false - submodules: recursive - - - name: Infra setting - uses: ./.github/actions/infra-setting - - - name: Install operator - shell: bash - run: | - kubectl create ns camel-k - make install-k8s-global - kubectl wait --for=jsonpath='{.status.phase}'=Ready itp camel-k -n camel-k --timeout=60s - kubectl patch itp camel-k -n camel-k -p '{"spec":{"traits":{"camel":{"runtimeProvider":"plain-quarkus", "runtimeVersion":"3.32.1"}}}}' --type=merge - kubectl wait --for=jsonpath='{.status.phase}'=Ready itp camel-k -n camel-k --timeout=60s - - - name: Run test - shell: bash - run: | - DO_TEST_PREBUILD=false GOTESTFMT="-json 2>&1 | gotestfmt" make test-quarkus-native - - knative: - strategy: - matrix: - # We want to check this on latest development branch only - ref-branch: [main] - - if: github.repository == 'apache/camel-k' - runs-on: ubuntu-latest - steps: - - - name: "Checkout code" - uses: actions/checkout@v4 - with: - ref: ${{ matrix.ref-branch }} - persist-credentials: false - submodules: recursive - - - name: Infra setting - uses: ./.github/actions/infra-setting - - - name: Install Knative - shell: bash - run: | - ./e2e/knative/files/setup.sh - - - name: Install operator - shell: bash - run: | - kubectl create ns camel-k - make install-k8s-global - kubectl wait --for=jsonpath='{.status.phase}'=Ready itp camel-k -n camel-k --timeout=60s - kubectl patch itp camel-k -n camel-k -p '{"spec":{"traits":{"camel":{"runtimeProvider":"plain-quarkus", "runtimeVersion":"3.32.1"}}}}' --type=merge - kubectl wait --for=jsonpath='{.status.phase}'=Ready itp camel-k -n camel-k --timeout=60s - - - name: Run test - shell: bash - run: | - DO_TEST_PREBUILD=false GOTESTFMT="-json 2>&1 | gotestfmt" make test-knative diff --git a/e2e/support/test_support.go b/e2e/support/test_support.go index f12407b9b..156f7cde9 100644 --- a/e2e/support/test_support.go +++ b/e2e/support/test_support.go @@ -2042,7 +2042,7 @@ func DeleteCamelCatalog(t *testing.T, ctx context.Context, ns, name string) func func DefaultCamelCatalogPhase(t *testing.T, ctx context.Context, ns string) func() v1.CamelCatalogPhase { return func() v1.CamelCatalogPhase { - catalogName := fmt.Sprintf("camel-catalog-%s", strings.ToLower(defaults.DefaultRuntimeVersion)) + catalogName := fmt.Sprintf("camel-catalog-%s", strings.ToLower(defaults.CamelKRuntimeCatalogVersion)) c := CamelCatalog(t, ctx, ns, catalogName)() if c == nil { return "" diff --git a/pkg/builder/quarkus_test.go b/pkg/builder/quarkus_test.go index 1fd8b9a4e..51de9f22a 100644 --- a/pkg/builder/quarkus_test.go +++ b/pkg/builder/quarkus_test.go @@ -231,7 +231,7 @@ func TestBuildQuarkusRunner(t *testing.T) { c, err := internal.NewFakeClient(&v1.CamelCatalog{ ObjectMeta: metav1.ObjectMeta{ Namespace: "default", - Name: "camel-catalog-" + defaults.DefaultRuntimeVersion, + Name: "camel-catalog-" + defaults.CamelKRuntimeCatalogVersion, }, Spec: v1.CamelCatalogSpec{ Runtime: defaultCatalog.Runtime, @@ -256,7 +256,7 @@ func TestBuildQuarkusRunner(t *testing.T) { Dependencies: []string{"mvn:org.apache.camel.k:camel-k-runtime"}, }, } - if strings.Contains(defaults.DefaultRuntimeVersion, "SNAPSHOT") { + if strings.Contains(defaults.CamelKRuntimeCatalogVersion, "SNAPSHOT") { builderContext.Build.Maven.Repositories = []v1.Repository{ { ID: "APACHE-SNAPSHOT", @@ -304,7 +304,7 @@ func TestBuildQuarkusRunner(t *testing.T) { require.NoError(t, err) assert.NotEmpty(t, builderContext.Artifacts) camelRuntimeDepFound := false - expectedArtifact := fmt.Sprintf("org.apache.camel.k.camel-k-runtime-%s.jar", defaults.DefaultRuntimeVersion) + expectedArtifact := fmt.Sprintf("org.apache.camel.k.camel-k-runtime-%s.jar", defaults.CamelKRuntimeCatalogVersion) for _, artifact := range builderContext.Artifacts { if artifact.ID == expectedArtifact { camelRuntimeDepFound = true diff --git a/pkg/controller/catalog/initialize.go b/pkg/controller/catalog/initialize.go index d5a023cbf..4e8825837 100644 --- a/pkg/controller/catalog/initialize.go +++ b/pkg/controller/catalog/initialize.go @@ -19,9 +19,13 @@ package catalog import ( "context" + "strings" v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1" + "github.com/apache/camel-k/v2/pkg/client" corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8sclient "sigs.k8s.io/controller-runtime/pkg/client" ) // NewInitializeAction returns a action that initializes the catalog configuration when not provided by the user. @@ -43,11 +47,6 @@ func (action *initializeAction) CanHandle(catalog *v1.CamelCatalog) bool { func (action *initializeAction) Handle(ctx context.Context, catalog *v1.CamelCatalog) (*v1.CamelCatalog, error) { action.L.Info("Initializing CamelCatalog") - - return initialize(catalog) -} - -func initialize(catalog *v1.CamelCatalog) (*v1.CamelCatalog, error) { target := catalog.DeepCopy() if catalog.Spec.GetQuarkusToolingImage() == "" { @@ -68,5 +67,118 @@ func initialize(catalog *v1.CamelCatalog) (*v1.CamelCatalog, error) { ) } + action.L.Info("Cloning CamelCatalog for Plain Quarkus runtime") + if err := action.addPlainQuarkusCatalog(ctx, catalog); err != nil { + // Only warn the user, we don't want to fail + action.L.Infof( + "WARN: the operator wasn't able to clone %s catalog. You won't be able to run a plain Quarkus runtime provider.", + catalog.Name, + ) + } + return target, nil } + +// addPlainQuarkusCatalog is a workaround while a CamelCatalog custom resource is required. The goal is to clone any existing +// Camel K Runtime catalog and adjust to make it work with plain Quarkus runtime provider. +func (action *initializeAction) addPlainQuarkusCatalog(ctx context.Context, catalog *v1.CamelCatalog) error { + runtimeSpec := v1.RuntimeSpec{ + Version: catalog.Spec.GetRuntimeVersion(), + Provider: v1.RuntimeProviderPlainQuarkus, + } + cat, err := loadCatalog(ctx, action.client, catalog.Namespace, runtimeSpec) + if err != nil { + return err + } + if cat == nil { + // Clone the catalog to enable Quarkus Plain runtime + clonedCatalog := catalog.DeepCopy() + clonedCatalog.Status = v1.CamelCatalogStatus{} + clonedCatalog.ObjectMeta = metav1.ObjectMeta{ + Namespace: catalog.Namespace, + Name: strings.ReplaceAll(catalog.Name, "camel-catalog", "camel-catalog-quarkus"), + Labels: catalog.Labels, + Annotations: catalog.Annotations, + } + clonedCatalog.Spec.Runtime.Provider = v1.RuntimeProviderPlainQuarkus + clonedCatalog.Spec.Runtime.Dependencies = []v1.MavenArtifact{ + { + GroupID: v1.MavenQuarkusGroupID, + ArtifactID: "camel-quarkus-core", + }, + } + if clonedCatalog.Spec.Runtime.Capabilities != nil { + clonedCatalog.Spec.Runtime.Capabilities["cron"] = v1.Capability{ + Dependencies: []v1.MavenArtifact{}, + } + clonedCatalog.Spec.Runtime.Capabilities["knative"] = v1.Capability{ + Dependencies: []v1.MavenArtifact{ + { + GroupID: v1.MavenQuarkusGroupID, + ArtifactID: "camel-quarkus-knative", + }, + }, + } + runtimesProps := clonedCatalog.Spec.Runtime.Capabilities["master"].RuntimeProperties + clonedCatalog.Spec.Runtime.Capabilities["master"] = v1.Capability{ + Dependencies: []v1.MavenArtifact{ + { + GroupID: v1.MavenQuarkusGroupID, + ArtifactID: "camel-quarkus-master", + }, + { + GroupID: v1.MavenQuarkusGroupID, + ArtifactID: "camel-quarkus-kubernetes", + }, + { + GroupID: v1.MavenQuarkusGroupID, + ArtifactID: "camel-quarkus-kubernetes-cluster-service", + }, + }, + RuntimeProperties: runtimesProps, + } + clonedCatalog.Spec.Runtime.Capabilities["resume-kafka"] = v1.Capability{ + Dependencies: []v1.MavenArtifact{}, + } + clonedCatalog.Spec.Runtime.Capabilities["jolokia"] = v1.Capability{ + Dependencies: []v1.MavenArtifact{ + { + GroupID: v1.MavenQuarkusGroupID, + ArtifactID: "camel-quarkus-jaxb", + }, + { + GroupID: v1.MavenQuarkusGroupID, + ArtifactID: "camel-quarkus-management", + }, + { + GroupID: "org.jolokia", + ArtifactID: "jolokia-agent-jvm", + Classifier: "javaagent", + Version: "2.1.1", + }, + }, + } + } + + return action.client.Create(ctx, clonedCatalog) + } + + return nil +} + +func loadCatalog(ctx context.Context, c client.Client, namespace string, runtimeSpec v1.RuntimeSpec) (*v1.CamelCatalog, error) { + options := []k8sclient.ListOption{ + k8sclient.InNamespace(namespace), + } + list := v1.NewCamelCatalogList() + if err := c.List(ctx, &list, options...); err != nil { + return nil, err + } + for _, cc := range list.Items { + if cc.Spec.Runtime.Provider == runtimeSpec.Provider && cc.Spec.Runtime.Version == runtimeSpec.Version { + return &cc, nil + } + } + + return nil, nil +} diff --git a/pkg/controller/integration/build_kit_test.go b/pkg/controller/integration/build_kit_test.go index f17ebf859..0add666ba 100644 --- a/pkg/controller/integration/build_kit_test.go +++ b/pkg/controller/integration/build_kit_test.go @@ -167,7 +167,7 @@ func TestCamelBuildKitKitLookupExistingKit(t *testing.T) { Spec: v1.CamelCatalogSpec{ Runtime: v1.RuntimeSpec{ Provider: v1.RuntimeProviderQuarkus, - Version: defaults.DefaultRuntimeVersion, + Version: defaults.CamelKRuntimeCatalogVersion, }, }, } @@ -181,13 +181,13 @@ func TestCamelBuildKitKitLookupExistingKit(t *testing.T) { Name: "my-ik", Labels: map[string]string{ v1.IntegrationKitTypeLabel: v1.IntegrationKitTypePlatform, - kubernetes.CamelLabelRuntimeVersion: defaults.DefaultRuntimeVersion, + kubernetes.CamelLabelRuntimeVersion: defaults.CamelKRuntimeCatalogVersion, kubernetes.CamelLabelRuntimeProvider: string(v1.RuntimeProviderQuarkus), }, }, Status: v1.IntegrationKitStatus{ Phase: v1.IntegrationKitPhaseBuildRunning, - RuntimeVersion: defaults.DefaultRuntimeVersion, + RuntimeVersion: defaults.CamelKRuntimeCatalogVersion, RuntimeProvider: v1.RuntimeProviderQuarkus, }, } @@ -202,7 +202,7 @@ func TestCamelBuildKitKitLookupExistingKit(t *testing.T) { }, Status: v1.IntegrationStatus{ Phase: v1.IntegrationPhaseBuildingKit, - RuntimeVersion: defaults.DefaultRuntimeVersion, + RuntimeVersion: defaults.CamelKRuntimeCatalogVersion, RuntimeProvider: v1.RuntimeProviderQuarkus, }, } @@ -262,7 +262,7 @@ func TestCamelBuildKitKitLookupNoMatchingKits(t *testing.T) { Spec: v1.CamelCatalogSpec{ Runtime: v1.RuntimeSpec{ Provider: v1.RuntimeProviderQuarkus, - Version: defaults.DefaultRuntimeVersion, + Version: defaults.CamelKRuntimeCatalogVersion, }, }, } @@ -276,7 +276,7 @@ func TestCamelBuildKitKitLookupNoMatchingKits(t *testing.T) { Name: "my-ik", Labels: map[string]string{ v1.IntegrationKitTypeLabel: v1.IntegrationKitTypePlatform, - kubernetes.CamelLabelRuntimeVersion: defaults.DefaultRuntimeVersion, + kubernetes.CamelLabelRuntimeVersion: defaults.CamelKRuntimeCatalogVersion, kubernetes.CamelLabelRuntimeProvider: string(v1.RuntimeProviderQuarkus), }, }, @@ -297,7 +297,7 @@ func TestCamelBuildKitKitLookupNoMatchingKits(t *testing.T) { }, Status: v1.IntegrationStatus{ Phase: v1.IntegrationPhaseBuildingKit, - RuntimeVersion: defaults.DefaultRuntimeVersion, + RuntimeVersion: defaults.CamelKRuntimeCatalogVersion, RuntimeProvider: v1.RuntimeProviderQuarkus, }, } diff --git a/pkg/controller/integration/build_test.go b/pkg/controller/integration/build_test.go index 70e9c6ad4..682edd41d 100644 --- a/pkg/controller/integration/build_test.go +++ b/pkg/controller/integration/build_test.go @@ -64,7 +64,7 @@ func TestIntegrationBuildSubmitted(t *testing.T) { Spec: v1.CamelCatalogSpec{ Runtime: v1.RuntimeSpec{ Provider: v1.RuntimeProviderQuarkus, - Version: defaults.DefaultRuntimeVersion, + Version: defaults.CamelKRuntimeCatalogVersion, }, }, } diff --git a/pkg/controller/integration/monitor_test.go b/pkg/controller/integration/monitor_test.go index 925c22466..2062e4db8 100644 --- a/pkg/controller/integration/monitor_test.go +++ b/pkg/controller/integration/monitor_test.go @@ -122,6 +122,7 @@ func TestMonitorFailureIntegration(t *testing.T) { require.NoError(t, err) // simulate a trait execution failure + it.Status.RuntimeProvider = v1.RuntimeProviderQuarkus it.Status.RuntimeVersion = "0.0.0" a := monitorAction{} @@ -150,7 +151,7 @@ func nominalEnvironment() (client.Client, *v1.Integration, error) { Spec: v1.CamelCatalogSpec{ Runtime: v1.RuntimeSpec{ Provider: v1.RuntimeProviderQuarkus, - Version: defaults.DefaultRuntimeVersion, + Version: defaults.CamelKRuntimeCatalogVersion, }, }, } diff --git a/pkg/controller/integrationplatform/create.go b/pkg/controller/integrationplatform/create.go index 2e01dfec9..f7e54ac46 100644 --- a/pkg/controller/integrationplatform/create.go +++ b/pkg/controller/integrationplatform/create.go @@ -63,7 +63,7 @@ func (action *createAction) Handle(ctx context.Context, platform *v1.Integration } // if bundled version, load catalog spec from resources - if platform.Status.Build.RuntimeVersion == defaults.DefaultRuntimeVersion { + if platform.Status.Build.RuntimeVersion == defaults.CamelKRuntimeCatalogVersion { if platform, err = action.handleBundledCatalog(ctx, platform, catalog); err != nil { return platform, err } diff --git a/pkg/controller/integrationplatform/create_test.go b/pkg/controller/integrationplatform/create_test.go index 36a52e891..d7c9077fe 100644 --- a/pkg/controller/integrationplatform/create_test.go +++ b/pkg/controller/integrationplatform/create_test.go @@ -50,7 +50,7 @@ func TestCreate(t *testing.T) { IntegrationPlatformSpec: v1.IntegrationPlatformSpec{ Build: v1.IntegrationPlatformBuildSpec{ RuntimeProvider: v1.RuntimeProviderQuarkus, - RuntimeVersion: defaults.DefaultRuntimeVersion, + RuntimeVersion: defaults.CamelKRuntimeCatalogVersion, }, }, } @@ -67,7 +67,7 @@ func TestCreate(t *testing.T) { require.NoError(t, err) assert.NotNil(t, answer) assert.Equal(t, v1.IntegrationPlatformPhaseReady, answer.Status.Phase) - assert.Equal(t, defaults.DefaultRuntimeVersion, answer.Status.Build.RuntimeVersion) + assert.Equal(t, defaults.CamelKRuntimeCatalogVersion, answer.Status.Build.RuntimeVersion) assert.Equal(t, v1.RuntimeProviderQuarkus, answer.Status.Build.RuntimeProvider) assert.NotEqual(t, "", answer.Status.Build.RuntimeCoreVersion) assert.Equal(t, corev1.ConditionTrue, answer.Status.GetCondition(v1.IntegrationPlatformConditionCamelCatalogAvailable).Status) @@ -86,13 +86,13 @@ func TestCatalogAlreadyPresent(t *testing.T) { IntegrationPlatformSpec: v1.IntegrationPlatformSpec{ Build: v1.IntegrationPlatformBuildSpec{ RuntimeProvider: v1.RuntimeProviderQuarkus, - RuntimeVersion: defaults.DefaultRuntimeVersion, + RuntimeVersion: defaults.CamelKRuntimeCatalogVersion, }, }, } - catalog := v1.NewCamelCatalog("ns", fmt.Sprintf("camel-catalog-%s", defaults.DefaultRuntimeVersion)) - catalog.Spec.Runtime.Version = defaults.DefaultRuntimeVersion + catalog := v1.NewCamelCatalog("ns", fmt.Sprintf("camel-catalog-%s", defaults.CamelKRuntimeCatalogVersion)) + catalog.Spec.Runtime.Version = defaults.CamelKRuntimeCatalogVersion catalog.Spec.Runtime.Provider = v1.RuntimeProviderQuarkus catalog.Spec.Runtime.Metadata = map[string]string{ "camel.version": "4.4.0", @@ -127,12 +127,13 @@ func TestCreateNewCatalog(t *testing.T) { Maven: v1.MavenSpec{ LocalRepository: m2RepoTmpDir, }, + RuntimeVersion: defaults.CamelKRuntimeCatalogVersion, } ip.Status = v1.IntegrationPlatformStatus{ IntegrationPlatformSpec: v1.IntegrationPlatformSpec{ Build: v1.IntegrationPlatformBuildSpec{ RuntimeProvider: v1.RuntimeProviderQuarkus, - RuntimeVersion: defaults.DefaultRuntimeVersion, + RuntimeVersion: defaults.CamelKRuntimeCatalogVersion, Timeout: &metav1.Duration{ Duration: 1 * time.Minute, }, @@ -200,7 +201,7 @@ func TestCreateNewCatalog(t *testing.T) { IntegrationPlatformSpec: v1.IntegrationPlatformSpec{ Build: v1.IntegrationPlatformBuildSpec{ RuntimeProvider: v1.RuntimeProviderQuarkus, - RuntimeVersion: defaults.DefaultRuntimeVersion, + RuntimeVersion: defaults.CamelKRuntimeCatalogVersion, Timeout: &metav1.Duration{ Duration: 1 * time.Minute, }, diff --git a/pkg/controller/integrationplatform/initialize_test.go b/pkg/controller/integrationplatform/initialize_test.go index 1ad5bcf6c..2cf76278b 100644 --- a/pkg/controller/integrationplatform/initialize_test.go +++ b/pkg/controller/integrationplatform/initialize_test.go @@ -48,7 +48,7 @@ func TestDefaultRuntimeSpec(t *testing.T) { require.NoError(t, err) assert.Equal(t, v1.IntegrationPlatformPhaseCreating, answer.Status.Phase) assert.Equal(t, defaults.DefaultRuntimeVersion, answer.Status.Build.RuntimeVersion) - assert.Equal(t, v1.RuntimeProviderQuarkus, answer.Status.Build.RuntimeProvider) + assert.Equal(t, v1.RuntimeProviderPlainQuarkus, answer.Status.Build.RuntimeProvider) } func TestUserRuntimeSpec(t *testing.T) { diff --git a/pkg/controller/integrationplatform/monitor.go b/pkg/controller/integrationplatform/monitor.go index f1afad53b..aa0f0ac24 100644 --- a/pkg/controller/integrationplatform/monitor.go +++ b/pkg/controller/integrationplatform/monitor.go @@ -27,7 +27,6 @@ import ( "github.com/apache/camel-k/v2/pkg/util/defaults" "github.com/apache/camel-k/v2/pkg/util/openshift" corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // NewMonitorAction returns an action that monitors the integration platform after it's fully initialized. @@ -131,13 +130,6 @@ func (action *monitorAction) Handle(ctx context.Context, platform *v1.Integratio action.checkTraitAnnotationsDeprecatedNotice(platform) action.checkMavenSettings(platform) action.checkKameletsCatalogRepoDeprecatedNotice(platform) - if err = action.addPlainQuarkusCatalog(ctx, catalog); err != nil { - // Only warn the user, we don't want to fail - action.L.Infof( - "WARN: the operator wasn't able to clone %s catalog. You won't be able to run a plain Quarkus runtime provider.", - catalog.Name, - ) - } platform.Status.SetCondition( v1.IntegrationPlatformConditionType("IntegrationPlatformDeprecated"), @@ -218,90 +210,3 @@ func specOrDefault(runtimeVersionSpec string) string { return runtimeVersionSpec } - -// addPlainQuarkusCatalog is a workaround while a CamelCatalog custom resource is required. The goal is to clone any existing -// Camel K Runtime catalog and adjust to make it work with plain Quarkus runtime provider. -func (action *monitorAction) addPlainQuarkusCatalog(ctx context.Context, catalog *v1.CamelCatalog) error { - runtimeSpec := v1.RuntimeSpec{ - Version: catalog.Spec.GetRuntimeVersion(), - Provider: v1.RuntimeProviderPlainQuarkus, - } - cat, err := loadCatalog(ctx, action.client, catalog.Namespace, runtimeSpec) - if err != nil { - return err - } - if cat == nil { - // Clone the catalog to enable Quarkus Plain runtime - clonedCatalog := catalog.DeepCopy() - clonedCatalog.Status = v1.CamelCatalogStatus{} - clonedCatalog.ObjectMeta = metav1.ObjectMeta{ - Namespace: catalog.Namespace, - Name: strings.ReplaceAll(catalog.Name, "camel-catalog", "camel-catalog-quarkus"), - Labels: catalog.Labels, - Annotations: catalog.Annotations, - } - clonedCatalog.Spec.Runtime.Provider = v1.RuntimeProviderPlainQuarkus - clonedCatalog.Spec.Runtime.Dependencies = []v1.MavenArtifact{ - { - GroupID: v1.MavenQuarkusGroupID, - ArtifactID: "camel-quarkus-core", - }, - } - if clonedCatalog.Spec.Runtime.Capabilities != nil { - clonedCatalog.Spec.Runtime.Capabilities["cron"] = v1.Capability{ - Dependencies: []v1.MavenArtifact{}, - } - clonedCatalog.Spec.Runtime.Capabilities["knative"] = v1.Capability{ - Dependencies: []v1.MavenArtifact{ - { - GroupID: v1.MavenQuarkusGroupID, - ArtifactID: "camel-quarkus-knative", - }, - }, - } - runtimesProps := clonedCatalog.Spec.Runtime.Capabilities["master"].RuntimeProperties - clonedCatalog.Spec.Runtime.Capabilities["master"] = v1.Capability{ - Dependencies: []v1.MavenArtifact{ - { - GroupID: v1.MavenQuarkusGroupID, - ArtifactID: "camel-quarkus-master", - }, - { - GroupID: v1.MavenQuarkusGroupID, - ArtifactID: "camel-quarkus-kubernetes", - }, - { - GroupID: v1.MavenQuarkusGroupID, - ArtifactID: "camel-quarkus-kubernetes-cluster-service", - }, - }, - RuntimeProperties: runtimesProps, - } - clonedCatalog.Spec.Runtime.Capabilities["resume-kafka"] = v1.Capability{ - Dependencies: []v1.MavenArtifact{}, - } - clonedCatalog.Spec.Runtime.Capabilities["jolokia"] = v1.Capability{ - Dependencies: []v1.MavenArtifact{ - { - GroupID: v1.MavenQuarkusGroupID, - ArtifactID: "camel-quarkus-jaxb", - }, - { - GroupID: v1.MavenQuarkusGroupID, - ArtifactID: "camel-quarkus-management", - }, - { - GroupID: "org.jolokia", - ArtifactID: "jolokia-agent-jvm", - Classifier: "javaagent", - Version: "2.1.1", - }, - }, - } - } - - return action.client.Create(ctx, clonedCatalog) - } - - return nil -} diff --git a/pkg/controller/integrationplatform/monitor_test.go b/pkg/controller/integrationplatform/monitor_test.go index dd71daa70..7c8cad6c6 100644 --- a/pkg/controller/integrationplatform/monitor_test.go +++ b/pkg/controller/integrationplatform/monitor_test.go @@ -123,9 +123,9 @@ func TestMonitorDriftRuntime(t *testing.T) { } func TestMonitorDriftDefault(t *testing.T) { - catalog := v1.NewCamelCatalog("ns", fmt.Sprintf("camel-catalog-%s", defaults.DefaultRuntimeVersion)) + catalog := v1.NewCamelCatalog("ns", fmt.Sprintf("camel-catalog-%s", defaults.CamelKRuntimeCatalogVersion)) catalog.Spec.Runtime.Version = defaults.DefaultRuntimeVersion - catalog.Spec.Runtime.Provider = v1.RuntimeProviderQuarkus + catalog.Spec.Runtime.Provider = v1.RuntimeProviderPlainQuarkus catalog.Spec.Runtime.Metadata = map[string]string{ "camel.version": "3.2.1", } @@ -134,7 +134,7 @@ func TestMonitorDriftDefault(t *testing.T) { ip.Name = "ck" ip.Spec.Build.Registry.Address = "1.2.3.4" ip.Status.Build.RuntimeVersion = defaults.DefaultRuntimeVersion - ip.Status.Build.RuntimeProvider = v1.RuntimeProviderQuarkus + ip.Status.Build.RuntimeProvider = v1.RuntimeProviderPlainQuarkus ip.Status.Build.Registry.Address = "1.2.3.4" ip.Status.Phase = v1.IntegrationPlatformPhaseReady c, err := internal.NewFakeClient(&ip, &catalog) @@ -155,9 +155,9 @@ func TestMonitorDriftDefault(t *testing.T) { } func TestMonitorDriftConfiguration(t *testing.T) { - catalog := v1.NewCamelCatalog("ns", fmt.Sprintf("camel-catalog-%s", defaults.DefaultRuntimeVersion)) + catalog := v1.NewCamelCatalog("ns", fmt.Sprintf("camel-catalog-%s", defaults.CamelKRuntimeCatalogVersion)) catalog.Spec.Runtime.Version = defaults.DefaultRuntimeVersion - catalog.Spec.Runtime.Provider = v1.RuntimeProviderQuarkus + catalog.Spec.Runtime.Provider = v1.RuntimeProviderPlainQuarkus catalog.Spec.Runtime.Metadata = map[string]string{ "camel.version": "3.2.1", } @@ -178,7 +178,7 @@ func TestMonitorDriftConfiguration(t *testing.T) { IntegrationPlatformSpec: v1.IntegrationPlatformSpec{ Build: v1.IntegrationPlatformBuildSpec{ RuntimeVersion: defaults.DefaultRuntimeVersion, - RuntimeProvider: v1.RuntimeProviderQuarkus, + RuntimeProvider: v1.RuntimeProviderPlainQuarkus, RuntimeCoreVersion: "3.2.1", Registry: v1.RegistrySpec{ Address: "1.2.3.4", @@ -205,7 +205,7 @@ func TestMonitorDriftConfiguration(t *testing.T) { assert.Equal(t, v1.IntegrationPlatformPhaseReady, answer.Status.Phase) assert.Equal(t, defaults.Version, answer.Status.Version) assert.Equal(t, defaults.DefaultRuntimeVersion, answer.Status.Build.RuntimeVersion) - assert.Equal(t, v1.RuntimeProviderQuarkus, answer.Status.Build.RuntimeProvider) + assert.Equal(t, v1.RuntimeProviderPlainQuarkus, answer.Status.Build.RuntimeProvider) assert.Equal(t, "3.2.1", answer.Status.Build.RuntimeCoreVersion) assert.Equal(t, "override", answer.Status.Traits.Container.Name) } diff --git a/pkg/platform/defaults.go b/pkg/platform/defaults.go index 9977ec371..28175c98a 100644 --- a/pkg/platform/defaults.go +++ b/pkg/platform/defaults.go @@ -64,7 +64,7 @@ func ConfigureDefaults(ctx context.Context, c client.Client, p *v1.IntegrationPl } if p.Status.Build.RuntimeProvider == "" { - p.Status.Build.RuntimeProvider = v1.RuntimeProviderQuarkus + p.Status.Build.RuntimeProvider = defaults.DefaultRuntimeProvider log.Debugf("Integration Platform %s [%s]: setting default runtime provider %s", p.Name, p.Namespace, v1.RuntimeProviderQuarkus) } if p.Status.Build.RuntimeVersion == "" { diff --git a/pkg/trait/camel.go b/pkg/trait/camel.go index acb79c19e..fe55655d8 100644 --- a/pkg/trait/camel.go +++ b/pkg/trait/camel.go @@ -76,6 +76,11 @@ func (t *camelTrait) Configure(e *Environment) (bool, *TraitCondition, error) { return false, NewIntegrationConditionPlatformDisabledWithMessage("Camel", "synthetic integration"), nil } + if t.RuntimeVersion == "" { + t.runtimeProvider = determineRuntimeProvider(e) + } else { + t.runtimeProvider = t.RuntimeProvider + } if t.RuntimeVersion == "" { if runtimeVersion, err := determineRuntimeVersion(e); err != nil { return false, nil, err @@ -86,12 +91,6 @@ func (t *camelTrait) Configure(e *Environment) (bool, *TraitCondition, error) { t.runtimeVersion = t.RuntimeVersion } - if t.RuntimeProvider == "" { - t.runtimeProvider = "quarkus" - } else { - t.runtimeProvider = t.RuntimeProvider - } - var cond *TraitCondition //nolint: staticcheck if (e.Integration != nil && (!e.Integration.IsManagedBuild() || e.Integration.IsGitBuild())) || @@ -167,7 +166,7 @@ func (t *camelTrait) loadOrCreateCatalog(e *Environment) error { if runtime.Provider == v1.RuntimeProviderPlainQuarkus { // We need this workaround to load the last existing catalog // TODO: this part will be subject to future refactoring - runtime.Version = defaults.DefaultRuntimeVersion + runtime.Version = defaults.CamelKRuntimeCatalogVersion } catalog, err := camel.LoadCatalog(e.Ctx, e.Client, catalogNamespace, runtime) @@ -242,6 +241,20 @@ func determineRuntimeVersion(e *Environment) (string, error) { return "", errors.New("unable to determine runtime version") } +func determineRuntimeProvider(e *Environment) string { + if e.Integration != nil && e.Integration.Status.RuntimeProvider != "" { + return string(e.Integration.Status.RuntimeProvider) + } + if e.IntegrationKit != nil && e.IntegrationKit.Status.RuntimeProvider != "" { + return string(e.IntegrationKit.Status.RuntimeProvider) + } + if e.IntegrationProfile != nil && e.IntegrationProfile.Spec.Build.RuntimeProvider != "" { + return string(e.IntegrationProfile.Spec.Build.RuntimeProvider) + } + + return defaults.DefaultRuntimeProvider +} + func (t *camelTrait) computeUserProperties(e *Environment) []ctrl.Object { sources := e.Integration.AllSources() maps := make([]ctrl.Object, 0, len(sources)+1) diff --git a/pkg/trait/trait_test.go b/pkg/trait/trait_test.go index 29e4ba5c2..9fb4f7598 100644 --- a/pkg/trait/trait_test.go +++ b/pkg/trait/trait_test.go @@ -301,7 +301,7 @@ func testDefaultIntegrationPhaseTraitsSetting(t *testing.T, phase v1.Integration }, } // Load the default catalog - camelCatalogData, err := resources.Resource(fmt.Sprintf("/resources/camel-catalog-%s.yaml", defaults.DefaultRuntimeVersion)) + camelCatalogData, err := resources.Resource(fmt.Sprintf("/resources/camel-catalog-%s.yaml", defaults.CamelKRuntimeCatalogVersion)) require.NoError(t, err) var cat v1.CamelCatalog err = yaml.Unmarshal(camelCatalogData, &cat) @@ -388,7 +388,7 @@ func TestIntegrationTraitsSetting(t *testing.T) { }, } // Load the default catalog - camelCatalogData, err := resources.Resource(fmt.Sprintf("/resources/camel-catalog-%s.yaml", defaults.DefaultRuntimeVersion)) + camelCatalogData, err := resources.Resource(fmt.Sprintf("/resources/camel-catalog-%s.yaml", defaults.CamelKRuntimeCatalogVersion)) require.NoError(t, err) var cat v1.CamelCatalog err = yaml.Unmarshal(camelCatalogData, &cat) diff --git a/pkg/util/camel/camel_runtime_test.go b/pkg/util/camel/camel_runtime_test.go index 8e431fb18..581d4cc61 100644 --- a/pkg/util/camel/camel_runtime_test.go +++ b/pkg/util/camel/camel_runtime_test.go @@ -42,7 +42,7 @@ func TestCreateCatalog(t *testing.T) { if !ok { t.Setenv("MAVEN_CMD", "mvn") } - if strings.Contains(defaults.DefaultRuntimeVersion, "SNAPSHOT") { + if strings.Contains(defaults.CamelKRuntimeCatalogVersion, "SNAPSHOT") { maven.DefaultMavenRepositories += ",https://repository.apache.org/content/repositories/snapshots-group@snapshots@id=apache-snapshots" } catalog, err := CreateCatalog( @@ -51,13 +51,13 @@ func TestCreateCatalog(t *testing.T) { "", platform.SingletonPlatform.Maven.MavenSpec, platform.SingletonPlatform.BuildTimeout, - v1.RuntimeSpec{Provider: v1.RuntimeProviderQuarkus, Version: defaults.DefaultRuntimeVersion}, + v1.RuntimeSpec{Provider: v1.RuntimeProviderQuarkus, Version: defaults.CamelKRuntimeCatalogVersion}, nil, "", ) require.NoError(t, err) assert.NotNil(t, catalog) - assert.Equal(t, defaults.DefaultRuntimeVersion, catalog.Runtime.Version) + assert.Equal(t, defaults.CamelKRuntimeCatalogVersion, catalog.Runtime.Version) assert.Equal(t, v1.RuntimeProviderQuarkus, catalog.Runtime.Provider) assert.NotEmpty(t, catalog.Runtime.Capabilities) diff --git a/pkg/util/camel/catalog.go b/pkg/util/camel/catalog.go index 048dd7b0b..bc17f2e70 100644 --- a/pkg/util/camel/catalog.go +++ b/pkg/util/camel/catalog.go @@ -65,7 +65,7 @@ func catalogForRuntimeProvider(provider v1.RuntimeProvider) (*RuntimeCatalog, er } return findBestMatch(catalogs, v1.RuntimeSpec{ - Version: defaults.DefaultRuntimeVersion, + Version: defaults.CamelKRuntimeCatalogVersion, Provider: provider, Metadata: make(map[string]string), }) diff --git a/pkg/util/camel/catalog_test.go b/pkg/util/camel/catalog_test.go index 9ef830b80..bd7728a09 100644 --- a/pkg/util/camel/catalog_test.go +++ b/pkg/util/camel/catalog_test.go @@ -50,7 +50,7 @@ func TestRuntimeContainsEmbeddedArtifacts(t *testing.T) { catalog, err := DefaultCatalog() require.NoError(t, err) - assert.Equal(t, defaults.DefaultRuntimeVersion, catalog.Runtime.Version) + assert.Equal(t, defaults.CamelKRuntimeCatalogVersion, catalog.Runtime.Version) artifact := catalog.GetArtifactByScheme("knative") assert.Equal(t, 1, len(artifact.Schemes)) @@ -61,3 +61,9 @@ func TestRuntimeContainsEmbeddedArtifacts(t *testing.T) { assert.True(t, found) assert.True(t, scheme.HTTP) } + +func TestDefaultCatalog(t *testing.T) { + catalog, err := DefaultCatalog() + require.Nil(t, err) + assert.NotNil(t, catalog) +} diff --git a/pkg/util/defaults/defaults.go b/pkg/util/defaults/defaults.go index 25affd91a..fd7faa3f9 100644 --- a/pkg/util/defaults/defaults.go +++ b/pkg/util/defaults/defaults.go @@ -25,8 +25,14 @@ const ( // Version -- Version = "2.11.0-SNAPSHOT" + // DefaultRuntimeProvider -- + DefaultRuntimeProvider = "plain-quarkus" + // DefaultRuntimeVersion -- - DefaultRuntimeVersion = "3.15.3" + DefaultRuntimeVersion = "3.35.1" + + // CamelKRuntimeCatalogVersion -- + CamelKRuntimeCatalogVersion = "3.15.3" // baseImage -- baseImage = "eclipse-temurin:17-jdk@sha256:b04a8c5d46e210873ffd1af6ad5f4d62c69ed3a6736993556eae60bba1373a23" diff --git a/script/Makefile b/script/Makefile index f997086da..3059fda90 100644 --- a/script/Makefile +++ b/script/Makefile @@ -27,7 +27,11 @@ VERSIONFILE := pkg/util/defaults/defaults.go VERSION ?= 2.11.0-SNAPSHOT LAST_RELEASED_IMAGE_NAME := camel-k-operator LAST_RELEASED_VERSION ?= 2.10.0 -DEFAULT_RUNTIME_VERSION := 3.15.3 +DEFAULT_RUNTIME_PROVIDER := plain-quarkus +DEFAULT_RUNTIME_VERSION := 3.35.1 +# The last camel-k-runtime catalog +# we keep using it until we support the CamelCatalog CR +CK_RUNTIME_CATALOG_VERSION := 3.15.3 # Kubernetes tooling CONTROLLER_GEN_VERSION := v0.20.0 CONTROLLER_GEN=$(GOBIN)/controller-gen @@ -113,15 +117,6 @@ TEST_PREBUILD = build TEST_COMMON_PARALLEL_COUNT ?= 2 TEST_ADVANCED_PARALLEL_COUNT ?= 2 -# OLM (Operator Lifecycle Manager and Operator Hub): uncomment to override operator settings at build time -#GOLDFLAGS += -X github.com/apache/camel-k/v2/pkg/util/olm.DefaultOperatorName=camel-k-operator -#GOLDFLAGS += -X github.com/apache/camel-k/v2/pkg/util/olm.DefaultPackage=camel-k -#GOLDFLAGS += -X github.com/apache/camel-k/v2/pkg/util/olm.DefaultChannel=alpha -#GOLDFLAGS += -X github.com/apache/camel-k/v2/pkg/util/olm.DefaultSource=community-operators -#GOLDFLAGS += -X github.com/apache/camel-k/v2/pkg/util/olm.DefaultSourceNamespace=openshift-marketplace -#GOLDFLAGS += -X github.com/apache/camel-k/v2/pkg/util/olm.DefaultStartingCSV= -#GOLDFLAGS += -X github.com/apache/camel-k/v2/pkg/util/olm.DefaultGlobalNamespace=openshift-operators - # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) GOBIN=$(shell go env GOPATH)/bin @@ -192,9 +187,15 @@ codegen: @echo " // Version -- " >> $(VERSIONFILE) @echo " Version = \"$(CUSTOM_VERSION)\"" >> $(VERSIONFILE) @echo "" >> $(VERSIONFILE) + @echo " // DefaultRuntimeProvider -- " >> $(VERSIONFILE) + @echo " DefaultRuntimeProvider = \"$(DEFAULT_RUNTIME_PROVIDER)\"" >> $(VERSIONFILE) + @echo "" >> $(VERSIONFILE) @echo " // DefaultRuntimeVersion -- " >> $(VERSIONFILE) @echo " DefaultRuntimeVersion = \"$(DEFAULT_RUNTIME_VERSION)\"" >> $(VERSIONFILE) @echo "" >> $(VERSIONFILE) + @echo " // CamelKRuntimeCatalogVersion -- " >> $(VERSIONFILE) + @echo " CamelKRuntimeCatalogVersion = \"$(CK_RUNTIME_CATALOG_VERSION)\"" >> $(VERSIONFILE) + @echo "" >> $(VERSIONFILE) @echo " // baseImage -- " >> $(VERSIONFILE) @echo " baseImage = \"$(BASE_IMAGE)\"" >> $(VERSIONFILE) @echo "" >> $(VERSIONFILE) @@ -363,7 +364,7 @@ ifneq ($(shell uname -s 2>/dev/null || echo Unknown),Linux) endif build-resources: - ./script/get_catalog.sh $(DEFAULT_RUNTIME_VERSION) + ./script/get_catalog.sh $(CK_RUNTIME_CATALOG_VERSION) build-compile-integration-tests: ifndef NOTEST @@ -448,9 +449,6 @@ DOCKER_TAG := $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-$(BASE_IMAGE_VERSION)-$(IMAGE_AR images: build image-build build-kamel-platform image-build: -ifneq (,$(findstring SNAPSHOT,$(DEFAULT_RUNTIME_VERSION))) - ./script/package_maven_artifacts.sh -d "$(CAMEL_K_RUNTIME_DIR)" $(DEFAULT_RUNTIME_VERSION) -endif @echo "####### Building Camel K operator jdk $(BASE_IMAGE_VERSION) arch $(IMAGE_ARCH) container image..." mkdir -p build/_maven_output docker buildx build --target $(TARGET_STAGE) \ diff --git a/script/package_maven_artifacts.sh b/script/package_maven_artifacts.sh deleted file mode 100755 index 26be424bb..000000000 --- a/script/package_maven_artifacts.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash - -# 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. - -location=$(dirname $0) -rootdir=$(realpath ${location}/../) - -while getopts "d:s:" opt; do - case "${opt}" in - d) - local_runtime_dir="${OPTARG}" - ;; - s) - staging_repo="${OPTARG}" - ;; - *) - ;; - esac -done -shift $((OPTIND-1)) - -if [ "$#" -lt 1 ]; then - echo "usage: $0 [-s <staging repository>] [-d <local Camel K runtime project directory>] <Camel K runtime version>" - exit 1 -fi - -camel_k_destination="$PWD/build/_maven_output" -camel_k_runtime_version=$1 -maven_repo=${staging_repo:-https://repo1.maven.org/maven2} - -# Refresh m2 distro project -rm -rf ${rootdir}/build/m2 -mkdir -p ${rootdir}/build/m2 - -# Refresh maven output dir -rm -rf ${camel_k_destination} -mkdir -p ${camel_k_destination} - -if [ -z "${local_runtime_dir}" ]; then - # Remote M2 distro - if [ ! -z $staging_repo ]; then - # Change the settings to include the staging repo if it's not already there - echo "INFO: updating the settings staging repository" - sed -i "s;<url>https://repository\.apache\.org/content/repositories/orgapachecamel-.*</url>;<url>$staging_repo</url>;" $location/maven-settings.xml - fi - - #TODO: remove this check once Camel K 1.16.0 is released - if [[ $camel_k_runtime_version != *"SNAPSHOT"* ]]; then - echo "WARN: Package Camel K runtime artifacts temporary removed because of https://github.com/apache/camel-k-runtime/pull/928 issue" - echo "Please, remove this check when Camel K Runtime 1.16.0 is officially released" - exit 0 - fi - echo "Downloading Camel K runtime $camel_k_runtime_version M2 (may take some minute ...)" - mvn -q dependency:copy -Dartifact="org.apache.camel.k:apache-camel-k-runtime:$camel_k_runtime_version:zip:m2" \ - -Dmdep.useBaseVersion=true \ - -DoutputDirectory=${rootdir}/build/m2 \ - -s $location/maven-settings.xml \ - -Papache - unzip -q -o $PWD/build/m2/apache-camel-k-runtime-${camel_k_runtime_version}-m2.zip -d $camel_k_destination -else - # Local M2 distro - echo "Installing local Camel K runtime $camel_k_runtime_version M2 from $local_runtime_dir (may take some minute ...)" - mvn -q -f $local_runtime_dir/distribution clean install - unzip -q -o $local_runtime_dir/distribution/target/apache-camel-k-runtime-${camel_k_runtime_version}-m2.zip -d $camel_k_destination -fi - -
