From 59fd4a65cd69183ea1d94bc15908928afd01ae20 Mon Sep 17 00:00:00 2001 From: Pasquale Congiusti Date: Thu, 14 Sep 2023 16:56:05 +0200 Subject: [PATCH] feat(api): deprecate Buildah and Kaniko --- .github/workflows/builder.yml | 2 +- config/crd/bases/camel.apache.org_builds.yaml | 6 ++++-- docs/modules/ROOT/partials/apis/camel-k-crds.adoc | 2 ++ helm/camel-k/crds/crd-build.yaml | 6 ++++-- pkg/apis/camel/v1/build_types.go | 2 ++ pkg/apis/camel/v1/integrationplatform_types.go | 2 ++ pkg/trait/builder.go | 2 ++ 7 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/builder.yml b/.github/workflows/builder.yml index 2f38b31b69..5f3f40f0fe 100644 --- a/.github/workflows/builder.yml +++ b/.github/workflows/builder.yml @@ -74,7 +74,7 @@ jobs: strategy: fail-fast: false matrix: - publisher: ["Buildah", "Spectrum", "Kaniko", "Jib"] + publisher: ["Spectrum", Jib"] 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 f3dca9a574..4bbf89d6bf 100644 --- a/config/crd/bases/camel.apache.org_builds.yaml +++ b/config/crd/bases/camel.apache.org_builds.yaml @@ -142,7 +142,8 @@ spec: task should be configured to represent the specific task chosen. properties: buildah: - description: a BuildahTask, for Buildah strategy + description: 'a BuildahTask, for Buildah strategy Deprecated: + use spectrum, jib or s2i instead' properties: baseImage: description: base image layer @@ -735,7 +736,8 @@ spec: type: object type: object kaniko: - description: a KanikoTask, for Kaniko strategy + description: 'a KanikoTask, for Kaniko strategy Deprecated: + use spectrum, jib or s2i instead' properties: baseImage: description: base image layer diff --git a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc index c5dba1aa09..50e843bf65 100644 --- a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc +++ b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc @@ -5160,6 +5160,7 @@ a BuilderTask, used to generate and package the project a BuildahTask, for Buildah strategy +Deprecated: use spectrum, jib or s2i instead |`kaniko` + *xref:#_camel_apache_org_v1_KanikoTask[KanikoTask]* @@ -5167,6 +5168,7 @@ a BuildahTask, for Buildah strategy a KanikoTask, for Kaniko strategy +Deprecated: use spectrum, jib or s2i instead |`spectrum` + *xref:#_camel_apache_org_v1_SpectrumTask[SpectrumTask]* diff --git a/helm/camel-k/crds/crd-build.yaml b/helm/camel-k/crds/crd-build.yaml index f3dca9a574..4bbf89d6bf 100644 --- a/helm/camel-k/crds/crd-build.yaml +++ b/helm/camel-k/crds/crd-build.yaml @@ -142,7 +142,8 @@ spec: task should be configured to represent the specific task chosen. properties: buildah: - description: a BuildahTask, for Buildah strategy + description: 'a BuildahTask, for Buildah strategy Deprecated: + use spectrum, jib or s2i instead' properties: baseImage: description: base image layer @@ -735,7 +736,8 @@ spec: type: object type: object kaniko: - description: a KanikoTask, for Kaniko strategy + description: 'a KanikoTask, for Kaniko strategy Deprecated: + use spectrum, jib or s2i instead' properties: baseImage: description: base image layer diff --git a/pkg/apis/camel/v1/build_types.go b/pkg/apis/camel/v1/build_types.go index bf9b01207d..0d875ceabe 100644 --- a/pkg/apis/camel/v1/build_types.go +++ b/pkg/apis/camel/v1/build_types.go @@ -60,8 +60,10 @@ type Task struct { // Application Publishing // a BuildahTask, for Buildah strategy + // Deprecated: use spectrum, jib or s2i instead Buildah *BuildahTask `json:"buildah,omitempty"` // a KanikoTask, for Kaniko strategy + // Deprecated: use spectrum, jib or s2i instead Kaniko *KanikoTask `json:"kaniko,omitempty"` // a SpectrumTask, for Spectrum strategy Spectrum *SpectrumTask `json:"spectrum,omitempty"` diff --git a/pkg/apis/camel/v1/integrationplatform_types.go b/pkg/apis/camel/v1/integrationplatform_types.go index 2f0fc9ccb1..dd4b3b72d4 100644 --- a/pkg/apis/camel/v1/integrationplatform_types.go +++ b/pkg/apis/camel/v1/integrationplatform_types.go @@ -154,9 +154,11 @@ 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) diff --git a/pkg/trait/builder.go b/pkg/trait/builder.go index 9d878661f2..3e9a8c00ff 100644 --- a/pkg/trait/builder.go +++ b/pkg/trait/builder.go @@ -142,6 +142,7 @@ func (t *builderTrait) Apply(e *Environment) error { }}) 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 { @@ -169,6 +170,7 @@ func (t *builderTrait) Apply(e *Environment) error { }}) //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)