This is an automated email from the ASF dual-hosted git repository. pcongiusti pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit d9a29ebfcce553d72dece4ae5d0fb5f26d9e8cc9 Author: Pasquale Congiusti <[email protected]> AuthorDate: Fri Jan 12 11:57:45 2024 +0100 chore: remove deprecated publishing strategies Removed Buildah and Kaniko which were deprecated already some time ago --- .github/workflows/builder.yml | 2 +- config/crd/bases/camel.apache.org_builds.yaml | 4 +- .../bases/camel.apache.org_integrationkits.yaml | 3 +- .../camel.apache.org_integrationplatforms.yaml | 6 +- .../crd/bases/camel.apache.org_integrations.yaml | 3 +- .../bases/camel.apache.org_kameletbindings.yaml | 3 +- config/crd/bases/camel.apache.org_pipes.yaml | 3 +- docs/antora.yml | 2 - .../ROOT/pages/contributing/developers.adoc | 1 - .../pages/installation/advanced/build-config.adoc | 2 - .../ROOT/pages/installation/advanced/offline.adoc | 8 - .../ROOT/pages/installation/registry/gcr.adoc | 15 - docs/modules/ROOT/partials/apis/camel-k-crds.adoc | 5 +- e2e/install/cli/install_test.go | 15 - helm/camel-k/crds/crd-build.yaml | 4 +- helm/camel-k/crds/crd-integration-kit.yaml | 3 +- helm/camel-k/crds/crd-integration-platform.yaml | 6 +- helm/camel-k/crds/crd-integration.yaml | 3 +- helm/camel-k/crds/crd-kamelet-binding.yaml | 3 +- helm/camel-k/crds/crd-pipe.yaml | 3 +- pkg/apis/camel/v1/build_types.go | 4 +- pkg/apis/camel/v1/build_types_support.go | 6 - pkg/apis/camel/v1/integrationplatform_types.go | 11 +- .../camel/v1/integrationplatform_types_support.go | 15 - pkg/apis/camel/v1/trait/builder.go | 1 + pkg/builder/buildah.go | 35 -- pkg/builder/builder_support.go | 69 ---- pkg/builder/kaniko.go | 49 --- pkg/builder/tasks.go | 22 -- pkg/cmd/install.go | 130 +++---- pkg/cmd/install_test.go | 8 - pkg/controller/build/build_pod.go | 419 +-------------------- pkg/controller/build/monitor_pod.go | 15 +- pkg/controller/integrationplatform/initialize.go | 70 +--- .../integrationplatform_controller.go | 1 - pkg/controller/integrationplatform/kaniko_cache.go | 120 ------ pkg/controller/integrationplatform/warm.go | 82 ---- pkg/controller/integrationplatform/warm_test.go | 138 ------- pkg/platform/defaults.go | 42 --- pkg/platform/defaults_test.go | 20 +- pkg/resources/resources.go | 4 +- pkg/trait/builder.go | 67 ---- pkg/trait/builder_test.go | 23 +- pkg/util/defaults/defaults.go | 6 - script/Makefile | 8 - script/update_docs.sh | 6 - 46 files changed, 100 insertions(+), 1365 deletions(-) diff --git a/.github/workflows/builder.yml b/.github/workflows/builder.yml index 9938707fd..759873174 100644 --- a/.github/workflows/builder.yml +++ b/.github/workflows/builder.yml @@ -74,7 +74,7 @@ jobs: strategy: fail-fast: false matrix: - publisher: ["Spectrum", "Jib"] + publisher: ["Jib", "Spectrum"] steps: - name: Checkout code diff --git a/config/crd/bases/camel.apache.org_builds.yaml b/config/crd/bases/camel.apache.org_builds.yaml index 3cb3ea1b6..6fd600e23 100644 --- a/config/crd/bases/camel.apache.org_builds.yaml +++ b/config/crd/bases/camel.apache.org_builds.yaml @@ -149,7 +149,7 @@ spec: properties: buildah: description: 'a BuildahTask, for Buildah strategy Deprecated: - use spectrum, jib or s2i instead' + use spectrum, jib, s2i or a custom publishing strategy instead' properties: baseImage: description: base image layer @@ -914,7 +914,7 @@ spec: type: object kaniko: description: 'a KanikoTask, for Kaniko strategy Deprecated: - use spectrum, jib or s2i instead' + use spectrum, jib, s2i or a custom publishing strategy instead' properties: baseImage: description: base image layer diff --git a/config/crd/bases/camel.apache.org_integrationkits.yaml b/config/crd/bases/camel.apache.org_integrationkits.yaml index 72b9037b8..da6585701 100644 --- a/config/crd/bases/camel.apache.org_integrationkits.yaml +++ b/config/crd/bases/camel.apache.org_integrationkits.yaml @@ -317,7 +317,8 @@ spec: type: array verbose: description: Enable verbose logging on build components that - support it (e.g. Kaniko build pod). + support it (e.g. Kaniko build pod). Deprecated no longer + in use type: boolean type: object camel: diff --git a/config/crd/bases/camel.apache.org_integrationplatforms.yaml b/config/crd/bases/camel.apache.org_integrationplatforms.yaml index 85ae39af3..55e738b24 100644 --- a/config/crd/bases/camel.apache.org_integrationplatforms.yaml +++ b/config/crd/bases/camel.apache.org_integrationplatforms.yaml @@ -622,7 +622,8 @@ spec: type: array verbose: description: Enable verbose logging on build components that - support it (e.g. Kaniko build pod). + support it (e.g. Kaniko build pod). Deprecated no longer + in use type: boolean type: object camel: @@ -2512,7 +2513,8 @@ spec: type: array verbose: description: Enable verbose logging on build components that - support it (e.g. Kaniko build pod). + support it (e.g. Kaniko build pod). Deprecated no longer + in use type: boolean type: object camel: diff --git a/config/crd/bases/camel.apache.org_integrations.yaml b/config/crd/bases/camel.apache.org_integrations.yaml index 1a25cc2cb..c22c6db6b 100644 --- a/config/crd/bases/camel.apache.org_integrations.yaml +++ b/config/crd/bases/camel.apache.org_integrations.yaml @@ -6535,7 +6535,8 @@ spec: type: array verbose: description: Enable verbose logging on build components that - support it (e.g. Kaniko build pod). + support it (e.g. Kaniko build pod). Deprecated no longer + in use type: boolean type: object camel: diff --git a/config/crd/bases/camel.apache.org_kameletbindings.yaml b/config/crd/bases/camel.apache.org_kameletbindings.yaml index 6b119dfa4..dd9edf480 100644 --- a/config/crd/bases/camel.apache.org_kameletbindings.yaml +++ b/config/crd/bases/camel.apache.org_kameletbindings.yaml @@ -6820,7 +6820,8 @@ spec: type: array verbose: description: Enable verbose logging on build components - that support it (e.g. Kaniko build pod). + that support it (e.g. Kaniko build pod). Deprecated + no longer in use type: boolean type: object camel: diff --git a/config/crd/bases/camel.apache.org_pipes.yaml b/config/crd/bases/camel.apache.org_pipes.yaml index 223dbb9fc..eb1bfe2f6 100644 --- a/config/crd/bases/camel.apache.org_pipes.yaml +++ b/config/crd/bases/camel.apache.org_pipes.yaml @@ -6818,7 +6818,8 @@ spec: type: array verbose: description: Enable verbose logging on build components - that support it (e.g. Kaniko build pod). + that support it (e.g. Kaniko build pod). Deprecated + no longer in use type: boolean type: object camel: diff --git a/docs/antora.yml b/docs/antora.yml index e19fc0874..d07a4a098 100644 --- a/docs/antora.yml +++ b/docs/antora.yml @@ -37,8 +37,6 @@ asciidoc: camel-quarkus-version: 3.2.3 camel-quarkus-docs-version: 3.2.x quarkus-version: 3.2.9.Final - buildah-version: 1.30.0 - kaniko-version: 1.9.1 kustomize-version: 4.5.4 kubernetes-api-version: 0.27.7 operator-fwk-api-version: 0.20.0 diff --git a/docs/modules/ROOT/pages/contributing/developers.adoc b/docs/modules/ROOT/pages/contributing/developers.adoc index 5629b98ce..8d662ba3b 100644 --- a/docs/modules/ROOT/pages/contributing/developers.adoc +++ b/docs/modules/ROOT/pages/contributing/developers.adoc @@ -222,7 +222,6 @@ When configuring the IDE task, make sure to add all required environment variabl After you set up the IDE task, with Java 11+ to be used by default, you can run and debug the operator process. NOTE: The operator can be fully debugged in CRC, because it uses OpenShift S2I binary builds under the hood. -The build phase cannot be (currently) debugged in Minikube because the Kaniko builder requires that the operator and the publisher pod share a common persistent volume. [[publishing]] == Building Metadata for Publishing the Operator in Operator Hub diff --git a/docs/modules/ROOT/pages/installation/advanced/build-config.adoc b/docs/modules/ROOT/pages/installation/advanced/build-config.adoc index 6c6b6d4a6..0de388415 100644 --- a/docs/modules/ROOT/pages/installation/advanced/build-config.adoc +++ b/docs/modules/ROOT/pages/installation/advanced/build-config.adoc @@ -11,8 +11,6 @@ The `routine` strategy (default) is in general faster as it does not require Kub The `pod` strategy is **always** used when running a Quarkus native build (as it requires certain tools not available in the operator container). You can also use this strategy when you want to have a higher level of concurrency. Although a bit slower (it requires Kubernetes to spin off a new Pod), this strategy will guarantee the execution of each parallel build in a timely manner. -NOTE: the `pod` strategy was also required when using the now deprecated Buildah or Kaniko publishing strategy. - Beside the build strategy, there are other configuration you can fine tune for each single build (via builder trait) or in the `.spec.build.buildConfiguration` of the IntegrationPlatform if you want to apply such configuration to all your builds. See the Builder trait page for more information. The most relevant are the `resource` and `limit` parameters which can be used to control how much resources to give to builder Pods. Then you can configure the `orderStrategy`, setting a `sequential` (single build), `fifo` (parallel build started in FIFO order) or `dependencies` (parallel build holding those applications which may depends on other because of xref:architecture/incremental-image.adoc[incremental image]). Finally you can include any `mavenProfile` to the build in order to i [...] diff --git a/docs/modules/ROOT/pages/installation/advanced/offline.adoc b/docs/modules/ROOT/pages/installation/advanced/offline.adoc index 6edf96e65..f221dc196 100644 --- a/docs/modules/ROOT/pages/installation/advanced/offline.adoc +++ b/docs/modules/ROOT/pages/installation/advanced/offline.adoc @@ -23,14 +23,6 @@ We cannot provide any specific guideline on how to preload images in the cluster The last one is the image used in the Camel K Runtime 2.16.0 version (the default one at the time of writing). Make sure to identify in the catalog (`.spec.runtime.metadata.quarkus.native-builder-image`) the one required in your installation. -If you also plan to use Buildah or Kaniko strategy, you need to provide those images as well: - -* `quay.io/buildah/stable` -* `gcr.io/kaniko-project/executor` -* `gcr.io/kaniko-project/warmer` - -Same thing if you are planning to use any xref:pipeline/pipeline.adoc[custom pipeline]. You need to upload the expected image ahead of time. - If all the above is set, then, you should be ready to pull and push from the container registry in Camel K as well. [[maven]] diff --git a/docs/modules/ROOT/pages/installation/registry/gcr.adoc b/docs/modules/ROOT/pages/installation/registry/gcr.adoc index bc6cdfb0c..df470f70c 100644 --- a/docs/modules/ROOT/pages/installation/registry/gcr.adoc +++ b/docs/modules/ROOT/pages/installation/registry/gcr.adoc @@ -17,21 +17,6 @@ The best way to obtain a valid key is from the Google web console: A `.json` file with the key will be downloaded to your machine. You need to store that key in a Kubernetes secret. -It's **important** to rename the file you've just downloaded to `kaniko-secret.json` (make sure you write it correctly). -After the renaming, execute the following command to create the secret: - -``` -kubectl create secret generic kaniko-secret --from-file=kaniko-secret.json -``` - -Ensure you have the https://github.com/apache/camel-k/releases[*kamel* CLI] on your system path. - -You should now execute the following command to install cluster resources and the operator (in the current namespace): - -``` -kamel install --build-publish-strategy=Kaniko --registry gcr.io --organization <<your-project-id>> --registry-secret kaniko-secret -``` - Use the project id of your project on GKE. Usually this can be obtained from the connection string. NOTE: the project id is **NOT** the cluster id! diff --git a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc index 7cafb6fc3..0a65eef48 100644 --- a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc +++ b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc @@ -5206,7 +5206,7 @@ a PackageTask, used to package the project a BuildahTask, for Buildah strategy -Deprecated: use spectrum, jib or s2i instead +Deprecated: use spectrum, jib, s2i or a custom publishing strategy instead |`kaniko` + *xref:#_camel_apache_org_v1_KanikoTask[KanikoTask]* @@ -5214,7 +5214,7 @@ Deprecated: use spectrum, jib or s2i instead a KanikoTask, for Kaniko strategy -Deprecated: use spectrum, jib or s2i instead +Deprecated: use spectrum, jib, s2i or a custom publishing strategy instead |`spectrum` + *xref:#_camel_apache_org_v1_SpectrumTask[SpectrumTask]* @@ -5817,6 +5817,7 @@ bool Enable verbose logging on build components that support it (e.g. Kaniko build pod). +Deprecated no longer in use |`properties` + []string diff --git a/e2e/install/cli/install_test.go b/e2e/install/cli/install_test.go index 5d58a6575..f5d8780ca 100644 --- a/e2e/install/cli/install_test.go +++ b/e2e/install/cli/install_test.go @@ -220,18 +220,3 @@ func TestInstallDebugLogging(t *testing.T) { Eventually(OperatorEnvVarValue(ns, "LOG_LEVEL"), TestTimeoutLong).Should(Equal("debug")) }) } - -func TestInstallWithPublishStrategyOptions(t *testing.T) { - WithNewTestNamespace(t, func(ns string) { - operatorID := fmt.Sprintf("camel-k-%s", ns) - Expect(KamelInstallWithID(operatorID, ns, "--build-publish-strategy", "Kaniko", "--build-publish-strategy-option", "KanikoExecutorImage=foo", "--build-publish-strategy-option", "KanikoWarmerImage=bar").Execute()).To(Succeed()) - Eventually(OperatorPod(ns)).ShouldNot(BeNil()) - Eventually(Platform(ns)).ShouldNot(BeNil()) - Eventually(func() map[string]string { - return Platform(ns)().Spec.Build.PublishStrategyOptions - }).Should(HaveKeyWithValue("KanikoExecutorImage", "foo")) - Eventually(func() map[string]string { - return Platform(ns)().Spec.Build.PublishStrategyOptions - }).Should(HaveKeyWithValue("KanikoWarmerImage", "bar")) - }) -} diff --git a/helm/camel-k/crds/crd-build.yaml b/helm/camel-k/crds/crd-build.yaml index 3cb3ea1b6..6fd600e23 100644 --- a/helm/camel-k/crds/crd-build.yaml +++ b/helm/camel-k/crds/crd-build.yaml @@ -149,7 +149,7 @@ spec: properties: buildah: description: 'a BuildahTask, for Buildah strategy Deprecated: - use spectrum, jib or s2i instead' + use spectrum, jib, s2i or a custom publishing strategy instead' properties: baseImage: description: base image layer @@ -914,7 +914,7 @@ spec: type: object kaniko: description: 'a KanikoTask, for Kaniko strategy Deprecated: - use spectrum, jib or s2i instead' + use spectrum, jib, s2i or a custom publishing strategy instead' properties: baseImage: description: base image layer diff --git a/helm/camel-k/crds/crd-integration-kit.yaml b/helm/camel-k/crds/crd-integration-kit.yaml index 72b9037b8..da6585701 100644 --- a/helm/camel-k/crds/crd-integration-kit.yaml +++ b/helm/camel-k/crds/crd-integration-kit.yaml @@ -317,7 +317,8 @@ spec: type: array verbose: description: Enable verbose logging on build components that - support it (e.g. Kaniko build pod). + support it (e.g. Kaniko build pod). Deprecated no longer + in use type: boolean type: object camel: diff --git a/helm/camel-k/crds/crd-integration-platform.yaml b/helm/camel-k/crds/crd-integration-platform.yaml index 85ae39af3..55e738b24 100644 --- a/helm/camel-k/crds/crd-integration-platform.yaml +++ b/helm/camel-k/crds/crd-integration-platform.yaml @@ -622,7 +622,8 @@ spec: type: array verbose: description: Enable verbose logging on build components that - support it (e.g. Kaniko build pod). + support it (e.g. Kaniko build pod). Deprecated no longer + in use type: boolean type: object camel: @@ -2512,7 +2513,8 @@ spec: type: array verbose: description: Enable verbose logging on build components that - support it (e.g. Kaniko build pod). + support it (e.g. Kaniko build pod). Deprecated no longer + in use type: boolean type: object camel: diff --git a/helm/camel-k/crds/crd-integration.yaml b/helm/camel-k/crds/crd-integration.yaml index 1a25cc2cb..c22c6db6b 100644 --- a/helm/camel-k/crds/crd-integration.yaml +++ b/helm/camel-k/crds/crd-integration.yaml @@ -6535,7 +6535,8 @@ spec: type: array verbose: description: Enable verbose logging on build components that - support it (e.g. Kaniko build pod). + support it (e.g. Kaniko build pod). Deprecated no longer + in use type: boolean type: object camel: diff --git a/helm/camel-k/crds/crd-kamelet-binding.yaml b/helm/camel-k/crds/crd-kamelet-binding.yaml index 6b119dfa4..dd9edf480 100644 --- a/helm/camel-k/crds/crd-kamelet-binding.yaml +++ b/helm/camel-k/crds/crd-kamelet-binding.yaml @@ -6820,7 +6820,8 @@ spec: type: array verbose: description: Enable verbose logging on build components - that support it (e.g. Kaniko build pod). + that support it (e.g. Kaniko build pod). Deprecated + no longer in use type: boolean type: object camel: diff --git a/helm/camel-k/crds/crd-pipe.yaml b/helm/camel-k/crds/crd-pipe.yaml index 223dbb9fc..eb1bfe2f6 100644 --- a/helm/camel-k/crds/crd-pipe.yaml +++ b/helm/camel-k/crds/crd-pipe.yaml @@ -6818,7 +6818,8 @@ spec: type: array verbose: description: Enable verbose logging on build components - that support it (e.g. Kaniko build pod). + that support it (e.g. Kaniko build pod). Deprecated + no longer in use type: boolean type: object camel: diff --git a/pkg/apis/camel/v1/build_types.go b/pkg/apis/camel/v1/build_types.go index a843eea5b..188aa0ad1 100644 --- a/pkg/apis/camel/v1/build_types.go +++ b/pkg/apis/camel/v1/build_types.go @@ -67,10 +67,10 @@ type Task struct { // Application Publishing // a BuildahTask, for Buildah strategy - // Deprecated: use spectrum, jib or s2i instead + // Deprecated: use spectrum, jib, s2i or a custom publishing strategy instead Buildah *BuildahTask `json:"buildah,omitempty"` // a KanikoTask, for Kaniko strategy - // Deprecated: use spectrum, jib or s2i instead + // Deprecated: use spectrum, jib, s2i or a custom publishing strategy instead Kaniko *KanikoTask `json:"kaniko,omitempty"` // a SpectrumTask, for Spectrum strategy Spectrum *SpectrumTask `json:"spectrum,omitempty"` diff --git a/pkg/apis/camel/v1/build_types_support.go b/pkg/apis/camel/v1/build_types_support.go index a9777b65f..251e1cf8e 100644 --- a/pkg/apis/camel/v1/build_types_support.go +++ b/pkg/apis/camel/v1/build_types_support.go @@ -104,12 +104,6 @@ func ConfigurationTasksByName(tasks []Task, name string) *BuildConfiguration { if t.Jib != nil && t.Jib.Name == name { return &t.Jib.Configuration } - if t.Buildah != nil && t.Buildah.Name == name { - return &t.Buildah.Configuration - } - if t.Kaniko != nil && t.Kaniko.Name == name { - return &t.Kaniko.Configuration - } } return &BuildConfiguration{} } diff --git a/pkg/apis/camel/v1/integrationplatform_types.go b/pkg/apis/camel/v1/integrationplatform_types.go index 8f5dea268..62470188c 100644 --- a/pkg/apis/camel/v1/integrationplatform_types.go +++ b/pkg/apis/camel/v1/integrationplatform_types.go @@ -153,14 +153,6 @@ type IntegrationPlatformKameletRepositorySpec struct { type IntegrationPlatformBuildPublishStrategy string const ( - // IntegrationPlatformBuildPublishStrategyBuildah uses Buildah project (https://buildah.io/) - // in order to push the incremental images to the image repository. It can be used with `pod` BuildStrategy. - // Deprecated: use Spectrum, Jib or S2I instead. - IntegrationPlatformBuildPublishStrategyBuildah IntegrationPlatformBuildPublishStrategy = "Buildah" - // IntegrationPlatformBuildPublishStrategyKaniko uses Kaniko project (https://github.com/GoogleContainerTools/kaniko) - // in order to push the incremental images to the image repository. It can be used with `pod` BuildStrategy. - // Deprecated: use Spectrum, Jib or S2I instead. - IntegrationPlatformBuildPublishStrategyKaniko IntegrationPlatformBuildPublishStrategy = "Kaniko" // IntegrationPlatformBuildPublishStrategyS2I uses the Source to Images (S2I) feature // (https://docs.openshift.com/container-platform/4.9/openshift_images/create-images.html#images-create-s2i_create-images) // provided by an OpenShift cluster in order to create and push the images to the registry. It is the default choice on OpenShift cluster. @@ -175,8 +167,6 @@ const ( // IntegrationPlatformBuildPublishStrategies the list of all available publish strategies. var IntegrationPlatformBuildPublishStrategies = []IntegrationPlatformBuildPublishStrategy{ - IntegrationPlatformBuildPublishStrategyBuildah, - IntegrationPlatformBuildPublishStrategyKaniko, IntegrationPlatformBuildPublishStrategyS2I, IntegrationPlatformBuildPublishStrategySpectrum, IntegrationPlatformBuildPublishStrategyJib, @@ -197,6 +187,7 @@ const ( // IntegrationPlatformPhaseCreating when the IntegrationPlatform is under creation process. IntegrationPlatformPhaseCreating IntegrationPlatformPhase = "Creating" // IntegrationPlatformPhaseWarming when the IntegrationPlatform is warming (ie, creating Kaniko cache). + // Deprecated no longer in use. IntegrationPlatformPhaseWarming IntegrationPlatformPhase = "Warming" // IntegrationPlatformPhaseReady when the IntegrationPlatform is ready. IntegrationPlatformPhaseReady IntegrationPlatformPhase = "Ready" diff --git a/pkg/apis/camel/v1/integrationplatform_types_support.go b/pkg/apis/camel/v1/integrationplatform_types_support.go index fb216a8cd..e3f9e4fbd 100644 --- a/pkg/apis/camel/v1/integrationplatform_types_support.go +++ b/pkg/apis/camel/v1/integrationplatform_types_support.go @@ -18,8 +18,6 @@ limitations under the License. package v1 import ( - "strconv" - corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -173,19 +171,6 @@ func (in *IntegrationPlatformStatus) RemoveCondition(condType IntegrationPlatfor in.Conditions = newConditions } -// IsOptionEnabled tells if provided option key is present in PublishStrategyOptions and enabled. -func (b IntegrationPlatformBuildSpec) IsOptionEnabled(option string) bool { - // Key defined in builder/kaniko.go - if enabled, ok := b.PublishStrategyOptions[option]; ok { - res, err := strconv.ParseBool(enabled) - if err != nil { - return false - } - return res - } - return false -} - // AddOption add a publish strategy option. func (b *IntegrationPlatformBuildSpec) AddOption(option string, value string) { options := b.PublishStrategyOptions diff --git a/pkg/apis/camel/v1/trait/builder.go b/pkg/apis/camel/v1/trait/builder.go index c98feafa6..b628a190f 100644 --- a/pkg/apis/camel/v1/trait/builder.go +++ b/pkg/apis/camel/v1/trait/builder.go @@ -24,6 +24,7 @@ package trait type BuilderTrait struct { PlatformBaseTrait `property:",squash" json:",inline"` // Enable verbose logging on build components that support it (e.g. Kaniko build pod). + // Deprecated no longer in use Verbose *bool `property:"verbose" json:"verbose,omitempty"` // A list of properties to be provided to the build task Properties []string `property:"properties" json:"properties,omitempty"` diff --git a/pkg/builder/buildah.go b/pkg/builder/buildah.go deleted file mode 100644 index d1ca940cb..000000000 --- a/pkg/builder/buildah.go +++ /dev/null @@ -1,35 +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. -*/ - -package builder - -const BuildahPlatform = "BuildahPlatform" -const BuildahImage = "BuildahImage" -const BuildahDefaultImageName = "quay.io/buildah/stable" -const BuildahDefaultBaseImageName = "docker.io/library/eclipse-temurin:17" - -var buildahSupportedOptions = map[string]PublishStrategyOption{ - BuildahPlatform: { - Name: BuildahPlatform, - description: "The attribute platform for buildah", - }, - BuildahImage: { - Name: BuildahImage, - description: "The docker image to use for Buildah", - defaultValue: BuildahDefaultImageName, - }, -} diff --git a/pkg/builder/builder_support.go b/pkg/builder/builder_support.go deleted file mode 100644 index beef7ef63..000000000 --- a/pkg/builder/builder_support.go +++ /dev/null @@ -1,69 +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. -*/ - -package builder - -import ( - "fmt" - - v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1" -) - -type PublishStrategyOption struct { - Name string - description string - defaultValue string -} - -func (o *PublishStrategyOption) ToString() string { - if o.defaultValue == "" { - return fmt.Sprintf("%s: %s", o.Name, o.description) - } - return fmt.Sprintf("%s: %s, default %s", o.Name, o.description, o.defaultValue) -} - -// GetSupportedPublishStrategyOptions provides the supported options for the given strategy. Returns nil if no options are supported. -func GetSupportedPublishStrategyOptions(strategy v1.IntegrationPlatformBuildPublishStrategy) []PublishStrategyOption { - var supportedOptions map[string]PublishStrategyOption - switch strategy { - case v1.IntegrationPlatformBuildPublishStrategyKaniko: - supportedOptions = kanikoSupportedOptions - case v1.IntegrationPlatformBuildPublishStrategyBuildah: - supportedOptions = buildahSupportedOptions - default: - return nil - } - result := make([]PublishStrategyOption, 0, len(supportedOptions)) - for _, value := range supportedOptions { - result = append(result, value) - } - return result -} - -// IsSupportedPublishStrategyOption indicates whether the given option name is supported for the given strategy. -func IsSupportedPublishStrategyOption(strategy v1.IntegrationPlatformBuildPublishStrategy, name string) bool { - var supportedOption bool - switch strategy { - case v1.IntegrationPlatformBuildPublishStrategyKaniko: - _, supportedOption = kanikoSupportedOptions[name] - case v1.IntegrationPlatformBuildPublishStrategyBuildah: - _, supportedOption = buildahSupportedOptions[name] - default: - supportedOption = false - } - return supportedOption -} diff --git a/pkg/builder/kaniko.go b/pkg/builder/kaniko.go deleted file mode 100644 index 5800cfb60..000000000 --- a/pkg/builder/kaniko.go +++ /dev/null @@ -1,49 +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. -*/ - -package builder - -// KanikoCacheDir is the cache directory for Kaniko builds (mounted into the Kaniko pod). -const KanikoCacheDir = "/kaniko/cache" -const KanikoPVCName = "KanikoPersistentVolumeClaim" -const KanikoBuildCacheEnabled = "KanikoBuildCacheEnabled" -const KanikoExecutorImage = "KanikoExecutorImage" -const KanikoWarmerImage = "KanikoWarmerImage" -const KanikoDefaultExecutorImageName = "gcr.io/kaniko-project/executor" -const KanikoDefaultWarmerImageName = "gcr.io/kaniko-project/warmer" - -var kanikoSupportedOptions = map[string]PublishStrategyOption{ - KanikoPVCName: { - Name: KanikoPVCName, - description: "The name of the PersistentVolumeClaim", - }, - KanikoBuildCacheEnabled: { - Name: KanikoBuildCacheEnabled, - description: "To enable or disable the Kaniko cache", - defaultValue: "false", - }, - KanikoExecutorImage: { - Name: KanikoExecutorImage, - description: "The docker image of the Kaniko executor", - defaultValue: KanikoDefaultExecutorImageName, - }, - KanikoWarmerImage: { - Name: KanikoWarmerImage, - description: "The docker image of the Kaniko warmer", - defaultValue: KanikoDefaultWarmerImageName, - }, -} diff --git a/pkg/builder/tasks.go b/pkg/builder/tasks.go index c61a8df2f..2e18403ce 100644 --- a/pkg/builder/tasks.go +++ b/pkg/builder/tasks.go @@ -55,18 +55,6 @@ func (b *Build) Task(task v1.Task) Task { build: b.build, task: task.Package, } - // Buildah tasks are not supported in routines - case task.Buildah != nil: - return &unsupportedTask{ - build: b.build, - name: task.Buildah.Name, - } - // Kaniko tasks are not supported in routines - case task.Kaniko != nil: - return &unsupportedTask{ - build: b.build, - name: task.Kaniko.Name, - } case task.Spectrum != nil: return &spectrumTask{ c: b.builder.client, @@ -152,16 +140,6 @@ func (b *Build) TaskByName(name string) Task { build: b.build, task: task.Package, } - case task.Buildah != nil && task.Buildah.Name == name: - return &unsupportedTask{ - build: b.build, - name: task.Buildah.Name, - } - case task.Kaniko != nil && task.Kaniko.Name == name: - return &unsupportedTask{ - build: b.build, - name: task.Kaniko.Name, - } case task.Spectrum != nil && task.Spectrum.Name == name: return &spectrumTask{ c: b.builder.client, diff --git a/pkg/cmd/install.go b/pkg/cmd/install.go index 7c55ea409..80a0f66fe 100644 --- a/pkg/cmd/install.go +++ b/pkg/cmd/install.go @@ -43,7 +43,6 @@ import ( ctrl "sigs.k8s.io/controller-runtime/pkg/client" v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1" - "github.com/apache/camel-k/v2/pkg/builder" "github.com/apache/camel-k/v2/pkg/client" "github.com/apache/camel-k/v2/pkg/install" "github.com/apache/camel-k/v2/pkg/util" @@ -162,53 +161,52 @@ func newCmdInstall(rootCmdOptions *RootCmdOptions) (*cobra.Command, *installCmdO type installCmdOptions struct { *RootCmdOptions - Wait bool `mapstructure:"wait"` - ClusterSetupOnly bool `mapstructure:"cluster-setup"` - SkipOperatorSetup bool `mapstructure:"skip-operator-setup"` - SkipClusterSetup bool `mapstructure:"skip-cluster-setup"` - SkipRegistrySetup bool `mapstructure:"skip-registry-setup"` - SkipDefaultKameletsSetup bool `mapstructure:"skip-default-kamelets-setup"` - ExampleSetup bool `mapstructure:"example"` - Global bool `mapstructure:"global"` - Save bool `mapstructure:"save" kamel:"omitsave"` - Force bool `mapstructure:"force"` - Olm bool `mapstructure:"olm"` - olmOptions olm.Options - ClusterType string `mapstructure:"cluster-type"` - OutputFormat string `mapstructure:"output"` - RuntimeVersion string `mapstructure:"runtime-version"` - BaseImage string `mapstructure:"base-image"` - OperatorID string `mapstructure:"operator-id"` - OperatorImage string `mapstructure:"operator-image"` - OperatorImagePullPolicy string `mapstructure:"operator-image-pull-policy"` - BuildStrategy string `mapstructure:"build-strategy"` - BuildOrderStrategy string `mapstructure:"build-order-strategy"` - BuildPublishStrategy string `mapstructure:"build-publish-strategy"` - BuildPublishStrategyOptions []string `mapstructure:"build-publish-strategy-options"` - BuildTimeout string `mapstructure:"build-timeout"` - MavenExtensions []string `mapstructure:"maven-extensions"` - MavenLocalRepository string `mapstructure:"maven-local-repository"` - MavenProperties []string `mapstructure:"maven-properties"` - MavenRepositories []string `mapstructure:"maven-repositories"` - MavenSettings string `mapstructure:"maven-settings"` - MavenCASecret string `mapstructure:"maven-ca-secret"` - MavenCLIOptions []string `mapstructure:"maven-cli-options"` - HealthPort int32 `mapstructure:"health-port"` - MaxRunningBuilds int32 `mapstructure:"max-running-pipelines"` - Monitoring bool `mapstructure:"monitoring"` - MonitoringPort int32 `mapstructure:"monitoring-port"` - Debugging bool `mapstructure:"debugging"` - DebuggingPort int32 `mapstructure:"debugging-port"` - DebuggingPath string `mapstructure:"debugging-path"` - TraitProfile string `mapstructure:"trait-profile"` - Tolerations []string `mapstructure:"tolerations"` - NodeSelectors []string `mapstructure:"node-selectors"` - ResourcesRequirements []string `mapstructure:"operator-resources"` - LogLevel string `mapstructure:"log-level"` - EnvVars []string `mapstructure:"operator-env-vars"` - registry v1.RegistrySpec - registryAuth registry.Auth - RegistryAuthFile string `mapstructure:"registry-auth-file"` + Wait bool `mapstructure:"wait"` + ClusterSetupOnly bool `mapstructure:"cluster-setup"` + SkipOperatorSetup bool `mapstructure:"skip-operator-setup"` + SkipClusterSetup bool `mapstructure:"skip-cluster-setup"` + SkipRegistrySetup bool `mapstructure:"skip-registry-setup"` + SkipDefaultKameletsSetup bool `mapstructure:"skip-default-kamelets-setup"` + ExampleSetup bool `mapstructure:"example"` + Global bool `mapstructure:"global"` + Save bool `mapstructure:"save" kamel:"omitsave"` + Force bool `mapstructure:"force"` + Olm bool `mapstructure:"olm"` + olmOptions olm.Options + ClusterType string `mapstructure:"cluster-type"` + OutputFormat string `mapstructure:"output"` + RuntimeVersion string `mapstructure:"runtime-version"` + BaseImage string `mapstructure:"base-image"` + OperatorID string `mapstructure:"operator-id"` + OperatorImage string `mapstructure:"operator-image"` + OperatorImagePullPolicy string `mapstructure:"operator-image-pull-policy"` + BuildStrategy string `mapstructure:"build-strategy"` + BuildOrderStrategy string `mapstructure:"build-order-strategy"` + BuildPublishStrategy string `mapstructure:"build-publish-strategy"` + BuildTimeout string `mapstructure:"build-timeout"` + MavenExtensions []string `mapstructure:"maven-extensions"` + MavenLocalRepository string `mapstructure:"maven-local-repository"` + MavenProperties []string `mapstructure:"maven-properties"` + MavenRepositories []string `mapstructure:"maven-repositories"` + MavenSettings string `mapstructure:"maven-settings"` + MavenCASecret string `mapstructure:"maven-ca-secret"` + MavenCLIOptions []string `mapstructure:"maven-cli-options"` + HealthPort int32 `mapstructure:"health-port"` + MaxRunningBuilds int32 `mapstructure:"max-running-pipelines"` + Monitoring bool `mapstructure:"monitoring"` + MonitoringPort int32 `mapstructure:"monitoring-port"` + Debugging bool `mapstructure:"debugging"` + DebuggingPort int32 `mapstructure:"debugging-port"` + DebuggingPath string `mapstructure:"debugging-path"` + TraitProfile string `mapstructure:"trait-profile"` + Tolerations []string `mapstructure:"tolerations"` + NodeSelectors []string `mapstructure:"node-selectors"` + ResourcesRequirements []string `mapstructure:"operator-resources"` + LogLevel string `mapstructure:"log-level"` + EnvVars []string `mapstructure:"operator-env-vars"` + registry v1.RegistrySpec + registryAuth registry.Auth + RegistryAuthFile string `mapstructure:"registry-auth-file"` } func (o *installCmdOptions) install(cmd *cobra.Command, _ []string) error { @@ -591,11 +589,6 @@ func (o *installCmdOptions) setupIntegrationPlatform(c client.Client, namespace } } } - if len(o.BuildPublishStrategyOptions) > 0 { - if err = o.addBuildPublishStrategyOptions(&platform.Spec.Build); err != nil { - return nil, err - } - } // Always create a platform in the namespace where the operator is located err = install.ObjectOrCollect(o.Context, c, namespace, output, o.Force, platform) if err != nil { @@ -792,37 +785,6 @@ func (o *installCmdOptions) validate(_ *cobra.Command, _ []string) error { return result } -// addBuildPublishStrategyOptions parses and adds all the build publish strategy options to the given IntegrationPlatformBuildSpec. -func (o *installCmdOptions) addBuildPublishStrategyOptions(pipeline *v1.IntegrationPlatformBuildSpec) error { - for _, option := range o.BuildPublishStrategyOptions { - kv := strings.Split(option, "=") - if len(kv) == 2 { - key := kv[0] - if builder.IsSupportedPublishStrategyOption(pipeline.PublishStrategy, key) { - pipeline.AddOption(key, kv[1]) - } else { - return fmt.Errorf("build publish strategy option '%s' not supported. %s", option, supportedOptionsAsString(pipeline.PublishStrategy)) - } - } else { - return fmt.Errorf("build publish strategy option '%s' not in the expected format (name=value)", option) - } - } - return nil -} - -// supportedOptionsAsString provides all the supported options for the given strategy as string. -func supportedOptionsAsString(strategy v1.IntegrationPlatformBuildPublishStrategy) string { - options := builder.GetSupportedPublishStrategyOptions(strategy) - if len(options) == 0 { - return fmt.Sprintf("no options are supported for the strategy '%s'.", strategy) - } - var sb strings.Builder - for _, supportedOption := range builder.GetSupportedPublishStrategyOptions(strategy) { - sb.WriteString(fmt.Sprintf("* %s\n", supportedOption.ToString())) - } - return fmt.Sprintf("\n\nSupported options for the strategy '%s':\n\n%s", strategy, sb.String()) -} - func decodeMavenSettings(mavenSettings string) (v1.ValueSource, error) { return v1.DecodeValueSource(mavenSettings, "settings.xml", "illegal maven setting definition, syntax: configmap|secret:resource-name[/settings path]") } diff --git a/pkg/cmd/install_test.go b/pkg/cmd/install_test.go index ad222ab26..09f778bee 100644 --- a/pkg/cmd/install_test.go +++ b/pkg/cmd/install_test.go @@ -163,14 +163,6 @@ func TestInstallHealthFlag(t *testing.T) { assert.Equal(t, int32(7777), installCmdOptions.HealthPort) } -func TestInstallBuildPublishStrategyOptions(t *testing.T) { - installCmdOptions, rootCmd, _ := initializeInstallCmdOptions(t) - _, err := test.ExecuteCommand(rootCmd, cmdInstall, "--build-publish-strategy-option", "foo1=bar1", "--build-publish-strategy-option", "foo2=bar2") - assert.Nil(t, err) - assert.Equal(t, "foo1=bar1", installCmdOptions.BuildPublishStrategyOptions[0]) - assert.Equal(t, "foo2=bar2", installCmdOptions.BuildPublishStrategyOptions[1]) -} - func TestInstallLocalRepositoryFlag(t *testing.T) { installCmdOptions, rootCmd, _ := initializeInstallCmdOptions(t) _, err := test.ExecuteCommand(rootCmd, cmdInstall, "--maven-local-repository", "someString") diff --git a/pkg/controller/build/build_pod.go b/pkg/controller/build/build_pod.go index 46fd34d55..ab9c433d5 100644 --- a/pkg/controller/build/build_pod.go +++ b/pkg/controller/build/build_pod.go @@ -19,12 +19,8 @@ package build import ( "context" - "errors" - "fmt" "os" "path/filepath" - "strconv" - "strings" corev1 "k8s.io/api/core/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" @@ -32,10 +28,8 @@ import ( ctrl "sigs.k8s.io/controller-runtime/pkg/client" v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1" - "github.com/apache/camel-k/v2/pkg/builder" "github.com/apache/camel-k/v2/pkg/client" "github.com/apache/camel-k/v2/pkg/platform" - "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/openshift" ) @@ -45,76 +39,7 @@ const ( builderVolume = "camel-k-builder" ) -type registryConfigMap struct { - fileName string - mountPath string - destination string -} - -var ( - serviceCABuildahRegistryConfigMap = registryConfigMap{ - fileName: "service-ca.crt", - mountPath: "/etc/containers/certs.d", - destination: "service-ca.crt", - } - - buildahRegistryConfigMaps = []registryConfigMap{ - serviceCABuildahRegistryConfigMap, - } -) - -type registrySecret struct { - fileName string - mountPath string - destination string - refEnv string -} - -var ( - plainDockerBuildahRegistrySecret = registrySecret{ - fileName: corev1.DockerConfigKey, - mountPath: "/buildah/.docker", - destination: "config.json", - } - standardDockerBuildahRegistrySecret = registrySecret{ - fileName: corev1.DockerConfigJsonKey, - mountPath: "/buildah/.docker", - destination: "config.json", - refEnv: "REGISTRY_AUTH_FILE", - } - - buildahRegistrySecrets = []registrySecret{ - plainDockerBuildahRegistrySecret, - standardDockerBuildahRegistrySecret, - } -) - -var ( - gcrKanikoRegistrySecret = registrySecret{ - fileName: "kaniko-secret.json", - mountPath: "/secret", - destination: "kaniko-secret.json", - refEnv: "GOOGLE_APPLICATION_CREDENTIALS", - } - plainDockerKanikoRegistrySecret = registrySecret{ - fileName: "config.json", - mountPath: "/kaniko/.docker", - destination: "config.json", - } - standardDockerKanikoRegistrySecret = registrySecret{ - fileName: corev1.DockerConfigJsonKey, - mountPath: "/kaniko/.docker", - destination: "config.json", - } - - kanikoRegistrySecrets = []registrySecret{ - gcrKanikoRegistrySecret, - plainDockerKanikoRegistrySecret, - standardDockerKanikoRegistrySecret, - } -) - -func newBuildPod(ctx context.Context, c ctrl.Reader, client client.Client, build *v1.Build) (*corev1.Pod, error) { +func newBuildPod(ctx context.Context, client client.Client, build *v1.Build) *corev1.Pod { var ugfid int64 = 1001 podSecurityContext := &corev1.PodSecurityContext{ RunAsUser: &ugfid, @@ -165,17 +90,6 @@ func newBuildPod(ctx context.Context, c ctrl.Reader, client client.Client, build // It's a type of builder task, we can reuse the same type case task.Package != nil: addBuildTaskToPod(ctx, client, build, task.Package.Name, pod) - // Publish task - case task.Buildah != nil: - err := addBuildahTaskToPod(ctx, c, build, task.Buildah, pod) - if err != nil { - return nil, err - } - case task.Kaniko != nil: - err := addKanikoTaskToPod(ctx, c, build, task.Kaniko, pod) - if err != nil { - return nil, err - } case task.S2i != nil: addBuildTaskToPod(ctx, client, build, task.S2i.Name, pod) case task.Spectrum != nil: @@ -189,7 +103,7 @@ func newBuildPod(ctx context.Context, c ctrl.Reader, client client.Client, build pod.Spec.Containers = pod.Spec.InitContainers[len(pod.Spec.InitContainers)-1 : len(pod.Spec.InitContainers)] pod.Spec.InitContainers = pod.Spec.InitContainers[:len(pod.Spec.InitContainers)-1] - return pod, nil + return pod } func configureResources(taskName string, build *v1.Build, container *corev1.Container) { @@ -317,252 +231,6 @@ func addBuildTaskToPod(ctx context.Context, client client.Client, build *v1.Buil addContainerToPod(build, container, pod) } -func addBuildahTaskToPod(ctx context.Context, c ctrl.Reader, build *v1.Build, task *v1.BuildahTask, pod *corev1.Pod) error { - var bud []string - - bud = []string{ - "buildah", - "bud", - "--storage-driver=vfs", - } - - if task.Platform != "" { - bud = append(bud, []string{ - "--platform", - task.Platform, - }...) - } - - bud = append(bud, []string{ - "--pull-always", - "-f", - "Dockerfile", - "-t", - task.Image, - ".", - }...) - - push := []string{ - "buildah", - "push", - "--storage-driver=vfs", - "--digestfile=/dev/termination-log", - task.Image, - "docker://" + task.Image, - } - - if task.Verbose != nil && *task.Verbose { - bud = append(bud[:2], append([]string{"--log-level=debug"}, bud[2:]...)...) - push = append(push[:2], append([]string{"--log-level=debug"}, push[2:]...)...) - } - - env := make([]corev1.EnvVar, 0) - volumes := make([]corev1.Volume, 0) - volumeMounts := make([]corev1.VolumeMount, 0) - - if task.Registry.CA != "" { - config, err := getRegistryConfigMap(ctx, c, build.Namespace, task.Registry.CA, buildahRegistryConfigMaps) - if err != nil { - return err - } - addRegistryConfigMap(task.Registry.CA, config, &volumes, &volumeMounts) - // This is easier to use the --cert-dir option, otherwise Buildah defaults to looking up certificates - // into a directory named after the registry address - bud = append(bud[:2], append([]string{"--cert-dir=/etc/containers/certs.d"}, bud[2:]...)...) - push = append(push[:2], append([]string{"--cert-dir=/etc/containers/certs.d"}, push[2:]...)...) - } - - var auth string - if task.Registry.Secret != "" { - secret, err := getRegistrySecret(ctx, c, build.Namespace, task.Registry.Secret, buildahRegistrySecrets) - if err != nil { - return err - } - if secret == plainDockerBuildahRegistrySecret { - // Handle old format and make it compatible with Buildah - auth = "(echo '{ \"auths\": ' ; cat /buildah/.docker/config.json ; echo \"}\") > /tmp/.dockercfg" - env = append(env, corev1.EnvVar{ - Name: "REGISTRY_AUTH_FILE", - Value: "/tmp/.dockercfg", - }) - } - addRegistrySecret(task.Registry.Secret, secret, &volumes, &volumeMounts, &env) - } - - if task.Registry.Insecure { - bud = append(bud[:2], append([]string{"--tls-verify=false"}, bud[2:]...)...) - push = append(push[:2], append([]string{"--tls-verify=false"}, push[2:]...)...) - } - - env = append(env, proxyFromEnvironment()...) - - args := []string{ - strings.Join(bud, " "), - strings.Join(push, " "), - } - if auth != "" { - args = append([]string{auth}, args...) - } - - image := task.ExecutorImage - if image == "" { - image = fmt.Sprintf("%s:v%s", builder.BuildahDefaultImageName, defaults.BuildahVersion) - } - - var root int64 = 0 - container := corev1.Container{ - Name: task.Name, - Image: image, - ImagePullPolicy: corev1.PullIfNotPresent, - Command: []string{"/bin/sh", "-c"}, - Args: []string{strings.Join(args, " && ")}, - Env: env, - WorkingDir: filepath.Join(builderDir, build.Name, builder.ContextDir), - VolumeMounts: volumeMounts, - // Buildah requires root privileges - SecurityContext: &corev1.SecurityContext{ - RunAsUser: &root, - RunAsGroup: &root, - }, - } - - pod.Spec.Volumes = append(pod.Spec.Volumes, volumes...) - - configureResources(task.Name, build, &container) - addContainerToPod(build, container, pod) - - return nil -} - -func addKanikoTaskToPod(ctx context.Context, c ctrl.Reader, build *v1.Build, task *v1.KanikoTask, pod *corev1.Pod) error { - cache := false - if task.Cache.Enabled != nil && *task.Cache.Enabled { - cache = true - } - - args := []string{ - "--dockerfile=Dockerfile", - "--context=" + filepath.Join(builderDir, build.Name, builder.ContextDir), - "--destination=" + task.Image, - "--cache=" + strconv.FormatBool(cache), - "--cache-dir=" + builder.KanikoCacheDir, - } - - if task.Verbose != nil && *task.Verbose { - args = append(args, "-v=debug") - } - - affinity := &corev1.Affinity{} - env := make([]corev1.EnvVar, 0) - volumes := make([]corev1.Volume, 0) - volumeMounts := make([]corev1.VolumeMount, 0) - - if task.Registry.Secret != "" { - secret, err := getRegistrySecret(ctx, c, build.Namespace, task.Registry.Secret, kanikoRegistrySecrets) - if err != nil { - return err - } - addRegistrySecret(task.Registry.Secret, secret, &volumes, &volumeMounts, &env) - } - - if task.Registry.Insecure { - args = append(args, "--insecure") - args = append(args, "--insecure-pull") - } - - env = append(env, proxyFromEnvironment()...) - - if cache { - // Co-locate with the Kaniko warmer pod for sharing the host path volume as the current - // persistent volume claim uses the default storage class which is likely relying - // on the host path provisioner. - // This has to be done manually by retrieving the Kaniko warmer pod node name and using - // node affinity as pod affinity only works for running pods and the Kaniko warmer pod - // has already completed at that stage. - - // Locate the kaniko warmer pod - pods := &corev1.PodList{} - err := c.List(ctx, pods, - ctrl.InNamespace(build.Namespace), - ctrl.MatchingLabels{ - "camel.apache.org/component": "kaniko-warmer", - }) - if err != nil { - return err - } - - if len(pods.Items) != 1 { - return errors.New("failed to locate the Kaniko cache warmer pod") - } - - // Use node affinity with the Kaniko warmer pod node name - affinity = &corev1.Affinity{ - NodeAffinity: &corev1.NodeAffinity{ - RequiredDuringSchedulingIgnoredDuringExecution: &corev1.NodeSelector{ - NodeSelectorTerms: []corev1.NodeSelectorTerm{ - { - MatchExpressions: []corev1.NodeSelectorRequirement{ - { - Key: "kubernetes.io/hostname", - Operator: "In", - Values: []string{pods.Items[0].Spec.NodeName}, - }, - }, - }, - }, - }, - }, - } - // Mount the PV used to warm the Kaniko cache into the Kaniko image build - volumes = append(volumes, corev1.Volume{ - Name: "kaniko-cache", - VolumeSource: corev1.VolumeSource{ - PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{ - ClaimName: task.Cache.PersistentVolumeClaim, - }, - }, - }) - volumeMounts = append(volumeMounts, corev1.VolumeMount{ - Name: "kaniko-cache", - MountPath: builder.KanikoCacheDir, - }) - } - - image := task.ExecutorImage - if image == "" { - image = fmt.Sprintf("%s:v%s", builder.KanikoDefaultExecutorImageName, defaults.KanikoVersion) - } - - container := corev1.Container{ - Name: task.Name, - Image: image, - ImagePullPolicy: corev1.PullIfNotPresent, - Args: args, - Env: env, - WorkingDir: filepath.Join(builderDir, build.Name, builder.ContextDir), - VolumeMounts: volumeMounts, - } - - // We may want to handle possible conflicts - pod.Spec.Affinity = affinity - pod.Spec.Volumes = append(pod.Spec.Volumes, volumes...) - - // Warning: Kaniko requires root privileges to work correctly - // As we're planning to deprecate this building strategy we're fixing in the first - // releases of version 2 - var ugfid int64 = 0 - pod.Spec.SecurityContext = &corev1.PodSecurityContext{ - RunAsUser: &ugfid, - RunAsGroup: &ugfid, - FSGroup: &ugfid, - } - - configureResources(task.Name, build, &container) - addContainerToPod(build, container, pod) - - return nil -} - func addCustomTaskToPod(build *v1.Build, task *v1.UserTask, pod *corev1.Pod) { container := corev1.Container{ Name: task.Name, @@ -604,89 +272,6 @@ func hasVolume(pod *corev1.Pod, name string) bool { return false } -func getRegistryConfigMap(ctx context.Context, c ctrl.Reader, ns, name string, registryConfigMaps []registryConfigMap) (registryConfigMap, error) { - config := corev1.ConfigMap{} - err := c.Get(ctx, ctrl.ObjectKey{Namespace: ns, Name: name}, &config) - if err != nil { - return registryConfigMap{}, err - } - for _, k := range registryConfigMaps { - if _, ok := config.Data[k.fileName]; ok { - return k, nil - } - } - return registryConfigMap{}, errors.New("unsupported registry config map") -} - -func addRegistryConfigMap(name string, config registryConfigMap, volumes *[]corev1.Volume, volumeMounts *[]corev1.VolumeMount) { - *volumes = append(*volumes, corev1.Volume{ - Name: "registry-config", - VolumeSource: corev1.VolumeSource{ - ConfigMap: &corev1.ConfigMapVolumeSource{ - LocalObjectReference: corev1.LocalObjectReference{ - Name: name, - }, - Items: []corev1.KeyToPath{ - { - Key: config.fileName, - Path: config.destination, - }, - }, - }, - }, - }) - - *volumeMounts = append(*volumeMounts, corev1.VolumeMount{ - Name: "registry-config", - MountPath: config.mountPath, - ReadOnly: true, - }) -} - -func getRegistrySecret(ctx context.Context, c ctrl.Reader, ns, name string, registrySecrets []registrySecret) (registrySecret, error) { - secret := corev1.Secret{} - err := c.Get(ctx, ctrl.ObjectKey{Namespace: ns, Name: name}, &secret) - if err != nil { - return registrySecret{}, err - } - for _, k := range registrySecrets { - if _, ok := secret.Data[k.fileName]; ok { - return k, nil - } - } - return registrySecret{}, errors.New("unsupported secret type for registry authentication") -} - -func addRegistrySecret(name string, secret registrySecret, volumes *[]corev1.Volume, volumeMounts *[]corev1.VolumeMount, env *[]corev1.EnvVar) { - *volumes = append(*volumes, corev1.Volume{ - Name: "registry-secret", - VolumeSource: corev1.VolumeSource{ - Secret: &corev1.SecretVolumeSource{ - SecretName: name, - Items: []corev1.KeyToPath{ - { - Key: secret.fileName, - Path: secret.destination, - }, - }, - }, - }, - }) - - *volumeMounts = append(*volumeMounts, corev1.VolumeMount{ - Name: "registry-secret", - MountPath: secret.mountPath, - ReadOnly: true, - }) - - if secret.refEnv != "" { - *env = append(*env, corev1.EnvVar{ - Name: secret.refEnv, - Value: filepath.Join(secret.mountPath, secret.destination), - }) - } -} - func proxyFromEnvironment() []corev1.EnvVar { var envVars []corev1.EnvVar diff --git a/pkg/controller/build/monitor_pod.go b/pkg/controller/build/monitor_pod.go index 0af446104..506fe105b 100644 --- a/pkg/controller/build/monitor_pod.go +++ b/pkg/controller/build/monitor_pod.go @@ -72,16 +72,13 @@ func (action *monitorPodAction) Handle(ctx context.Context, build *v1.Build) (*v switch build.Status.Phase { case v1.BuildPhasePending: - if pod, err = newBuildPod(ctx, action.reader, action.client, build); err != nil { - return nil, err - } - + pod = newBuildPod(ctx, action.client, build) // If the Builder Pod is in the Build namespace, we can set the ownership to it. If not (global operator mode) // we set the ownership to the Operator Pod instead var owner metav1.Object owner = build if build.Namespace != pod.Namespace { - operatorPod := platform.GetOperatorPod(ctx, action.reader, pod.Namespace) + operatorPod := platform.GetOperatorPod(ctx, action.client, pod.Namespace) if operatorPod != nil { owner = operatorPod } @@ -364,10 +361,6 @@ func publishTaskImageName(tasks []v1.Task) string { return t.Spectrum.Image case t.Jib != nil: return t.Jib.Image - case t.Buildah != nil: - return t.Buildah.Image - case t.Kaniko != nil: - return t.Kaniko.Image } return "" @@ -385,10 +378,6 @@ func publishTaskName(tasks []v1.Task) string { return t.Spectrum.Name case t.Jib != nil: return t.Jib.Name - case t.Buildah != nil: - return t.Buildah.Name - case t.Kaniko != nil: - return t.Kaniko.Name } return "" diff --git a/pkg/controller/integrationplatform/initialize.go b/pkg/controller/integrationplatform/initialize.go index a63b9f798..0d766a92a 100644 --- a/pkg/controller/integrationplatform/initialize.go +++ b/pkg/controller/integrationplatform/initialize.go @@ -20,14 +20,7 @@ package integrationplatform import ( "context" - corev1 "k8s.io/api/core/v1" - k8serrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1" - "github.com/apache/camel-k/v2/pkg/builder" - "github.com/apache/camel-k/v2/pkg/client" platformutil "github.com/apache/camel-k/v2/pkg/platform" "github.com/apache/camel-k/v2/pkg/util/defaults" ) @@ -70,29 +63,7 @@ func (action *initializeAction) Handle(ctx context.Context, platform *v1.Integra if err = platformutil.ConfigureDefaults(ctx, action.client, platform, true); err != nil { return nil, err } - if platform.Status.Build.PublishStrategy == v1.IntegrationPlatformBuildPublishStrategyKaniko { - cacheEnabled := platform.Status.Build.IsOptionEnabled(builder.KanikoBuildCacheEnabled) - if cacheEnabled { - // Create the persistent volume claim used by the Kaniko cache - action.L.Info("Create persistent volume claim") - err := createPersistentVolumeClaim(ctx, action.client, platform) - if err != nil { - return nil, err - } - // Create the Kaniko warmer pod that caches the base image into the Camel K builder volume - action.L.Info("Create Kaniko cache warmer pod") - err = createKanikoCacheWarmerPod(ctx, action.client, platform) - if err != nil { - return nil, err - } - platform.Status.Phase = v1.IntegrationPlatformPhaseWarming - } else { - // Skip the warmer pod creation - platform.Status.Phase = v1.IntegrationPlatformPhaseCreating - } - } else { - platform.Status.Phase = v1.IntegrationPlatformPhaseCreating - } + platform.Status.Phase = v1.IntegrationPlatformPhaseCreating platform.Status.Version = defaults.Version return platform, nil @@ -116,42 +87,3 @@ func (action *initializeAction) isPrimaryDuplicate(ctx context.Context, thisPlat return false, nil } - -func createPersistentVolumeClaim(ctx context.Context, client client.Client, platform *v1.IntegrationPlatform) error { - volumeSize, err := resource.ParseQuantity("1Gi") - if err != nil { - return err - } - pvcName := platform.Status.Build.PublishStrategyOptions[builder.KanikoPVCName] - pvc := &corev1.PersistentVolumeClaim{ - TypeMeta: metav1.TypeMeta{ - APIVersion: corev1.SchemeGroupVersion.String(), - Kind: "PersistentVolumeClaim", - }, - ObjectMeta: metav1.ObjectMeta{ - Namespace: platform.Namespace, - Name: pvcName, - Labels: map[string]string{ - "app": "camel-k", - }, - }, - Spec: corev1.PersistentVolumeClaimSpec{ - AccessModes: []corev1.PersistentVolumeAccessMode{ - corev1.ReadWriteOnce, - }, - Resources: corev1.ResourceRequirements{ - Requests: corev1.ResourceList{ - corev1.ResourceStorage: volumeSize, - }, - }, - }, - } - - err = client.Create(ctx, pvc) - // Skip the error in case the PVC already exists - if err != nil && !k8serrors.IsAlreadyExists(err) { - return err - } - - return nil -} diff --git a/pkg/controller/integrationplatform/integrationplatform_controller.go b/pkg/controller/integrationplatform/integrationplatform_controller.go index e95a3413e..2c714af8d 100644 --- a/pkg/controller/integrationplatform/integrationplatform_controller.go +++ b/pkg/controller/integrationplatform/integrationplatform_controller.go @@ -155,7 +155,6 @@ func (r *reconcileIntegrationPlatform) Reconcile(ctx context.Context, request re actions := []Action{ NewInitializeAction(), - NewWarmAction(r.reader), NewCreateAction(), NewMonitorAction(), } diff --git a/pkg/controller/integrationplatform/kaniko_cache.go b/pkg/controller/integrationplatform/kaniko_cache.go deleted file mode 100644 index f82ef1d52..000000000 --- a/pkg/controller/integrationplatform/kaniko_cache.go +++ /dev/null @@ -1,120 +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. -*/ - -package integrationplatform - -import ( - "context" - "fmt" - - corev1 "k8s.io/api/core/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1" - "github.com/apache/camel-k/v2/pkg/builder" - "github.com/apache/camel-k/v2/pkg/client" - "github.com/apache/camel-k/v2/pkg/util/defaults" -) - -func createKanikoCacheWarmerPod(ctx context.Context, client client.Client, platform *v1.IntegrationPlatform) error { - // The pod will be scheduled to nodes that are selected by the persistent volume - // node affinity spec, if any, as provisioned by the persistent volume claim storage - // class provisioner. - // See: - // - https://kubernetes.io/docs/concepts/storage/persistent-volumes/#node-affinity - // - https://kubernetes.io/docs/concepts/storage/volumes/#local - pvcName := platform.Status.Build.PublishStrategyOptions[builder.KanikoPVCName] - - var warmerImage string - if image, found := platform.Status.Build.PublishStrategyOptions[builder.KanikoWarmerImage]; found { - warmerImage = image - } else { - warmerImage = fmt.Sprintf("%s:v%s", builder.KanikoDefaultWarmerImageName, defaults.KanikoVersion) - } - - pod := corev1.Pod{ - TypeMeta: metav1.TypeMeta{ - APIVersion: corev1.SchemeGroupVersion.String(), - Kind: "Pod", - }, - ObjectMeta: metav1.ObjectMeta{ - Namespace: platform.Namespace, - Name: platform.Name + "-cache", - Labels: map[string]string{ - "camel.apache.org/component": "kaniko-warmer", - }, - }, - Spec: corev1.PodSpec{ - Containers: []corev1.Container{ - { - Name: "warm-kaniko-cache", - Image: warmerImage, - Args: []string{ - "--cache-dir=" + builder.KanikoCacheDir, - "--image=" + platform.Status.Build.BaseImage, - }, - VolumeMounts: []corev1.VolumeMount{ - { - Name: "kaniko-cache", - MountPath: builder.KanikoCacheDir, - }, - }, - }, - }, - // Create the cache directory otherwise Kaniko warmer skips caching silently - InitContainers: []corev1.Container{ - { - Name: "create-kaniko-cache", - Image: "busybox", - ImagePullPolicy: corev1.PullIfNotPresent, - Command: []string{"/bin/sh", "-c"}, - Args: []string{"mkdir -p " + builder.KanikoCacheDir + "&& chmod -R a+rwx " + builder.KanikoCacheDir}, - VolumeMounts: []corev1.VolumeMount{ - { - Name: "kaniko-cache", - MountPath: builder.KanikoCacheDir, - }, - }, - }, - }, - RestartPolicy: corev1.RestartPolicyOnFailure, - Volumes: []corev1.Volume{ - { - Name: "kaniko-cache", - VolumeSource: corev1.VolumeSource{ - PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{ - ClaimName: pvcName, - }, - }, - }, - }, - }, - } - - err := client.Delete(ctx, &pod) - if err != nil && !apierrors.IsNotFound(err) { - return fmt.Errorf("cannot delete Kaniko warmer pod: %w", err) - } - - err = client.Create(ctx, &pod) - if err != nil { - return fmt.Errorf("cannot create Kaniko warmer pod: %w", err) - } - - return nil -} diff --git a/pkg/controller/integrationplatform/warm.go b/pkg/controller/integrationplatform/warm.go deleted file mode 100644 index c1201b23a..000000000 --- a/pkg/controller/integrationplatform/warm.go +++ /dev/null @@ -1,82 +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. -*/ - -package integrationplatform - -import ( - "context" - "errors" - - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - - ctrl "sigs.k8s.io/controller-runtime/pkg/client" - - v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1" -) - -func NewWarmAction(reader ctrl.Reader) Action { - return &warmAction{ - reader: reader, - } -} - -type warmAction struct { - baseAction - reader ctrl.Reader -} - -func (action *warmAction) Name() string { - return "warm" -} - -func (action *warmAction) CanHandle(platform *v1.IntegrationPlatform) bool { - return platform.Status.Phase == v1.IntegrationPlatformPhaseWarming -} - -func (action *warmAction) Handle(ctx context.Context, platform *v1.IntegrationPlatform) (*v1.IntegrationPlatform, error) { - // Check Kaniko warmer pod status - pod := corev1.Pod{ - TypeMeta: metav1.TypeMeta{ - APIVersion: corev1.SchemeGroupVersion.String(), - Kind: "Pod", - }, - ObjectMeta: metav1.ObjectMeta{ - Namespace: platform.Namespace, - Name: platform.Name + "-cache", - }, - } - - err := action.reader.Get(ctx, types.NamespacedName{Namespace: pod.Namespace, Name: pod.Name}, &pod) - if err != nil { - return nil, err - } - - switch pod.Status.Phase { - case corev1.PodSucceeded: - action.L.Info("Kaniko cache successfully warmed up") - platform.Status.Phase = v1.IntegrationPlatformPhaseCreating - return platform, nil - case corev1.PodFailed: - return nil, errors.New("failed to warm up Kaniko cache") - default: - action.L.Info("Waiting for Kaniko cache to warm up...") - // Requeue - return nil, nil - } -} diff --git a/pkg/controller/integrationplatform/warm_test.go b/pkg/controller/integrationplatform/warm_test.go deleted file mode 100644 index 83f963433..000000000 --- a/pkg/controller/integrationplatform/warm_test.go +++ /dev/null @@ -1,138 +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. -*/ - -package integrationplatform - -import ( - "context" - "testing" - - "github.com/apache/camel-k/v2/pkg/platform" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1" - "github.com/apache/camel-k/v2/pkg/util/log" - "github.com/apache/camel-k/v2/pkg/util/test" - "github.com/rs/xid" - "github.com/stretchr/testify/assert" -) - -func TestWarm_Succeeded(t *testing.T) { - ip := v1.IntegrationPlatform{} - ip.Namespace = "ns" - ip.Name = xid.New().String() - ip.Spec.Cluster = v1.IntegrationPlatformClusterOpenShift - ip.Spec.Profile = v1.TraitProfileOpenShift - - pod := corev1.Pod{ - TypeMeta: metav1.TypeMeta{ - APIVersion: corev1.SchemeGroupVersion.String(), - Kind: "Pod", - }, - ObjectMeta: metav1.ObjectMeta{ - Namespace: ip.Namespace, - Name: ip.Name + "-cache", - }, - Status: corev1.PodStatus{ - Phase: corev1.PodSucceeded, - }, - } - - c, err := test.NewFakeClient(&ip, &pod) - assert.Nil(t, err) - - assert.Nil(t, platform.ConfigureDefaults(context.TODO(), c, &ip, false)) - - h := NewWarmAction(c) - h.InjectLogger(log.Log) - h.InjectClient(c) - - answer, err := h.Handle(context.TODO(), &ip) - assert.Nil(t, err) - assert.NotNil(t, answer) -} - -func TestWarm_Failing(t *testing.T) { - ip := v1.IntegrationPlatform{} - ip.Namespace = "ns" - ip.Name = xid.New().String() - ip.Spec.Cluster = v1.IntegrationPlatformClusterOpenShift - ip.Spec.Profile = v1.TraitProfileOpenShift - - pod := corev1.Pod{ - TypeMeta: metav1.TypeMeta{ - APIVersion: corev1.SchemeGroupVersion.String(), - Kind: "Pod", - }, - ObjectMeta: metav1.ObjectMeta{ - Namespace: ip.Namespace, - Name: ip.Name + "-cache", - }, - Status: corev1.PodStatus{ - Phase: corev1.PodFailed, - }, - } - - c, err := test.NewFakeClient(&ip, &pod) - assert.Nil(t, err) - - assert.Nil(t, platform.ConfigureDefaults(context.TODO(), c, &ip, false)) - - h := NewWarmAction(c) - h.InjectLogger(log.Log) - h.InjectClient(c) - - answer, err := h.Handle(context.TODO(), &ip) - assert.NotNil(t, err) - assert.Nil(t, answer) -} - -func TestWarm_WarmingUp(t *testing.T) { - ip := v1.IntegrationPlatform{} - ip.Namespace = "ns" - ip.Name = xid.New().String() - ip.Spec.Cluster = v1.IntegrationPlatformClusterOpenShift - ip.Spec.Profile = v1.TraitProfileOpenShift - - pod := corev1.Pod{ - TypeMeta: metav1.TypeMeta{ - APIVersion: corev1.SchemeGroupVersion.String(), - Kind: "Pod", - }, - ObjectMeta: metav1.ObjectMeta{ - Namespace: ip.Namespace, - Name: ip.Name + "-cache", - }, - Status: corev1.PodStatus{ - Phase: corev1.PodRunning, - }, - } - - c, err := test.NewFakeClient(&ip, &pod) - assert.Nil(t, err) - - assert.Nil(t, platform.ConfigureDefaults(context.TODO(), c, &ip, false)) - - h := NewWarmAction(c) - h.InjectLogger(log.Log) - h.InjectClient(c) - - answer, err := h.Handle(context.TODO(), &ip) - assert.Nil(t, err) - assert.Nil(t, answer) -} diff --git a/pkg/platform/defaults.go b/pkg/platform/defaults.go index 1a659b181..76e61e7af 100644 --- a/pkg/platform/defaults.go +++ b/pkg/platform/defaults.go @@ -33,7 +33,6 @@ import ( ctrl "sigs.k8s.io/controller-runtime/pkg/client" v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1" - "github.com/apache/camel-k/v2/pkg/builder" "github.com/apache/camel-k/v2/pkg/client" "github.com/apache/camel-k/v2/pkg/install" "github.com/apache/camel-k/v2/pkg/kamelet/repository" @@ -83,16 +82,6 @@ func ConfigureDefaults(ctx context.Context, c client.Client, p *v1.IntegrationPl if p.Status.Build.BuildConfiguration.Strategy == "" { defaultStrategy := v1.BuildStrategyRoutine - if p.Status.Build.PublishStrategy == v1.IntegrationPlatformBuildPublishStrategyBuildah || - p.Status.Build.PublishStrategy == v1.IntegrationPlatformBuildPublishStrategyKaniko { - defaultStrategy = v1.BuildStrategyPod - log.Infof("Integration Platform %s [%s]: setting fallback build strategy %s because PublishStrategy is configured as %s", - p.Name, - p.Namespace, - defaultStrategy, - p.Status.Build.PublishStrategy, - ) - } p.Status.Build.BuildConfiguration.Strategy = defaultStrategy log.Debugf("Integration Platform %s [%s]: setting build strategy %s", p.Name, p.Namespace, p.Status.Build.BuildConfiguration.Strategy) } @@ -253,10 +242,6 @@ func applyPlatformSpec(source *v1.IntegrationPlatform, target *v1.IntegrationPla if target.Status.Build.BaseImage == "" { log.Debugf("Integration Platform %s [%s]: setting base image", target.Name, target.Namespace) target.Status.Build.BaseImage = source.Status.Build.BaseImage - // Workaround to ensure the default image from buildah is full name. Any baseImage override is in charge of it's validity - if target.Status.Build.PublishStrategy == v1.IntegrationPlatformBuildPublishStrategyBuildah && defaults.IsBaseImageDefault() { - target.Status.Build.BaseImage = builder.BuildahDefaultBaseImageName - } } if target.Status.Build.Maven.LocalRepository == "" { @@ -330,10 +315,6 @@ func setPlatformDefaults(p *v1.IntegrationPlatform, verbose bool) error { if p.Status.Build.BaseImage == "" { log.Debugf("Integration Platform %s [%s]: setting base image", p.Name, p.Namespace) p.Status.Build.BaseImage = defaults.BaseImage() - // Workaround to ensure the default image from buildah is full name. Any baseImage override is in charge of it's validity - if p.Status.Build.PublishStrategy == v1.IntegrationPlatformBuildPublishStrategyBuildah && defaults.IsBaseImageDefault() { - p.Status.Build.BaseImage = builder.BuildahDefaultBaseImageName - } } if p.Status.Build.Maven.LocalRepository == "" { log.Debugf("Integration Platform %s [%s]: setting local repository", p.Name, p.Namespace) @@ -347,10 +328,6 @@ func setPlatformDefaults(p *v1.IntegrationPlatform, verbose bool) error { "-Dstyle.color=never", } } - if _, ok := p.Status.Build.PublishStrategyOptions[builder.KanikoPVCName]; !ok { - log.Debugf("Integration Platform %s [%s]: setting publish strategy options", p.Name, p.Namespace) - p.Status.Build.PublishStrategyOptions[builder.KanikoPVCName] = p.Name - } // Build timeout if p.Status.Build.GetTimeout().Duration == 0 { @@ -379,18 +356,6 @@ func setPlatformDefaults(p *v1.IntegrationPlatform, verbose bool) error { } } - _, cacheEnabled := p.Status.Build.PublishStrategyOptions[builder.KanikoBuildCacheEnabled] - if p.Status.Build.PublishStrategy == v1.IntegrationPlatformBuildPublishStrategyKaniko && !cacheEnabled { - // Default to disabling Kaniko cache warmer - // Using the cache warmer pod seems unreliable with the current Kaniko version - // and requires relying on a persistent volume. - defaultKanikoBuildCache := "false" - p.Status.Build.PublishStrategyOptions[builder.KanikoBuildCacheEnabled] = defaultKanikoBuildCache - if verbose { - log.Log.Infof("Kaniko cache set to %s", defaultKanikoBuildCache) - } - } - if len(p.Status.Kamelet.Repositories) == 0 { log.Debugf("Integration Platform %s [%s]: setting kamelet repositories", p.Name, p.Namespace) p.Status.Kamelet.Repositories = append(p.Status.Kamelet.Repositories, v1.IntegrationPlatformKameletRepositorySpec{ @@ -411,13 +376,6 @@ func setPlatformDefaults(p *v1.IntegrationPlatform, verbose bool) error { func setStatusAdditionalInfo(platform *v1.IntegrationPlatform) { platform.Status.Info = make(map[string]string) - - log.Debugf("Integration Platform %s [%s]: setting build publish strategy", platform.Name, platform.Namespace) - if platform.Spec.Build.PublishStrategy == v1.IntegrationPlatformBuildPublishStrategyBuildah { - platform.Status.Info["buildahVersion"] = defaults.BuildahVersion - } else if platform.Spec.Build.PublishStrategy == v1.IntegrationPlatformBuildPublishStrategyKaniko { - platform.Status.Info["kanikoVersion"] = defaults.KanikoVersion - } log.Debugf("Integration Platform %s [%s]: setting status info", platform.Name, platform.Namespace) platform.Status.Info["goVersion"] = runtime.Version() platform.Status.Info["goOS"] = runtime.GOOS diff --git a/pkg/platform/defaults_test.go b/pkg/platform/defaults_test.go index d73b99af2..ac9ecd7de 100644 --- a/pkg/platform/defaults_test.go +++ b/pkg/platform/defaults_test.go @@ -27,7 +27,6 @@ import ( v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1" "github.com/apache/camel-k/v2/pkg/apis/camel/v1/trait" - "github.com/apache/camel-k/v2/pkg/builder" "github.com/apache/camel-k/v2/pkg/util/defaults" "github.com/apache/camel-k/v2/pkg/util/test" ) @@ -125,14 +124,14 @@ func TestApplyGlobalPlatformSpec(t *testing.T) { assert.Equal(t, "global_value2", ip.Status.Build.Maven.Properties["global_prop2"]) } -func TestPlatformBuildahUpdateOverrideLocalPlatformSpec(t *testing.T) { +func TestPlatformS2IhUpdateOverrideLocalPlatformSpec(t *testing.T) { global := v1.IntegrationPlatform{ ObjectMeta: metav1.ObjectMeta{ Namespace: "ns", }, Spec: v1.IntegrationPlatformSpec{ Build: v1.IntegrationPlatformBuildSpec{ - PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyBuildah, + PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I, }, }, } @@ -142,7 +141,6 @@ func TestPlatformBuildahUpdateOverrideLocalPlatformSpec(t *testing.T) { err = ConfigureDefaults(context.TODO(), c, &global, false) assert.Nil(t, err) - assert.Equal(t, builder.BuildahDefaultBaseImageName, global.Status.Build.BaseImage) ip := v1.IntegrationPlatform{ ObjectMeta: metav1.ObjectMeta{ @@ -151,7 +149,7 @@ func TestPlatformBuildahUpdateOverrideLocalPlatformSpec(t *testing.T) { }, Spec: v1.IntegrationPlatformSpec{ Build: v1.IntegrationPlatformBuildSpec{ - PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyBuildah, + PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I, BaseImage: "overridden", }, }, @@ -161,19 +159,18 @@ func TestPlatformBuildahUpdateOverrideLocalPlatformSpec(t *testing.T) { applyPlatformSpec(&global, &ip) - assert.Equal(t, v1.IntegrationPlatformBuildPublishStrategyBuildah, ip.Status.Build.PublishStrategy) + assert.Equal(t, v1.IntegrationPlatformBuildPublishStrategyS2I, ip.Status.Build.PublishStrategy) assert.Equal(t, "overridden", ip.Status.Build.BaseImage) } -func TestPlatformBuildahUpdateDefaultLocalPlatformSpec(t *testing.T) { - +func TestPlatformS2IUpdateDefaultLocalPlatformSpec(t *testing.T) { global := v1.IntegrationPlatform{ ObjectMeta: metav1.ObjectMeta{ Namespace: "ns", }, Spec: v1.IntegrationPlatformSpec{ Build: v1.IntegrationPlatformBuildSpec{ - PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyBuildah, + PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I, BaseImage: "overridden", }, }, @@ -193,7 +190,7 @@ func TestPlatformBuildahUpdateDefaultLocalPlatformSpec(t *testing.T) { }, Spec: v1.IntegrationPlatformSpec{ Build: v1.IntegrationPlatformBuildSpec{ - PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyBuildah, + PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I, }, }, } @@ -202,8 +199,7 @@ func TestPlatformBuildahUpdateDefaultLocalPlatformSpec(t *testing.T) { applyPlatformSpec(&global, &ip) - assert.Equal(t, v1.IntegrationPlatformBuildPublishStrategyBuildah, ip.Status.Build.PublishStrategy) - assert.Equal(t, builder.BuildahDefaultBaseImageName, ip.Status.Build.BaseImage) + assert.Equal(t, v1.IntegrationPlatformBuildPublishStrategyS2I, ip.Status.Build.PublishStrategy) } func TestRetainLocalPlatformSpec(t *testing.T) { diff --git a/pkg/resources/resources.go b/pkg/resources/resources.go index 758e757af..55ed0f895 100644 --- a/pkg/resources/resources.go +++ b/pkg/resources/resources.go @@ -117,9 +117,9 @@ var assets = func() http.FileSystem { "/crd/bases/camel.apache.org_builds.yaml": &vfsgen۰CompressedFileInfo{ name: "camel.apache.org_builds.yaml", modTime: time.Time{}, - uncompressedSize: 95731, + uncompressedSize: 95791, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x7d\x6b\x73\x1b\x37\x96\xe8\x77\xfd\x8a\x53\xf1\x07\xcb\x55\x22\x35\xe3\x64\x67\xb3\xba\xb5\x75\x4b\x2b\x27\xb3\x1a\x27\xb6\xd7\x94\x3d\x99\xda\xda\x2a\x81\xdd\x87\x24\xc2\x6e\xa0\x2f\x80\x16\xcd\xdc\xba\xff\xfd\x16\x5e\xfd\x10\xd9\xdd\x00\x45\xda\x9e\x72\xe3\x4b\x62\xaa\x01\x9c\x83\xc7\x79\xe1\x3c\x9e\xc1\xe4\x78\xed\xec\x19\xfc\x42\x13\x64\x12\x53\x50\x1c\xd4\x0a\xe1\xba\x20\xc9\x0a\x61\xc6\x17\x6a\x43\x04\xc2\x [...] + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x7d\x6b\x73\x1b\x37\x96\xe8\x77\xfd\x8a\x53\xf1\x07\xcb\x55\x22\x35\xe3\x64\x67\xb3\xba\xb5\x75\x4b\x2b\x27\xb3\x1a\x27\xb6\xd7\x94\x3d\x99\xda\xda\x2a\x81\xdd\x87\x24\xc2\x6e\xa0\x2f\x80\x16\xcd\xdc\xba\xff\xfd\x16\x5e\xfd\x10\xd9\xdd\x00\x45\xda\x9e\x72\xe3\x4b\x62\xaa\x01\x9c\x83\xc7\x79\xe1\x3c\x9e\xc1\xe4\x78\xed\xec\x19\xfc\x42\x13\x64\x12\x53\x50\x1c\xd4\x0a\xe1\xba\x20\xc9\x0a\x61\xc6\x17\x6a\x43\x04\xc2\x [...] }, "/crd/bases/camel.apache.org_camelcatalogs.yaml": &vfsgen۰CompressedFileInfo{ name: "camel.apache.org_camelcatalogs.yaml", diff --git a/pkg/trait/builder.go b/pkg/trait/builder.go index a0da38970..26202d269 100644 --- a/pkg/trait/builder.go +++ b/pkg/trait/builder.go @@ -260,63 +260,6 @@ func (t *builderTrait) Apply(e *Environment) error { }, Tag: e.IntegrationKit.ResourceVersion, }}) - - case v1.IntegrationPlatformBuildPublishStrategyBuildah: - t.L.Infof("Warning: Buildah publishing strategy is deprecated and may be removed in future releases. Use any alternative publishing strategy.") - var platform string - var found bool - if platform, found = e.Platform.Status.Build.PublishStrategyOptions[builder.BuildahPlatform]; !found { - platform = "" - t.L.Infof("Attribute platform for buildah not found, default from host will be used!") - } else { - t.L.Infof("User defined %s platform, will be used from buildah!", platform) - } - var executorImage string - if image, found := e.Platform.Status.Build.PublishStrategyOptions[builder.BuildahImage]; found { - executorImage = image - t.L.Infof("User defined executor image %s will be used for buildah", image) - } - pipelineTasks = append(pipelineTasks, v1.Task{Buildah: &v1.BuildahTask{ - Platform: platform, - BaseTask: v1.BaseTask{ - Name: "buildah", - Configuration: *taskConfOrDefault(tasksConf, "buildah"), - }, - PublishTask: v1.PublishTask{ - Image: imageName, - Registry: e.Platform.Status.Build.Registry, - }, - Verbose: t.Verbose, - ExecutorImage: executorImage, - }}) - //nolint: staticcheck,nolintlint - case v1.IntegrationPlatformBuildPublishStrategyKaniko: - t.L.Infof("Warning: Kaniko publishing strategy is deprecated and may be removed in future releases. Use any alternative publishing strategy.") - persistentVolumeClaim := e.Platform.Status.Build.PublishStrategyOptions[builder.KanikoPVCName] - cacheEnabled := e.Platform.Status.Build.IsOptionEnabled(builder.KanikoBuildCacheEnabled) - - var executorImage string - if image, found := e.Platform.Status.Build.PublishStrategyOptions[builder.KanikoExecutorImage]; found { - executorImage = image - t.L.Infof("User defined executor image %s will be used for kaniko", image) - } - - pipelineTasks = append(pipelineTasks, v1.Task{Kaniko: &v1.KanikoTask{ - BaseTask: v1.BaseTask{ - Name: "kaniko", - Configuration: *taskConfOrDefault(tasksConf, "kaniko"), - }, - PublishTask: v1.PublishTask{ - Image: imageName, - Registry: e.Platform.Status.Build.Registry, - }, - Cache: v1.KanikoTaskCache{ - Enabled: &cacheEnabled, - PersistentVolumeClaim: persistentVolumeClaim, - }, - Verbose: t.Verbose, - ExecutorImage: executorImage, - }}) } // filter only those tasks required by the user @@ -618,12 +561,6 @@ func filter(tasks []v1.Task, filterTasks []string) ([]v1.Task, error) { case t.Jib != nil && t.Jib.Name == f: filteredTasks = append(filteredTasks, t) found = true - case t.Buildah != nil && t.Buildah.Name == f: - filteredTasks = append(filteredTasks, t) - found = true - case t.Kaniko != nil && t.Kaniko.Name == f: - filteredTasks = append(filteredTasks, t) - found = true } } @@ -648,10 +585,6 @@ func publishingOrUserTask(t v1.Task) bool { return true case t.Jib != nil: return true - case t.Buildah != nil: - return true - case t.Kaniko != nil: - return true } return false diff --git a/pkg/trait/builder_test.go b/pkg/trait/builder_test.go index 0a8224516..d7e4e87f1 100644 --- a/pkg/trait/builder_test.go +++ b/pkg/trait/builder_test.go @@ -36,7 +36,6 @@ import ( func TestBuilderTraitNotAppliedBecauseOfNilKit(t *testing.T) { environments := []*Environment{ createBuilderTestEnv(v1.IntegrationPlatformClusterOpenShift, v1.IntegrationPlatformBuildPublishStrategyS2I, v1.BuildStrategyRoutine), - createBuilderTestEnv(v1.IntegrationPlatformClusterKubernetes, v1.IntegrationPlatformBuildPublishStrategyKaniko, v1.BuildStrategyRoutine), } for _, e := range environments { @@ -58,7 +57,6 @@ func TestBuilderTraitNotAppliedBecauseOfNilKit(t *testing.T) { func TestBuilderTraitNotAppliedBecauseOfNilPhase(t *testing.T) { environments := []*Environment{ createBuilderTestEnv(v1.IntegrationPlatformClusterOpenShift, v1.IntegrationPlatformBuildPublishStrategyS2I, v1.BuildStrategyRoutine), - createBuilderTestEnv(v1.IntegrationPlatformClusterKubernetes, v1.IntegrationPlatformBuildPublishStrategyKaniko, v1.BuildStrategyRoutine), } for _, e := range environments { @@ -92,21 +90,6 @@ func TestS2IBuilderTrait(t *testing.T) { assert.NotNil(t, env.Pipeline[2].S2i) } -func TestKanikoBuilderTrait(t *testing.T) { - env := createBuilderTestEnv(v1.IntegrationPlatformClusterKubernetes, v1.IntegrationPlatformBuildPublishStrategyKaniko, v1.BuildStrategyRoutine) - conditions, err := NewBuilderTestCatalog().apply(env) - - assert.Nil(t, err) - assert.Empty(t, conditions) - assert.NotEmpty(t, env.ExecutedTraits) - assert.NotNil(t, env.GetTrait("builder")) - assert.NotEmpty(t, env.Pipeline) - assert.Len(t, env.Pipeline, 3) - assert.NotNil(t, env.Pipeline[0].Builder) - assert.NotNil(t, env.Pipeline[1].Package) - assert.NotNil(t, env.Pipeline[2].Kaniko) -} - func createBuilderTestEnv(cluster v1.IntegrationPlatformCluster, strategy v1.IntegrationPlatformBuildPublishStrategy, buildStrategy v1.BuildStrategy) *Environment { c, err := camel.DefaultCatalog() if err != nil { @@ -170,7 +153,7 @@ func NewBuilderTestCatalog() *Catalog { } func TestMavenPropertyBuilderTrait(t *testing.T) { - env := createBuilderTestEnv(v1.IntegrationPlatformClusterKubernetes, v1.IntegrationPlatformBuildPublishStrategyKaniko, v1.BuildStrategyRoutine) + env := createBuilderTestEnv(v1.IntegrationPlatformClusterKubernetes, v1.IntegrationPlatformBuildPublishStrategyS2I, v1.BuildStrategyRoutine) builderTrait := createNominalBuilderTraitTest() builderTrait.Properties = append(builderTrait.Properties, "build-time-prop1=build-time-value1") @@ -256,7 +239,7 @@ func TestCustomTaskBuilderTraitInvalidStrategyOverride(t *testing.T) { } func TestMavenProfilesBuilderTrait(t *testing.T) { - env := createBuilderTestEnv(v1.IntegrationPlatformClusterKubernetes, v1.IntegrationPlatformBuildPublishStrategyKaniko, v1.BuildStrategyRoutine) + env := createBuilderTestEnv(v1.IntegrationPlatformClusterKubernetes, v1.IntegrationPlatformBuildPublishStrategyS2I, v1.BuildStrategyRoutine) builderTrait := createNominalBuilderTraitTest() builderTrait.MavenProfiles = []string{"configmap:maven-profile/owasp-profile.xml", "secret:maven-profile-secret"} @@ -283,7 +266,7 @@ func TestMavenProfilesBuilderTrait(t *testing.T) { } func TestInvalidMavenProfilesBuilderTrait(t *testing.T) { - env := createBuilderTestEnv(v1.IntegrationPlatformClusterKubernetes, v1.IntegrationPlatformBuildPublishStrategyKaniko, v1.BuildStrategyRoutine) + env := createBuilderTestEnv(v1.IntegrationPlatformClusterKubernetes, v1.IntegrationPlatformBuildPublishStrategyS2I, v1.BuildStrategyRoutine) builderTrait := createNominalBuilderTraitTest() builderTrait.MavenProfiles = []string{"fakeprofile"} diff --git a/pkg/util/defaults/defaults.go b/pkg/util/defaults/defaults.go index bbccb6566..d1d6b84a8 100644 --- a/pkg/util/defaults/defaults.go +++ b/pkg/util/defaults/defaults.go @@ -28,12 +28,6 @@ const ( // DefaultRuntimeVersion -- DefaultRuntimeVersion = "3.2.3" - // BuildahVersion -- - BuildahVersion = "1.30.0" - - // KanikoVersion -- - KanikoVersion = "1.9.1" - // baseImage -- baseImage = "eclipse-temurin:17" diff --git a/script/Makefile b/script/Makefile index 817a65d61..e9d67ef14 100644 --- a/script/Makefile +++ b/script/Makefile @@ -24,8 +24,6 @@ VERSION ?= 2.3.0-SNAPSHOT LAST_RELEASED_IMAGE_NAME := camel-k-operator LAST_RELEASED_VERSION ?= 2.2.0 DEFAULT_RUNTIME_VERSION := 3.2.3 -BUILDAH_VERSION := 1.30.0 -KANIKO_VERSION := 1.9.1 CONTROLLER_GEN_VERSION := v0.6.1 CODEGEN_VERSION := v0.27.4 OPERATOR_SDK_VERSION := v1.28.0 @@ -180,12 +178,6 @@ codegen: @echo " // DefaultRuntimeVersion -- " >> $(VERSIONFILE) @echo " DefaultRuntimeVersion = \"$(DEFAULT_RUNTIME_VERSION)\"" >> $(VERSIONFILE) @echo "" >> $(VERSIONFILE) - @echo " // BuildahVersion -- " >> $(VERSIONFILE) - @echo " BuildahVersion = \"$(BUILDAH_VERSION)\"" >> $(VERSIONFILE) - @echo "" >> $(VERSIONFILE) - @echo " // KanikoVersion -- " >> $(VERSIONFILE) - @echo " KanikoVersion = \"$(KANIKO_VERSION)\"" >> $(VERSIONFILE) - @echo "" >> $(VERSIONFILE) @echo " // baseImage -- " >> $(VERSIONFILE) @echo " baseImage = \"$(BASE_IMAGE)\"" >> $(VERSIONFILE) @echo "" >> $(VERSIONFILE) diff --git a/script/update_docs.sh b/script/update_docs.sh index c64fcb540..0439606dc 100755 --- a/script/update_docs.sh +++ b/script/update_docs.sh @@ -40,18 +40,12 @@ else fi KAMELETS_DOCS_VERSION="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.x" fi -BUILDAH_VERSION=$(grep '^BUILDAH_VERSION := ' Makefile | sed 's/^.* \?= //') -KANIKO_VERSION=$(grep '^KANIKO_VERSION := ' Makefile | sed 's/^.* \?= //') KUSTOMIZE_VERSION=$(grep '^KUSTOMIZE_VERSION := ' Makefile | sed 's/^.* \?= //' | sed 's/^.//') echo "Camel K Runtime version: $RUNTIME_VERSION" echo "Kamelets version: $KAMELETS_VERSION" -echo "Buildah version: $BUILDAH_VERSION" -echo "Kaniko version: $KANIKO_VERSION" echo "Kustomize version: $KUSTOMIZE_VERSION" -yq -i ".asciidoc.attributes.buildah-version = \"$BUILDAH_VERSION\"" $location/../docs/antora.yml -yq -i ".asciidoc.attributes.kaniko-version = \"$KANIKO_VERSION\"" $location/../docs/antora.yml yq -i ".asciidoc.attributes.kustomize-version = \"$KUSTOMIZE_VERSION\"" $location/../docs/antora.yml echo "Scraping information from catalog available at: $CATALOG"
