Skip to content

Commit

Permalink
feat(trait): Spectrum deprecation notice
Browse files Browse the repository at this point in the history
  • Loading branch information
squakez authored and gansheer committed Apr 12, 2024
1 parent 1da9032 commit 748354b
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
strategy:
fail-fast: false
matrix:
publisher: ["Jib", "Spectrum"]
publisher: ["Jib"]

steps:
- name: Checkout code
Expand Down
8 changes: 6 additions & 2 deletions docs/modules/ROOT/partials/apis/camel-k-crds.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,7 @@ will take care of producing the expected Camel/Camel-Quarkus runtime.
* <<#_camel_apache_org_v1_Task, Task>>
BuildahTask is used to configure Buildah.
Deprecated: no longer in use.
[cols="2,2a",options="header"]
|===
Expand Down Expand Up @@ -4181,6 +4182,7 @@ Properties --
* <<#_camel_apache_org_v1_Task, Task>>
KanikoTask is used to configure Kaniko.
Deprecated: no longer in use.
[cols="2,2a",options="header"]
|===
Expand Down Expand Up @@ -4233,6 +4235,7 @@ docker image to use
* <<#_camel_apache_org_v1_KanikoTask, KanikoTask>>
KanikoTaskCache is used to configure Kaniko cache.
Deprecated: no longer in use.
[cols="2,2a",options="header"]
|===
Expand Down Expand Up @@ -5589,22 +5592,23 @@ a PackageTask, used to package the project
a BuildahTask, for Buildah strategy
Deprecated: use spectrum, jib, s2i or a custom publishing strategy instead
Deprecated: use jib, s2i or a custom publishing strategy instead
|`kaniko` +
*xref:#_camel_apache_org_v1_KanikoTask[KanikoTask]*
|
a KanikoTask, for Kaniko strategy
Deprecated: use spectrum, jib, s2i or a custom publishing strategy instead
Deprecated: use jib, s2i or a custom publishing strategy instead
|`spectrum` +
*xref:#_camel_apache_org_v1_SpectrumTask[SpectrumTask]*
|
a SpectrumTask, for Spectrum strategy
Deprecated: use jib, s2i or a custom publishing strategy instead
|`s2i` +
*xref:#_camel_apache_org_v1_S2iTask[S2iTask]*
Expand Down
7 changes: 4 additions & 3 deletions helm/camel-k/crds/crd-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ spec:
properties:
buildah:
description: 'a BuildahTask, for Buildah strategy Deprecated:
use spectrum, jib, s2i or a custom publishing strategy instead'
use jib, s2i or a custom publishing strategy instead'
properties:
baseImage:
description: base image layer
Expand Down Expand Up @@ -1027,7 +1027,7 @@ spec:
type: object
kaniko:
description: 'a KanikoTask, for Kaniko strategy Deprecated:
use spectrum, jib, s2i or a custom publishing strategy instead'
use jib, s2i or a custom publishing strategy instead'
properties:
baseImage:
description: base image layer
Expand Down Expand Up @@ -1789,7 +1789,8 @@ spec:
type: string
type: object
spectrum:
description: a SpectrumTask, for Spectrum strategy
description: 'a SpectrumTask, for Spectrum strategy Deprecated:
use jib, s2i or a custom publishing strategy instead'
properties:
baseImage:
description: base image layer
Expand Down
8 changes: 6 additions & 2 deletions pkg/apis/camel/v1/build_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,13 @@ type Task struct {
// Application Publishing

// a BuildahTask, for Buildah strategy
// Deprecated: use spectrum, jib, s2i or a custom publishing strategy instead
// Deprecated: use jib, s2i or a custom publishing strategy instead
Buildah *BuildahTask `json:"buildah,omitempty"`
// a KanikoTask, for Kaniko strategy
// Deprecated: use spectrum, jib, s2i or a custom publishing strategy instead
// Deprecated: use jib, s2i or a custom publishing strategy instead
Kaniko *KanikoTask `json:"kaniko,omitempty"`
// a SpectrumTask, for Spectrum strategy
// Deprecated: use jib, s2i or a custom publishing strategy instead
Spectrum *SpectrumTask `json:"spectrum,omitempty"`
// a S2iTask, for S2I strategy
S2i *S2iTask `json:"s2i,omitempty"`
Expand Down Expand Up @@ -130,6 +131,7 @@ type PublishTask struct {
}

// BuildahTask is used to configure Buildah.
// Deprecated: no longer in use.
type BuildahTask struct {
BaseTask `json:",inline"`
PublishTask `json:",inline"`
Expand All @@ -142,6 +144,7 @@ type BuildahTask struct {
}

// KanikoTask is used to configure Kaniko.
// Deprecated: no longer in use.
type KanikoTask struct {
BaseTask `json:",inline"`
PublishTask `json:",inline"`
Expand All @@ -154,6 +157,7 @@ type KanikoTask struct {
}

// KanikoTaskCache is used to configure Kaniko cache.
// Deprecated: no longer in use.
type KanikoTaskCache struct {
// true if a cache is enabled
Enabled *bool `json:"enabled,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/camel/v1/integrationplatform_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ const (
IntegrationPlatformBuildPublishStrategyS2I IntegrationPlatformBuildPublishStrategy = "S2I"
// IntegrationPlatformBuildPublishStrategySpectrum uses Spectrum project (https://github.com/container-tools/spectrum)
// in order to push the incremental images to the image repository. It is the default choice on vanilla Kubernetes cluster.
// Deprecated: use jib, s2i or a custom publishing strategy instead.
IntegrationPlatformBuildPublishStrategySpectrum IntegrationPlatformBuildPublishStrategy = "Spectrum"
// IntegrationPlatformBuildPublishStrategyJib uses Jib maven plugin (https://github.com/GoogleContainerTools/jib)
// in order to push the incremental images to the image repository.
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/camel/v1/trait/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type BuilderTrait struct {
// A list of tasks to be executed (available only when using `pod` strategy) with format `<name>;<container-image>;<container-command>`.
Tasks []string `property:"tasks" json:"tasks,omitempty"`
// A list of tasks sorted by the order of execution in a csv format, ie, `<taskName1>,<taskName2>,...`.
// Mind that you must include also the operator tasks (`builder`, `quarkus-native`, `package`, `jib`, `spectrum`, `s2i`)
// Mind that you must include also the operator tasks (`builder`, `quarkus-native`, `package`, `jib`, `s2i`)
// if you need to execute them. Useful only with `pod` strategy.
TasksFilter string `property:"tasks-filter" json:"tasksFilter,omitempty"`
// A list of request cpu configuration for the specific task with format `<task-name>:<request-cpu-conf>`.
Expand Down
7 changes: 4 additions & 3 deletions pkg/resources/config/crd/bases/camel.apache.org_builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ spec:
properties:
buildah:
description: 'a BuildahTask, for Buildah strategy Deprecated:
use spectrum, jib, s2i or a custom publishing strategy instead'
use jib, s2i or a custom publishing strategy instead'
properties:
baseImage:
description: base image layer
Expand Down Expand Up @@ -1027,7 +1027,7 @@ spec:
type: object
kaniko:
description: 'a KanikoTask, for Kaniko strategy Deprecated:
use spectrum, jib, s2i or a custom publishing strategy instead'
use jib, s2i or a custom publishing strategy instead'
properties:
baseImage:
description: base image layer
Expand Down Expand Up @@ -1789,7 +1789,8 @@ spec:
type: string
type: object
spectrum:
description: a SpectrumTask, for Spectrum strategy
description: 'a SpectrumTask, for Spectrum strategy Deprecated:
use jib, s2i or a custom publishing strategy instead'
properties:
baseImage:
description: base image layer
Expand Down
3 changes: 3 additions & 0 deletions pkg/trait/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ func (t *builderTrait) Configure(e *Environment) (bool, *TraitCondition, error)
}

condition := t.adaptDeprecatedFields()
if e.Platform.Status.Build.PublishStrategy == v1.IntegrationPlatformBuildPublishStrategySpectrum {
condition = newOrAppend(condition, "Spectrum publishing strategy is deprecated and may be removed in future releases. Make sure to use any supported publishing strategy instead.")
}

if e.IntegrationKitInPhase(v1.IntegrationKitPhaseBuildSubmitted) {
if trait := e.Catalog.GetTrait(quarkusTraitID); trait != nil {
Expand Down

0 comments on commit 748354b

Please sign in to comment.