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 a78316d86fab234c69eafbae088f8742c2d6a78a Author: Pasquale Congiusti <[email protected]> AuthorDate: Thu May 28 08:41:31 2026 +0200 chore(ctrl): catalog clone on catalog ctrl --- docs/antora.yml | 14 +-- docs/modules/ROOT/pages/concepts/dependencies.adoc | 13 +-- .../ROOT/pages/configuration/runtime-version.adoc | 4 +- docs/modules/ROOT/pages/installation/builds.adoc | 8 +- docs/modules/ROOT/pages/running/running.adoc | 26 ----- docs/modules/ROOT/partials/apis/camel-k-crds.adoc | 4 +- docs/modules/traits/pages/camel.adoc | 4 +- e2e/advanced/catalog_builder_test.go | 114 --------------------- e2e/advanced/files/timer-kamelet-usage.yaml | 2 +- e2e/install/upgrade/upgrade_test.go | 22 +++- helm/camel-k/crds/camel-k-crds.yaml | 18 ++-- pkg/apis/camel/v1/trait/camel.go | 4 +- pkg/builder/quarkus.go | 2 +- pkg/controller/integrationkit/initialize.go | 2 +- pkg/controller/integrationplatform/create.go | 13 +-- pkg/controller/integrationplatform/create_test.go | 1 + pkg/controller/integrationplatform/monitor.go | 3 + pkg/controller/integrationplatform/monitor_test.go | 8 +- pkg/platform/env_platform.go | 26 ++--- .../bases/camel.apache.org_integrationkits.yaml | 2 +- .../camel.apache.org_integrationplatforms.yaml | 4 +- .../camel.apache.org_integrationprofiles.yaml | 4 +- .../crd/bases/camel.apache.org_integrations.yaml | 4 +- .../config/crd/bases/camel.apache.org_pipes.yaml | 4 +- pkg/trait/camel.go | 95 ++++++++++++----- pkg/util/camel/camel_runtime.go | 21 ++++ pkg/util/defaults/defaults.go | 2 +- script/Makefile | 2 +- script/update_docs.sh | 50 --------- 29 files changed, 190 insertions(+), 286 deletions(-) diff --git a/docs/antora.yml b/docs/antora.yml index ac0331860..b6d979d23 100644 --- a/docs/antora.yml +++ b/docs/antora.yml @@ -22,19 +22,19 @@ prerelease: true display-version: Next (Pre-release) nav: - modules/ROOT/nav.adoc -# It should be automatically generated by an action running nightly asciidoc: attributes: requires: "'util=camel-website-util,ck=xref:js/ck.js'" prerelease: true last-released-version: 2.10.0 camel-k-runtime-version: 3.15.3 - camel-api-versions: camel.apache.org/v1 camel.apache.org/v1alpha1 # from Makefile BUNDLE_CAMEL_APIS - camel-version: 4.8.5 - camel-docs-version: 4.8.x - camel-quarkus-version: 3.15.3 - camel-quarkus-docs-version: 3.15.x - quarkus-version: 3.15.4 + camel-api-versions: camel.apache.org/v1 # from Makefile BUNDLE_CAMEL_APIS + camel-version: 4.18.0 + camel-docs-version: 4.18.x + camel-quarkus-version: 3.33.1 + camel-quarkus-docs-version: 3.33.x + quarkus-version: 3.33.2 + # The params below should be automatically generated by an action running nightly kustomize-version: 5.7.1 kubernetes-api-version: 0.36.0 operator-fwk-api-version: 0.42.0 diff --git a/docs/modules/ROOT/pages/concepts/dependencies.adoc b/docs/modules/ROOT/pages/concepts/dependencies.adoc index 61ad44ede..e263b8620 100644 --- a/docs/modules/ROOT/pages/concepts/dependencies.adoc +++ b/docs/modules/ROOT/pages/concepts/dependencies.adoc @@ -1,24 +1,21 @@ = Camel dependencies matrix -Camel K was originally equipped with a dedicated runtime known as Camel K Runtime. This is a lightweight layer on top of Camel Quarkus. However, you can directly run plain regular Camel Quarkus runtime applications as well. This will become the standard only from version 3.x onward in order to avoid breaking backward compatibility. In the while you're strongly encouraged to use `plain-quarkus` Camel runtime configuration to ease any future 3.x migration. - -NOTE: you can use any available Camel Quarkus runtime version. Alternatively you can also build any other Camel runtimes building from a Git hosted repository. - [caption=] .Camel dependencies matrix -[width="100%",cols="4,2,2,2,2,2,3",options="header"] +[width="100%",cols="4,2,2,2,2,3",options="header"] |=== |Camel K Version |Last release -|(Default) Camel K Runtime +|Default Quarkus Platform |Camel Quarkus |Camel -|Quarkus |Branch |=== //cannot use top level index.adoc as the page with the query is always omitted. -indexTable::[version="*",relative="running/running.adoc",cellformats="util.ckRef(pageComponentDisplayVersion, pageComponentVersion)|lastReleasedVersion|camelKRuntimeVersion|camelQuarkusVersion|camelVersion|quarkusVersion|ck.branch(pageComponentVersion)", requires={requires},transform=util.sortCompatibilityItems] +indexTable::[version="*",relative="running/running.adoc",cellformats="util.ckRef(pageComponentDisplayVersion, pageComponentVersion)|lastReleasedVersion|quarkusVersion|camelQuarkusVersion|camelVersion|ck.branch(pageComponentVersion)", requires={requires},transform=util.sortCompatibilityItems] + +NOTE: you can use any available Camel Quarkus runtime version. Alternatively you can also build any other Camel runtimes building from a Git hosted repository. == Other APIs version matrix diff --git a/docs/modules/ROOT/pages/configuration/runtime-version.adoc b/docs/modules/ROOT/pages/configuration/runtime-version.adoc index 74fd2ef6b..1d1e87095 100644 --- a/docs/modules/ROOT/pages/configuration/runtime-version.adoc +++ b/docs/modules/ROOT/pages/configuration/runtime-version.adoc @@ -16,6 +16,6 @@ This feature requires the dynamic generation of a builder that contains all the When you are creating a new runtime for which a xref:architecture/cr/camel-catalog.adoc[CamelCatalog] does not yest exist, Camel K Operator is in charge to create such a catalog. Every CamelCatalog may carry the definition of a container image builder which may later be used by the builder `Pod` to build a Camel application which is specific to such a runtime (for instance, when running a Quarkus Native build). -== Pin a runtime version +== Pin a runtime version and provider -By default each Camel K version uses the runtime version provided in the `BUILD_RUNTIME_VERSION` environment variable configuration. Using the trait will let you pin to a well defined version, avoiding to unintentionally upgrade the runtime of the integrations running when you perform an operator upgrade. See more info in the xref:installation/upgrade.adoc#maintain-runtime-integrations[Camel K upgrade documentation]. +By default each Camel K version uses the runtime version provided in the `BUILD_RUNTIME_PROVIDER` and `BUILD_RUNTIME_VERSION` environment variable configuration. Using the `camel` trait will let you pin to a well defined version, avoiding to unintentionally upgrade the runtime of the integrations running when you perform an operator upgrade. See more info in the xref:installation/upgrade.adoc#maintain-runtime-integrations[Camel K upgrade documentation]. diff --git a/docs/modules/ROOT/pages/installation/builds.adoc b/docs/modules/ROOT/pages/installation/builds.adoc index 296f465f9..57963f9bd 100644 --- a/docs/modules/ROOT/pages/installation/builds.adoc +++ b/docs/modules/ROOT/pages/installation/builds.adoc @@ -11,9 +11,13 @@ Here a quick resume of the parameters you can configure as environment variables |=== | Name | Description | Default +| BUILD_RUNTIME_PROVIDER +| Provider of the Apache Camel runtime used for builds. +| `plain-quarkus` + | BUILD_RUNTIME_VERSION -| Version of the runtime used for builds. -| The Camel K runtime specified by the Camel K operator version released +| Version of the Apache Camel runtime used for builds. +| The default version specified by the Camel K operator version released | BUILD_TIMEOUT_SECONDS | Timeout (in seconds) for a build before it is terminated. diff --git a/docs/modules/ROOT/pages/running/running.adoc b/docs/modules/ROOT/pages/running/running.adoc index bf6462856..fea5e083b 100644 --- a/docs/modules/ROOT/pages/running/running.adoc +++ b/docs/modules/ROOT/pages/running/running.adoc @@ -92,32 +92,6 @@ spec: You can see the specification is a lot neater, so, try choosing Yaml DSL whenever it's possible. -== Runtime provider - -Camel K was originally equipped with a dedicated runtime known as Camel K Runtime. This is a lightweight layer on top of Camel Quarkus. However, you can directly run plain regular Camel Quarkus runtime applications as well. You will learn the concept of traits later on. For now, just be aware that you can run any Integration setting the plain Quarkus runtime using `camel` trait configuration. Here an example of how that would be: - -```yaml -apiVersion: camel.apache.org/v1 -kind: Integration -metadata: - name: my-plain-quarkus-it -spec: - flows: - - from: - parameters: - period: "1000" - steps: - - setBody: - simple: Hello Camel from ${routeId} - - log: ${body} - uri: timer:yaml - traits: - camel: - runtimeProvider: plain-quarkus -``` - -NOTE: we plan to graduate plain Camel Quarkus runtime as default runtime in the future (likely in the next major release). We therefore recommend to use the plain Camel Quarkus runtime in any of your Integrations already. - == Using Kamel CLI Camel K works very well with any Kubernetes compatible user interface (such as CLI as `kubectl`, `oc` or any other visual tooling). However we do provide a simple CLI that helps you performing most of the Integration works in an easier fashion: it's xref:running/running-cli.adoc[`kamel` CLI]. diff --git a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc index 18646c705..b6d710201 100644 --- a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc +++ b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc @@ -6748,7 +6748,7 @@ Path to the PEM-encoded CA certificate file to import. * <<#_camel_apache_org_v1_IntegrationKitTraits, IntegrationKitTraits>> * <<#_camel_apache_org_v1_Traits, Traits>> -The Camel trait can be used to configure versions of Apache Camel K runtime and related libraries, it cannot be disabled. +The Camel trait can be used to configure versions of Camel runtime and related libraries, it cannot be disabled. [cols="2,2a",options="header"] @@ -6768,7 +6768,7 @@ string | -The runtime provider to use for the integration. (Default, Camel K Runtime). +The runtime provider to use for the integration. (Default, plain Quarkus). |`runtimeVersion` + string diff --git a/docs/modules/traits/pages/camel.adoc b/docs/modules/traits/pages/camel.adoc index 1f82067aa..ed6e8a7d8 100755 --- a/docs/modules/traits/pages/camel.adoc +++ b/docs/modules/traits/pages/camel.adoc @@ -3,7 +3,7 @@ // Start of autogenerated code - DO NOT EDIT! (badges) // End of autogenerated code - DO NOT EDIT! (badges) // Start of autogenerated code - DO NOT EDIT! (description) -The Camel trait can be used to configure versions of Apache Camel K runtime and related libraries, it cannot be disabled. +The Camel trait can be used to configure versions of Camel runtime and related libraries, it cannot be disabled. This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**. @@ -31,7 +31,7 @@ The following configuration options are available: | camel.runtimeProvider | string -| The runtime provider to use for the integration. (Default, Camel K Runtime). +| The runtime provider to use for the integration. (Default, plain Quarkus). | camel.runtimeVersion | string diff --git a/e2e/advanced/catalog_builder_test.go b/e2e/advanced/catalog_builder_test.go deleted file mode 100644 index 2f9329a05..000000000 --- a/e2e/advanced/catalog_builder_test.go +++ /dev/null @@ -1,114 +0,0 @@ -//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 advanced - -import ( - "context" - "strings" - "testing" - - . "github.com/onsi/gomega" - corev1 "k8s.io/api/core/v1" - - . "github.com/apache/camel-k/v2/e2e/support" - v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1" -) - -func TestCamelCatalogBuilder(t *testing.T) { - t.Parallel() - - WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) { - InstallOperator(t, ctx, g, ns) - - // Run an integration with a catalog not compatible - // The operator should create the catalog, but fail on reconciliation as it is not compatible - // and the integration should fail as well - t.Run("Run catalog not compatible", func(t *testing.T) { - name := RandomizedSuffixName("java-1-15") - nonCompatibleCatalogName := "camel-catalog-1.15.0" - g.Expect( - KamelRun(t, ctx, ns, "files/Java.java", "--name", name, "-t", "camel.runtime-version=1.15.0").Execute()).To(Succeed()) - - g.Eventually(CamelCatalog(t, ctx, ns, nonCompatibleCatalogName), TestTimeoutMedium).ShouldNot(BeNil()) - g.Eventually(CamelCatalogPhase(t, ctx, ns, nonCompatibleCatalogName)).Should(Equal(v1.CamelCatalogPhaseError)) - g.Eventually(CamelCatalogCondition(t, ctx, ns, nonCompatibleCatalogName, v1.CamelCatalogConditionReady)().Message).Should(ContainSubstring("Container image tool missing in catalog")) - - g.Eventually(IntegrationKitName(t, ctx, ns, name)).ShouldNot(Equal("")) - kitName := IntegrationKitName(t, ctx, ns, name)() - g.Eventually(KitPhase(t, ctx, ns, kitName)).Should(Equal(v1.IntegrationKitPhaseError)) - g.Eventually(KitCondition(t, ctx, ns, kitName, v1.IntegrationKitConditionCatalogAvailable)().Reason).Should(Equal("Camel Catalog 1.15.0 error")) - g.Eventually(IntegrationPhase(t, ctx, ns, name)).Should(Equal(v1.IntegrationPhaseError)) - g.Eventually(IntegrationCondition(t, ctx, ns, name, v1.IntegrationConditionKitAvailable)().Status).Should(Equal(corev1.ConditionFalse)) - }) - - // Run an integration with a compatible catalog - // The operator should create the catalog, reconcile it properly and run the Integration accordingly - t.Run("Run catalog compatible", func(t *testing.T) { - name := RandomizedSuffixName("java-1-17") - compatibleVersion := "1.17.0" - compatibleCatalogName := "camel-catalog-" + strings.ToLower(compatibleVersion) - - // First of all we delete the catalog, if by any chance it was created previously - g.Expect(DeleteCamelCatalog(t, ctx, ns, compatibleCatalogName)()).Should(BeTrue()) - g.Eventually(CamelCatalog(t, ctx, ns, compatibleCatalogName)).Should(BeNil()) - - g.Expect( - KamelRun(t, ctx, ns, "files/Java.java", "--name", name, "-t", "camel.runtime-version="+compatibleVersion).Execute()).To(Succeed()) - - g.Eventually(CamelCatalog(t, ctx, ns, compatibleCatalogName)).ShouldNot(BeNil()) - g.Eventually(CamelCatalogPhase(t, ctx, ns, compatibleCatalogName)).Should(Equal(v1.CamelCatalogPhaseReady)) - g.Eventually(CamelCatalogCondition(t, ctx, ns, compatibleCatalogName, v1.CamelCatalogConditionReady)().Message).Should(Equal("Container image tool found in catalog")) - g.Eventually(IntegrationPodPhase(t, ctx, ns, name), TestTimeoutMedium).Should(Equal(corev1.PodRunning)) - g.Eventually(IntegrationConditionStatus(t, ctx, ns, name, v1.IntegrationConditionReady), TestTimeoutMedium). - Should(Equal(corev1.ConditionTrue)) - g.Eventually(IntegrationLogs(t, ctx, ns, name), TestTimeoutMedium).Should(ContainSubstring("Magicstring!")) - }) - - t.Run("Run catalog container exists", func(t *testing.T) { - name := RandomizedSuffixName("java") - compatibleVersion := "1.17.0" - compatibleCatalogName := "camel-catalog-" + strings.ToLower(compatibleVersion) - - // First of all we delete the catalog, if by any chance it was created previously - g.Expect(DeleteCamelCatalog(t, ctx, ns, compatibleCatalogName)()).Should(BeTrue()) - g.Eventually(CamelCatalog(t, ctx, ns, compatibleCatalogName)).Should(BeNil()) - - g.Expect( - KamelRun(t, ctx, ns, "files/Java.java", "--name", name, "-t", "camel.runtime-version="+compatibleVersion).Execute()).To(Succeed()) - - g.Eventually(CamelCatalog(t, ctx, ns, compatibleCatalogName)).ShouldNot(BeNil()) - g.Eventually(CamelCatalogPhase(t, ctx, ns, compatibleCatalogName)).Should(Equal(v1.CamelCatalogPhaseReady)) - g.Eventually(CamelCatalogCondition(t, ctx, ns, compatibleCatalogName, v1.CamelCatalogConditionReady)().Message).Should( - Equal("Container image tool found in catalog"), - ) - - g.Eventually(IntegrationKitName(t, ctx, ns, name)).ShouldNot(Equal("")) - kitName := IntegrationKitName(t, ctx, ns, name)() - g.Eventually(KitPhase(t, ctx, ns, kitName)).Should(Equal(v1.IntegrationKitPhaseReady)) - g.Eventually(IntegrationPodPhase(t, ctx, ns, name)).Should(Equal(corev1.PodRunning)) - g.Eventually(IntegrationConditionStatus(t, ctx, ns, name, v1.IntegrationConditionReady), TestTimeoutShort). - Should(Equal(corev1.ConditionTrue)) - g.Eventually(IntegrationLogs(t, ctx, ns, name), TestTimeoutShort).Should(ContainSubstring("Magicstring!")) - }) - }) -} diff --git a/e2e/advanced/files/timer-kamelet-usage.yaml b/e2e/advanced/files/timer-kamelet-usage.yaml index 206ba027b..c5de4322c 100644 --- a/e2e/advanced/files/timer-kamelet-usage.yaml +++ b/e2e/advanced/files/timer-kamelet-usage.yaml @@ -16,6 +16,6 @@ # --------------------------------------------------------------------------- - from: - uri: "kamelet:my-own-timer-source?message=Hello+world" + uri: "kamelet:my-own-timer-source?message=Hello world" steps: - to: "log:info?showAll=false" diff --git a/e2e/install/upgrade/upgrade_test.go b/e2e/install/upgrade/upgrade_test.go index e924f77e2..24c2b1b80 100644 --- a/e2e/install/upgrade/upgrade_test.go +++ b/e2e/install/upgrade/upgrade_test.go @@ -37,6 +37,7 @@ 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) { @@ -81,7 +82,7 @@ func TestUpgrade(t *testing.T) { installPrevCmd.Dir = lastVersionDir ExpectExecSucceed(t, g, installPrevCmd) - // TODO: In 2.11 we should move to this one instead + // TODO: In 2.12 we should move to this one instead // // kustomizeCmd := exec.Command( // "kubectl", @@ -142,6 +143,11 @@ func TestUpgrade(t *testing.T) { // Check the operator pod is running g.Eventually(OperatorPodPhase(t, ctx, ns), 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, ns, "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)) @@ -182,3 +188,17 @@ func TestUpgrade(t *testing.T) { // 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) +} diff --git a/helm/camel-k/crds/camel-k-crds.yaml b/helm/camel-k/crds/camel-k-crds.yaml index 91aa72c72..ad761c78d 100644 --- a/helm/camel-k/crds/camel-k-crds.yaml +++ b/helm/camel-k/crds/camel-k-crds.yaml @@ -3084,7 +3084,7 @@ spec: type: array runtimeProvider: description: The runtime provider to use for the integration. - (Default, Camel K Runtime). + (Default, plain Quarkus). enum: - quarkus - plain-quarkus @@ -4040,7 +4040,7 @@ spec: type: array runtimeProvider: description: The runtime provider to use for the integration. - (Default, Camel K Runtime). + (Default, plain Quarkus). enum: - quarkus - plain-quarkus @@ -6570,7 +6570,7 @@ spec: type: array runtimeProvider: description: The runtime provider to use for the integration. - (Default, Camel K Runtime). + (Default, plain Quarkus). enum: - quarkus - plain-quarkus @@ -8994,7 +8994,7 @@ spec: type: array runtimeProvider: description: The runtime provider to use for the integration. - (Default, Camel K Runtime). + (Default, plain Quarkus). enum: - quarkus - plain-quarkus @@ -11404,7 +11404,7 @@ spec: type: array runtimeProvider: description: The runtime provider to use for the integration. - (Default, Camel K Runtime). + (Default, plain Quarkus). enum: - quarkus - plain-quarkus @@ -20670,7 +20670,7 @@ spec: type: array runtimeProvider: description: The runtime provider to use for the integration. - (Default, Camel K Runtime). + (Default, plain Quarkus). enum: - quarkus - plain-quarkus @@ -23041,7 +23041,7 @@ spec: type: array runtimeProvider: description: The runtime provider to use for the integration. - (Default, Camel K Runtime). + (Default, plain Quarkus). enum: - quarkus - plain-quarkus @@ -33668,7 +33668,7 @@ spec: type: array runtimeProvider: description: The runtime provider to use for the integration. - (Default, Camel K Runtime). + (Default, plain Quarkus). enum: - quarkus - plain-quarkus @@ -35963,7 +35963,7 @@ spec: type: array runtimeProvider: description: The runtime provider to use for the integration. - (Default, Camel K Runtime). + (Default, plain Quarkus). enum: - quarkus - plain-quarkus diff --git a/pkg/apis/camel/v1/trait/camel.go b/pkg/apis/camel/v1/trait/camel.go index 08d63d27d..502bef4aa 100644 --- a/pkg/apis/camel/v1/trait/camel.go +++ b/pkg/apis/camel/v1/trait/camel.go @@ -17,7 +17,7 @@ limitations under the License. package trait -// The Camel trait can be used to configure versions of Apache Camel K runtime and related libraries, it cannot be disabled. +// The Camel trait can be used to configure versions of Camel runtime and related libraries, it cannot be disabled. // // +camel-k:trait=camel. // @@ -25,7 +25,7 @@ package trait type CamelTrait struct { PlatformBaseTrait `json:",inline" property:",squash"` - // The runtime provider to use for the integration. (Default, Camel K Runtime). + // The runtime provider to use for the integration. (Default, plain Quarkus). // +kubebuilder:validation:Enum=quarkus;plain-quarkus RuntimeProvider string `json:"runtimeProvider,omitempty" property:"runtime-provider"` // The runtime version to use for the integration. It overrides the default version set in the Integration Platform. diff --git a/pkg/builder/quarkus.go b/pkg/builder/quarkus.go index 9aafa5e63..707319c5d 100644 --- a/pkg/builder/quarkus.go +++ b/pkg/builder/quarkus.go @@ -111,7 +111,7 @@ func loadCamelQuarkusCatalog(ctx *builderContext) 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(ctx.C, ctx.Client, ctx.Namespace, *runtime) diff --git a/pkg/controller/integrationkit/initialize.go b/pkg/controller/integrationkit/initialize.go index bcdbe8970..9d5d1db7b 100644 --- a/pkg/controller/integrationkit/initialize.go +++ b/pkg/controller/integrationkit/initialize.go @@ -83,7 +83,7 @@ func (action *initializeAction) image(ctx context.Context, env *trait.Environmen if env.CamelCatalog.GetRuntimeProvider() == v1.RuntimeProviderPlainQuarkus { // We need this workaround to load the last existing catalog // TODO: this part will be subject to future refactoring - catalogName = "camel-catalog-quarkus-" + strings.ToLower(defaults.DefaultRuntimeVersion) + catalogName = "camel-catalog-quarkus-" + strings.ToLower(defaults.CamelKRuntimeCatalogVersion) } // Wait for CamelCatalog to be ready catalog, err := kubernetes.GetCamelCatalog( diff --git a/pkg/controller/integrationplatform/create.go b/pkg/controller/integrationplatform/create.go index f7e54ac46..9e431f039 100644 --- a/pkg/controller/integrationplatform/create.go +++ b/pkg/controller/integrationplatform/create.go @@ -62,9 +62,10 @@ func (action *createAction) Handle(ctx context.Context, platform *v1.Integration return nil, err } - // if bundled version, load catalog spec from resources - if platform.Status.Build.RuntimeVersion == defaults.CamelKRuntimeCatalogVersion { - if platform, err = action.handleBundledCatalog(ctx, platform, catalog); err != nil { + // if Plain Quarkus or last bundled version, load catalog spec from resources + if platform.Status.Build.RuntimeProvider == v1.RuntimeProviderPlainQuarkus || + platform.Status.Build.RuntimeVersion == defaults.CamelKRuntimeCatalogVersion { + if platform, err = action.handleBundledCatalog(ctx, platform, catalog, defaults.CamelKRuntimeCatalogVersion); err != nil { return platform, err } } else { @@ -111,11 +112,11 @@ func loadCatalog(ctx context.Context, c client.Client, namespace string, runtime } //nolint:staticcheck -func (action *createAction) handleBundledCatalog(ctx context.Context, platform *v1.IntegrationPlatform, catalog *v1.CamelCatalog) (*v1.IntegrationPlatform, error) { +func (action *createAction) handleBundledCatalog(ctx context.Context, platform *v1.IntegrationPlatform, catalog *v1.CamelCatalog, version string) (*v1.IntegrationPlatform, error) { var camelVersion string // Create the catalog only if it was not yet created if catalog == nil { - camelCatalogData, err := resources.Resource(fmt.Sprintf("/resources/camel-catalog-%s.yaml", platform.Status.Build.RuntimeVersion)) + camelCatalogData, err := resources.Resource(fmt.Sprintf("/resources/camel-catalog-%s.yaml", version)) if err != nil { return nil, err } @@ -126,7 +127,7 @@ func (action *createAction) handleBundledCatalog(ctx context.Context, platform * // Copy platform annotations to the catalog cat.SetAnnotations(platform.Annotations) cat.SetNamespace(platform.Namespace) - action.L.Infof("Installing bundled camel catalog: %s", platform.Status.Build.RuntimeVersion) + action.L.Infof("Installing bundled camel catalog: %s", version) if err = action.client.Create(ctx, &cat); err != nil { return nil, err } diff --git a/pkg/controller/integrationplatform/create_test.go b/pkg/controller/integrationplatform/create_test.go index d7c9077fe..c697412c5 100644 --- a/pkg/controller/integrationplatform/create_test.go +++ b/pkg/controller/integrationplatform/create_test.go @@ -228,6 +228,7 @@ func TestCreateCatalogError(t *testing.T) { ip := v1.IntegrationPlatform{} ip.Namespace = "ns" ip.Name = "ck" + ip.Spec.Build.RuntimeProvider = v1.RuntimeProviderQuarkus ip.Spec.Build.RuntimeVersion = "0.0.0" c, err := internal.NewFakeClient(&ip) require.NoError(t, err) diff --git a/pkg/controller/integrationplatform/monitor.go b/pkg/controller/integrationplatform/monitor.go index aa0f0ac24..951656fbe 100644 --- a/pkg/controller/integrationplatform/monitor.go +++ b/pkg/controller/integrationplatform/monitor.go @@ -66,6 +66,9 @@ func (action *monitorAction) Handle(ctx context.Context, platform *v1.Integratio Version: platform.Status.Build.RuntimeVersion, Provider: platform.Status.Build.RuntimeProvider, } + if runtimeSpec.Provider == v1.RuntimeProviderPlainQuarkus { + runtimeSpec.Version = defaults.CamelKRuntimeCatalogVersion + } catalog, err := loadCatalog(ctx, action.client, platform.Namespace, runtimeSpec) if catalog == nil || err != nil { // error, a catalog must be available diff --git a/pkg/controller/integrationplatform/monitor_test.go b/pkg/controller/integrationplatform/monitor_test.go index 7c8cad6c6..c71e89487 100644 --- a/pkg/controller/integrationplatform/monitor_test.go +++ b/pkg/controller/integrationplatform/monitor_test.go @@ -123,8 +123,8 @@ func TestMonitorDriftRuntime(t *testing.T) { } func TestMonitorDriftDefault(t *testing.T) { - catalog := v1.NewCamelCatalog("ns", fmt.Sprintf("camel-catalog-%s", defaults.CamelKRuntimeCatalogVersion)) - catalog.Spec.Runtime.Version = defaults.DefaultRuntimeVersion + catalog := v1.NewCamelCatalog("ns", fmt.Sprintf("camel-catalog-quarkus-%s", defaults.CamelKRuntimeCatalogVersion)) + catalog.Spec.Runtime.Version = defaults.CamelKRuntimeCatalogVersion catalog.Spec.Runtime.Provider = v1.RuntimeProviderPlainQuarkus catalog.Spec.Runtime.Metadata = map[string]string{ "camel.version": "3.2.1", @@ -156,7 +156,7 @@ func TestMonitorDriftDefault(t *testing.T) { func TestMonitorDriftConfiguration(t *testing.T) { catalog := v1.NewCamelCatalog("ns", fmt.Sprintf("camel-catalog-%s", defaults.CamelKRuntimeCatalogVersion)) - catalog.Spec.Runtime.Version = defaults.DefaultRuntimeVersion + catalog.Spec.Runtime.Version = defaults.CamelKRuntimeCatalogVersion catalog.Spec.Runtime.Provider = v1.RuntimeProviderPlainQuarkus catalog.Spec.Runtime.Metadata = map[string]string{ "camel.version": "3.2.1", @@ -281,7 +281,7 @@ func TestMonitorMissingCatalogError(t *testing.T) { assert.Equal(t, v1.IntegrationPlatformConditionCamelCatalogAvailableReason, answer.Status.GetCondition( v1.IntegrationPlatformConditionCamelCatalogAvailable).Reason) assert.Equal(t, fmt.Sprintf("camel catalog %s not available, please review given runtime version", - defaults.DefaultRuntimeVersion), answer.Status.GetCondition( + defaults.CamelKRuntimeCatalogVersion), answer.Status.GetCondition( v1.IntegrationPlatformConditionCamelCatalogAvailable).Message) } diff --git a/pkg/platform/env_platform.go b/pkg/platform/env_platform.go index 1de1f91db..644cc0ff0 100644 --- a/pkg/platform/env_platform.go +++ b/pkg/platform/env_platform.go @@ -40,15 +40,16 @@ var SingletonPlatform = getEnvPlatform() // Platform contains a series of configuration required during build and packaging. type Platform struct { - CatalogNamespace string - BuildRuntimeVersion string - BuildTimeout time.Duration - BuildConfiguration v1.BuildConfiguration - BuildBaseImage string - PublishStrategy v1.IntegrationPlatformBuildPublishStrategy - Registry v1.RegistrySpec - Maven v1.MavenBuildSpec - MaxRunningBuilds int32 + CatalogNamespace string + BuildRuntimeVersion string + BuildRuntimeProvider v1.RuntimeProvider + BuildTimeout time.Duration + BuildConfiguration v1.BuildConfiguration + BuildBaseImage string + PublishStrategy v1.IntegrationPlatformBuildPublishStrategy + Registry v1.RegistrySpec + Maven v1.MavenBuildSpec + MaxRunningBuilds int32 } // getEnvPlatform is in charge to parse the environment variables of the operator and return the Platform object. @@ -63,9 +64,10 @@ func getEnvPlatform() Platform { } return Platform{ - CatalogNamespace: GetOperatorNamespace(), - BuildRuntimeVersion: GetEnvOrDefault("BUILD_RUNTIME_VERSION", defaults.DefaultRuntimeVersion), - BuildTimeout: buildTimeout(), + CatalogNamespace: GetOperatorNamespace(), + BuildRuntimeVersion: GetEnvOrDefault("BUILD_RUNTIME_VERSION", defaults.DefaultRuntimeVersion), + BuildRuntimeProvider: v1.RuntimeProvider(GetEnvOrDefault("BUILD_RUNTIME_PROVIDER", defaults.DefaultRuntimeProvider)), + BuildTimeout: buildTimeout(), BuildConfiguration: v1.BuildConfiguration{ Strategy: buildStrategy(), OrderStrategy: orderStrategy(), diff --git a/pkg/resources/config/crd/bases/camel.apache.org_integrationkits.yaml b/pkg/resources/config/crd/bases/camel.apache.org_integrationkits.yaml index 53b69620e..a27762f95 100644 --- a/pkg/resources/config/crd/bases/camel.apache.org_integrationkits.yaml +++ b/pkg/resources/config/crd/bases/camel.apache.org_integrationkits.yaml @@ -376,7 +376,7 @@ spec: type: array runtimeProvider: description: The runtime provider to use for the integration. - (Default, Camel K Runtime). + (Default, plain Quarkus). enum: - quarkus - plain-quarkus diff --git a/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml b/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml index e128e6acd..1ec9afa42 100644 --- a/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml +++ b/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml @@ -739,7 +739,7 @@ spec: type: array runtimeProvider: description: The runtime provider to use for the integration. - (Default, Camel K Runtime). + (Default, plain Quarkus). enum: - quarkus - plain-quarkus @@ -3269,7 +3269,7 @@ spec: type: array runtimeProvider: description: The runtime provider to use for the integration. - (Default, Camel K Runtime). + (Default, plain Quarkus). enum: - quarkus - plain-quarkus diff --git a/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml b/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml index 764f65c4d..6dff2fcd2 100644 --- a/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml +++ b/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml @@ -597,7 +597,7 @@ spec: type: array runtimeProvider: description: The runtime provider to use for the integration. - (Default, Camel K Runtime). + (Default, plain Quarkus). enum: - quarkus - plain-quarkus @@ -3007,7 +3007,7 @@ spec: type: array runtimeProvider: description: The runtime provider to use for the integration. - (Default, Camel K Runtime). + (Default, plain Quarkus). enum: - quarkus - plain-quarkus diff --git a/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml b/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml index 928b78e44..b52aac2b6 100644 --- a/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml +++ b/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml @@ -7442,7 +7442,7 @@ spec: type: array runtimeProvider: description: The runtime provider to use for the integration. - (Default, Camel K Runtime). + (Default, plain Quarkus). enum: - quarkus - plain-quarkus @@ -9813,7 +9813,7 @@ spec: type: array runtimeProvider: description: The runtime provider to use for the integration. - (Default, Camel K Runtime). + (Default, plain Quarkus). enum: - quarkus - plain-quarkus diff --git a/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml b/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml index a9a1b206f..cad0e7697 100644 --- a/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml +++ b/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml @@ -7495,7 +7495,7 @@ spec: type: array runtimeProvider: description: The runtime provider to use for the integration. - (Default, Camel K Runtime). + (Default, plain Quarkus). enum: - quarkus - plain-quarkus @@ -9790,7 +9790,7 @@ spec: type: array runtimeProvider: description: The runtime provider to use for the integration. - (Default, Camel K Runtime). + (Default, plain Quarkus). enum: - quarkus - plain-quarkus diff --git a/pkg/trait/camel.go b/pkg/trait/camel.go index fe55655d8..7cd76e053 100644 --- a/pkg/trait/camel.go +++ b/pkg/trait/camel.go @@ -18,13 +18,16 @@ limitations under the License. package trait import ( + "context" "errors" "fmt" "strconv" "strings" + "time" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/wait" ctrl "sigs.k8s.io/controller-runtime/pkg/client" v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1" @@ -34,6 +37,7 @@ import ( "github.com/apache/camel-k/v2/pkg/util/defaults" "github.com/apache/camel-k/v2/pkg/util/kubernetes" "github.com/apache/camel-k/v2/pkg/util/property" + apierrors "k8s.io/apimachinery/pkg/api/errors" ) const ( @@ -48,7 +52,7 @@ type camelTrait struct { // private configuration used only internally runtimeVersion string - runtimeProvider string + runtimeProvider v1.RuntimeProvider } func newCamelTrait() Trait { @@ -76,17 +80,13 @@ func (t *camelTrait) Configure(e *Environment) (bool, *TraitCondition, error) { return false, NewIntegrationConditionPlatformDisabledWithMessage("Camel", "synthetic integration"), nil } - if t.RuntimeVersion == "" { + if t.RuntimeProvider == "" { t.runtimeProvider = determineRuntimeProvider(e) } else { - t.runtimeProvider = t.RuntimeProvider + t.runtimeProvider = v1.RuntimeProvider(t.RuntimeProvider) } if t.RuntimeVersion == "" { - if runtimeVersion, err := determineRuntimeVersion(e); err != nil { - return false, nil, err - } else { - t.runtimeVersion = runtimeVersion - } + t.runtimeVersion = determineRuntimeVersion(e) } else { t.runtimeVersion = t.RuntimeVersion } @@ -125,8 +125,8 @@ func (t *camelTrait) Apply(e *Environment) error { if e.Integration != nil { if e.Integration.IsManagedBuild() && !e.Integration.IsGitBuild() { // If it's not managed we don't know which is the runtime running - e.Integration.Status.RuntimeVersion = e.CamelCatalog.Runtime.Version - e.Integration.Status.RuntimeProvider = e.CamelCatalog.Runtime.Provider + e.Integration.Status.RuntimeVersion = t.runtimeVersion + e.Integration.Status.RuntimeProvider = t.runtimeProvider } e.Integration.Status.Catalog = &v1.Catalog{ Version: e.CamelCatalog.Runtime.Version, @@ -136,8 +136,8 @@ func (t *camelTrait) Apply(e *Environment) error { if e.IntegrationKit != nil { //nolint: staticcheck if !e.IntegrationKit.IsSynthetic() { - e.IntegrationKit.Status.RuntimeVersion = e.CamelCatalog.Runtime.Version - e.IntegrationKit.Status.RuntimeProvider = e.CamelCatalog.Runtime.Provider + e.IntegrationKit.Status.RuntimeVersion = t.runtimeVersion + e.IntegrationKit.Status.RuntimeProvider = t.runtimeProvider } e.IntegrationKit.Status.Catalog = &v1.Catalog{ Version: e.CamelCatalog.Runtime.Version, @@ -161,7 +161,7 @@ func (t *camelTrait) loadOrCreateCatalog(e *Environment) error { runtime := v1.RuntimeSpec{ Version: t.runtimeVersion, - Provider: v1.RuntimeProvider(t.runtimeProvider), + Provider: t.runtimeProvider, } if runtime.Provider == v1.RuntimeProviderPlainQuarkus { // We need this workaround to load the last existing catalog @@ -206,6 +206,48 @@ func (t *camelTrait) loadOrCreateCatalog(e *Environment) error { return err } } + + // If the catalog is a plain-quarkus one, then, we need to wait for it to be available + // as the logic is that it is cloned after a legacy camel k runtime catalog. + // NOTE: the CamelCatalog is meant to disappear anytime soon, so we can maintain this workaround + // as long as the CamelCatalog is supported + if runtime.Provider == v1.RuntimeProviderPlainQuarkus { + err = wait.PollUntilContextTimeout( + e.Ctx, + //nolint:mnd + 2*time.Second, + 1*time.Minute, + true, + func(ctx context.Context) (bool, error) { + c, err := camel.LoadCatalogFixedRuntime( + ctx, + e.Client, + catalogNamespace, + runtime, + ) + + if apierrors.IsNotFound(err) { + return false, nil + } + + if err != nil { + return false, err + } + + if c == nil { + return false, nil + } + + catalog = c + + return true, nil + }, + ) + } + + if err != nil { + return err + } } if catalog == nil { @@ -213,46 +255,49 @@ func (t *camelTrait) loadOrCreateCatalog(e *Environment) error { runtime.Version, runtime.Provider) } + if runtime.Provider == v1.RuntimeProviderPlainQuarkus { // We need this workaround to load the last existing catalog // TODO: this part will be subject to future refactoring catalog.Runtime.Version = t.runtimeVersion } - e.CamelCatalog = catalog return nil } -func determineRuntimeVersion(e *Environment) (string, error) { +func determineRuntimeVersion(e *Environment) string { if e.Integration != nil && e.Integration.Status.RuntimeVersion != "" { - return e.Integration.Status.RuntimeVersion, nil + return e.Integration.Status.RuntimeVersion } if e.IntegrationKit != nil && e.IntegrationKit.Status.RuntimeVersion != "" { - return e.IntegrationKit.Status.RuntimeVersion, nil + return e.IntegrationKit.Status.RuntimeVersion } if e.IntegrationProfile != nil && e.IntegrationProfile.Spec.Build.RuntimeVersion != "" { - return e.IntegrationProfile.Spec.Build.RuntimeVersion, nil + return e.IntegrationProfile.Spec.Build.RuntimeVersion } if e.Platform.BuildRuntimeVersion != "" { - return e.Platform.BuildRuntimeVersion, nil + return e.Platform.BuildRuntimeVersion } - return "", errors.New("unable to determine runtime version") + return defaults.DefaultRuntimeVersion } -func determineRuntimeProvider(e *Environment) string { +func determineRuntimeProvider(e *Environment) v1.RuntimeProvider { if e.Integration != nil && e.Integration.Status.RuntimeProvider != "" { - return string(e.Integration.Status.RuntimeProvider) + return e.Integration.Status.RuntimeProvider } if e.IntegrationKit != nil && e.IntegrationKit.Status.RuntimeProvider != "" { - return string(e.IntegrationKit.Status.RuntimeProvider) + return e.IntegrationKit.Status.RuntimeProvider } if e.IntegrationProfile != nil && e.IntegrationProfile.Spec.Build.RuntimeProvider != "" { - return string(e.IntegrationProfile.Spec.Build.RuntimeProvider) + return e.IntegrationProfile.Spec.Build.RuntimeProvider + } + if e.Platform.BuildRuntimeProvider != "" { + return e.Platform.BuildRuntimeProvider } - return defaults.DefaultRuntimeProvider + return v1.RuntimeProvider(defaults.DefaultRuntimeProvider) } func (t *camelTrait) computeUserProperties(e *Environment) []ctrl.Object { diff --git a/pkg/util/camel/camel_runtime.go b/pkg/util/camel/camel_runtime.go index 5c534a504..2945acb30 100644 --- a/pkg/util/camel/camel_runtime.go +++ b/pkg/util/camel/camel_runtime.go @@ -112,3 +112,24 @@ func LoadCatalog(ctx context.Context, client client.Client, namespace string, ru return catalog, nil } + +// LoadCatalogFixedRuntime loads a catalog matching exactly the runtime provided. +func LoadCatalogFixedRuntime(ctx context.Context, client client.Client, namespace string, runtime v1.RuntimeSpec) (*RuntimeCatalog, error) { + options := []k8sclient.ListOption{ + k8sclient.InNamespace(namespace), + } + + list := v1.NewCamelCatalogList() + err := client.List(ctx, &list, options...) + if err != nil { + return nil, err + } + + for _, catalog := range list.Items { + if catalog.Spec.Runtime.Version == runtime.Version && catalog.Spec.Runtime.Provider == runtime.Provider { + return NewRuntimeCatalog(catalog), nil + } + } + + return nil, nil +} diff --git a/pkg/util/defaults/defaults.go b/pkg/util/defaults/defaults.go index fd7faa3f9..901b55b8d 100644 --- a/pkg/util/defaults/defaults.go +++ b/pkg/util/defaults/defaults.go @@ -29,7 +29,7 @@ const ( DefaultRuntimeProvider = "plain-quarkus" // DefaultRuntimeVersion -- - DefaultRuntimeVersion = "3.35.1" + DefaultRuntimeVersion = "3.33.2" // CamelKRuntimeCatalogVersion -- CamelKRuntimeCatalogVersion = "3.15.3" diff --git a/script/Makefile b/script/Makefile index 3059fda90..2c47a48ba 100644 --- a/script/Makefile +++ b/script/Makefile @@ -28,7 +28,7 @@ VERSION ?= 2.11.0-SNAPSHOT LAST_RELEASED_IMAGE_NAME := camel-k-operator LAST_RELEASED_VERSION ?= 2.10.0 DEFAULT_RUNTIME_PROVIDER := plain-quarkus -DEFAULT_RUNTIME_VERSION := 3.35.1 +DEFAULT_RUNTIME_VERSION := 3.33.2 # The last camel-k-runtime catalog # we keep using it until we support the CamelCatalog CR CK_RUNTIME_CATALOG_VERSION := 3.15.3 diff --git a/script/update_docs.sh b/script/update_docs.sh index 88afc9f5d..be817b378 100755 --- a/script/update_docs.sh +++ b/script/update_docs.sh @@ -17,56 +17,6 @@ location=$(dirname $0) -echo "Scraping information from Makefile" -LAST_RELEASED_VERSION=$(grep '^LAST_RELEASED_VERSION ?= ' Makefile | sed 's/^.* \?= //') -RUNTIME_VERSION=$(grep '^DEFAULT_RUNTIME_VERSION := ' Makefile | sed 's/^.* \?= //') - -CATALOG="$location/../pkg/resources/resources/camel-catalog-$RUNTIME_VERSION.yaml" -# This script requires the catalog to be available (via make build-resources for instance) -if [ ! -f $CATALOG ]; then - echo "❗ catalog not available. Make sure to download it before calling this script." - exit 1 -fi - -KUSTOMIZE_VERSION=$(grep '^KUSTOMIZE_VERSION := ' Makefile | sed 's/^.* \?= //' | sed 's/^.//') - -echo "Camel K Runtime version: $RUNTIME_VERSION" -echo "Kustomize version: $KUSTOMIZE_VERSION" - -yq -i ".asciidoc.attributes.kustomize-version = \"$KUSTOMIZE_VERSION\"" $location/../docs/antora.yml - -echo "Scraping information from catalog available at: $CATALOG" -RUNTIME_VERSION=$(yq '.spec.runtime.version' $CATALOG) -CAMEL_VERSION=$(yq '.spec.runtime.metadata."camel.version"' $CATALOG) -re="^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)$" -if ! [[ $CAMEL_VERSION =~ $re ]]; then - echo "❗ argument must match semantic version: $CAMEL_VERSION" - exit 1 -fi -CAMEL_DOCS_VERSION="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.x" -CAMEL_QUARKUS_VERSION=$(yq '.spec.runtime.metadata."camel-quarkus.version"' $CATALOG) -re="^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)$" -if ! [[ $CAMEL_QUARKUS_VERSION =~ $re ]]; then - echo "❗ argument must match semantic version: $CAMEL_QUARKUS_VERSION" - exit 1 -fi -CAMEL_QUARKUS_DOCS_VERSION="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.x" -QUARKUS_VERSION=$(yq '.spec.runtime.metadata."quarkus.version"' $CATALOG) - -echo "Camel K latest version: $LAST_RELEASED_VERSION" -echo "Camel K Runtime version: $RUNTIME_VERSION" -echo "Camel version: $CAMEL_VERSION" -echo "Camel Quarkus version: $CAMEL_QUARKUS_VERSION" -echo "Quarkus version: $QUARKUS_VERSION" - -yq -i ".asciidoc.attributes.last-released-version = \"$LAST_RELEASED_VERSION\"" $location/../docs/antora.yml -yq -i ".asciidoc.attributes.camel-k-runtime-version = \"$RUNTIME_VERSION\"" $location/../docs/antora.yml -yq -i ".asciidoc.attributes.camel-version = \"$CAMEL_VERSION\"" $location/../docs/antora.yml -yq -i ".asciidoc.attributes.camel-docs-version = \"$CAMEL_DOCS_VERSION\"" $location/../docs/antora.yml -yq -i ".asciidoc.attributes.camel-quarkus-version = \"$CAMEL_QUARKUS_VERSION\"" $location/../docs/antora.yml -yq -i ".asciidoc.attributes.camel-quarkus-docs-version = \"$CAMEL_QUARKUS_DOCS_VERSION\"" $location/../docs/antora.yml -yq -i ".asciidoc.attributes.quarkus-version = \"$QUARKUS_VERSION\"" $location/../docs/antora.yml - echo "Scraping information from go.mod" KNATIVE_API_VERSION=$(grep '^.*knative.dev/eventing ' $location/../go.mod | sed 's/^.* //' | sed 's/^.//') KUBE_API_VERSION=$(grep '^.*k8s.io/api ' $location/../go.mod | sed 's/^.* //' | sed 's/^.//')
