This is an automated email from the ASF dual-hosted git repository. squakez pushed a commit to branch release-2.10.x in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 047e359168c473d88cd3f3f848904255451d284f Author: Pasquale Congiusti <[email protected]> AuthorDate: Thu Aug 27 08:28:52 2026 +0200 chore(trait): drop maven profile It was already deprecated --- docs/modules/ROOT/partials/apis/camel-k-crds.adoc | 8 +-- docs/modules/traits/pages/builder.adoc | 5 +- helm/camel-k/crds/camel-k-crds.yaml | 78 +++++----------------- pkg/apis/camel/v1/maven_types.go | 5 +- pkg/apis/camel/v1/trait/builder.go | 7 +- pkg/apis/camel/v1/trait/zz_generated.deepcopy.go | 4 +- pkg/apis/camel/v1/zz_generated.deepcopy.go | 4 +- pkg/builder/project.go | 24 ------- .../applyconfiguration/camel/v1/mavenbuildspec.go | 10 +-- .../camel/applyconfiguration/camel/v1/mavenspec.go | 15 ++--- .../config/crd/bases/camel.apache.org_builds.yaml | 8 +-- .../bases/camel.apache.org_integrationkits.yaml | 6 +- .../camel.apache.org_integrationplatforms.yaml | 20 ++---- .../camel.apache.org_integrationprofiles.yaml | 20 ++---- .../crd/bases/camel.apache.org_integrations.yaml | 12 +--- .../config/crd/bases/camel.apache.org_pipes.yaml | 12 +--- pkg/trait/builder.go | 15 ----- pkg/trait/builder_test.go | 41 ------------ 18 files changed, 53 insertions(+), 241 deletions(-) diff --git a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc index 6e6386ccd..052129525 100644 --- a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc +++ b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc @@ -4616,8 +4616,7 @@ The Maven properties. | -A reference to the ConfigMap or Secret key that contains -the Maven profile. +Deprecated: no longer in use. |`settings` + *xref:#_camel_apache_org_v1_ValueSource[ValueSource]* @@ -6624,10 +6623,7 @@ Deprecated: use TasksRequestCPU instead with task name `builder`. | -A list of references pointing to configmaps/secrets that contains a maven profile. -This configmap/secret is a resource of the IntegrationKit created, therefore it needs to be present in the namespace where the operator is going to create the IntegrationKit. -The content of the maven profile is expected to be a text containing a valid maven profile starting with `<profile>` and ending with `</profile>` that will be integrated as an inline profile in the POM. -Syntax: [configmap{vbar}secret]:name[/key], where name represents the resource name, key optionally represents the resource key to be filtered (default key value = profile.xml). +Deprecated: no longer in use. |`tasks` + []string diff --git a/docs/modules/traits/pages/builder.adoc b/docs/modules/traits/pages/builder.adoc index 9cb46d3fe..c1c48db16 100755 --- a/docs/modules/traits/pages/builder.adoc +++ b/docs/modules/traits/pages/builder.adoc @@ -83,10 +83,7 @@ Deprecated: use TasksRequestCPU instead with task name `builder`. | builder.maven-profiles | []string -| A list of references pointing to configmaps/secrets that contains a maven profile. -This configmap/secret is a resource of the IntegrationKit created, therefore it needs to be present in the namespace where the operator is going to create the IntegrationKit. -The content of the maven profile is expected to be a text containing a valid maven profile starting with `<profile>` and ending with `</profile>` that will be integrated as an inline profile in the POM. -Syntax: [configmap\|secret]:name[/key], where name represents the resource name, key optionally represents the resource key to be filtered (default key value = profile.xml). +| Deprecated: no longer in use. | builder.tasks | []string diff --git a/helm/camel-k/crds/camel-k-crds.yaml b/helm/camel-k/crds/camel-k-crds.yaml index e6904ba3d..2a8ec50b0 100644 --- a/helm/camel-k/crds/camel-k-crds.yaml +++ b/helm/camel-k/crds/camel-k-crds.yaml @@ -456,9 +456,7 @@ spec: description: The path of the local Maven repository. type: string profiles: - description: |- - A reference to the ConfigMap or Secret key that contains - the Maven profile. + description: 'Deprecated: no longer in use.' items: description: ValueSource --. properties: @@ -1390,9 +1388,7 @@ spec: description: The path of the local Maven repository. type: string profiles: - description: |- - A reference to the ConfigMap or Secret key that contains - the Maven profile. + description: 'Deprecated: no longer in use.' items: description: ValueSource --. properties: @@ -2960,11 +2956,7 @@ spec: Deprecated: use TasksRequestCPU instead with task name `builder`. type: string mavenProfiles: - description: |- - A list of references pointing to configmaps/secrets that contains a maven profile. - This configmap/secret is a resource of the IntegrationKit created, therefore it needs to be present in the namespace where the operator is going to create the IntegrationKit. - The content of the maven profile is expected to be a text containing a valid maven profile starting with `<profile>` and ending with `</profile>` that will be integrated as an inline profile in the POM. - Syntax: [configmap|secret]:name[/key], where name represents the resource name, key optionally represents the resource key to be filtered (default key value = profile.xml). + description: 'Deprecated: no longer in use.' items: type: string type: array @@ -3541,9 +3533,7 @@ spec: description: The path of the local Maven repository. type: string profiles: - description: |- - A reference to the ConfigMap or Secret key that contains - the Maven profile. + description: 'Deprecated: no longer in use.' items: description: ValueSource --. properties: @@ -3912,11 +3902,7 @@ spec: Deprecated: use TasksRequestCPU instead with task name `builder`. type: string mavenProfiles: - description: |- - A list of references pointing to configmaps/secrets that contains a maven profile. - This configmap/secret is a resource of the IntegrationKit created, therefore it needs to be present in the namespace where the operator is going to create the IntegrationKit. - The content of the maven profile is expected to be a text containing a valid maven profile starting with `<profile>` and ending with `</profile>` that will be integrated as an inline profile in the POM. - Syntax: [configmap|secret]:name[/key], where name represents the resource name, key optionally represents the resource key to be filtered (default key value = profile.xml). + description: 'Deprecated: no longer in use.' items: type: string type: array @@ -6020,9 +6006,7 @@ spec: description: The path of the local Maven repository. type: string profiles: - description: |- - A reference to the ConfigMap or Secret key that contains - the Maven profile. + description: 'Deprecated: no longer in use.' items: description: ValueSource --. properties: @@ -6439,11 +6423,7 @@ spec: Deprecated: use TasksRequestCPU instead with task name `builder`. type: string mavenProfiles: - description: |- - A list of references pointing to configmaps/secrets that contains a maven profile. - This configmap/secret is a resource of the IntegrationKit created, therefore it needs to be present in the namespace where the operator is going to create the IntegrationKit. - The content of the maven profile is expected to be a text containing a valid maven profile starting with `<profile>` and ending with `</profile>` that will be integrated as an inline profile in the POM. - Syntax: [configmap|secret]:name[/key], where name represents the resource name, key optionally represents the resource key to be filtered (default key value = profile.xml). + description: 'Deprecated: no longer in use.' items: type: string type: array @@ -8531,9 +8511,7 @@ spec: description: The path of the local Maven repository. type: string profiles: - description: |- - A reference to the ConfigMap or Secret key that contains - the Maven profile. + description: 'Deprecated: no longer in use.' items: description: ValueSource --. properties: @@ -8862,11 +8840,7 @@ spec: Deprecated: use TasksRequestCPU instead with task name `builder`. type: string mavenProfiles: - description: |- - A list of references pointing to configmaps/secrets that contains a maven profile. - This configmap/secret is a resource of the IntegrationKit created, therefore it needs to be present in the namespace where the operator is going to create the IntegrationKit. - The content of the maven profile is expected to be a text containing a valid maven profile starting with `<profile>` and ending with `</profile>` that will be integrated as an inline profile in the POM. - Syntax: [configmap|secret]:name[/key], where name represents the resource name, key optionally represents the resource key to be filtered (default key value = profile.xml). + description: 'Deprecated: no longer in use.' items: type: string type: array @@ -10898,9 +10872,7 @@ spec: description: The path of the local Maven repository. type: string profiles: - description: |- - A reference to the ConfigMap or Secret key that contains - the Maven profile. + description: 'Deprecated: no longer in use.' items: description: ValueSource --. properties: @@ -11271,11 +11243,7 @@ spec: Deprecated: use TasksRequestCPU instead with task name `builder`. type: string mavenProfiles: - description: |- - A list of references pointing to configmaps/secrets that contains a maven profile. - This configmap/secret is a resource of the IntegrationKit created, therefore it needs to be present in the namespace where the operator is going to create the IntegrationKit. - The content of the maven profile is expected to be a text containing a valid maven profile starting with `<profile>` and ending with `</profile>` that will be integrated as an inline profile in the POM. - Syntax: [configmap|secret]:name[/key], where name represents the resource name, key optionally represents the resource key to be filtered (default key value = profile.xml). + description: 'Deprecated: no longer in use.' items: type: string type: array @@ -20535,11 +20503,7 @@ spec: Deprecated: use TasksRequestCPU instead with task name `builder`. type: string mavenProfiles: - description: |- - A list of references pointing to configmaps/secrets that contains a maven profile. - This configmap/secret is a resource of the IntegrationKit created, therefore it needs to be present in the namespace where the operator is going to create the IntegrationKit. - The content of the maven profile is expected to be a text containing a valid maven profile starting with `<profile>` and ending with `</profile>` that will be integrated as an inline profile in the POM. - Syntax: [configmap|secret]:name[/key], where name represents the resource name, key optionally represents the resource key to be filtered (default key value = profile.xml). + description: 'Deprecated: no longer in use.' items: type: string type: array @@ -22898,11 +22862,7 @@ spec: Deprecated: use TasksRequestCPU instead with task name `builder`. type: string mavenProfiles: - description: |- - A list of references pointing to configmaps/secrets that contains a maven profile. - This configmap/secret is a resource of the IntegrationKit created, therefore it needs to be present in the namespace where the operator is going to create the IntegrationKit. - The content of the maven profile is expected to be a text containing a valid maven profile starting with `<profile>` and ending with `</profile>` that will be integrated as an inline profile in the POM. - Syntax: [configmap|secret]:name[/key], where name represents the resource name, key optionally represents the resource key to be filtered (default key value = profile.xml). + description: 'Deprecated: no longer in use.' items: type: string type: array @@ -33522,11 +33482,7 @@ spec: Deprecated: use TasksRequestCPU instead with task name `builder`. type: string mavenProfiles: - description: |- - A list of references pointing to configmaps/secrets that contains a maven profile. - This configmap/secret is a resource of the IntegrationKit created, therefore it needs to be present in the namespace where the operator is going to create the IntegrationKit. - The content of the maven profile is expected to be a text containing a valid maven profile starting with `<profile>` and ending with `</profile>` that will be integrated as an inline profile in the POM. - Syntax: [configmap|secret]:name[/key], where name represents the resource name, key optionally represents the resource key to be filtered (default key value = profile.xml). + description: 'Deprecated: no longer in use.' items: type: string type: array @@ -35815,11 +35771,7 @@ spec: Deprecated: use TasksRequestCPU instead with task name `builder`. type: string mavenProfiles: - description: |- - A list of references pointing to configmaps/secrets that contains a maven profile. - This configmap/secret is a resource of the IntegrationKit created, therefore it needs to be present in the namespace where the operator is going to create the IntegrationKit. - The content of the maven profile is expected to be a text containing a valid maven profile starting with `<profile>` and ending with `</profile>` that will be integrated as an inline profile in the POM. - Syntax: [configmap|secret]:name[/key], where name represents the resource name, key optionally represents the resource key to be filtered (default key value = profile.xml). + description: 'Deprecated: no longer in use.' items: type: string type: array diff --git a/pkg/apis/camel/v1/maven_types.go b/pkg/apis/camel/v1/maven_types.go index 5cd269a7e..dcf997af3 100644 --- a/pkg/apis/camel/v1/maven_types.go +++ b/pkg/apis/camel/v1/maven_types.go @@ -29,9 +29,8 @@ type MavenSpec struct { LocalRepository string `json:"localRepository,omitempty"` // The Maven properties. Properties map[string]string `json:"properties,omitempty"` - // A reference to the ConfigMap or Secret key that contains - // the Maven profile. - Profiles []ValueSource `json:"profiles,omitempty"` + // Deprecated: no longer in use. + DeprecatedProfiles []ValueSource `json:"profiles,omitempty"` // A reference to the ConfigMap or Secret key that contains // the Maven settings. Settings ValueSource `json:"settings,omitempty"` diff --git a/pkg/apis/camel/v1/trait/builder.go b/pkg/apis/camel/v1/trait/builder.go index aaf2723f9..5d12e411c 100644 --- a/pkg/apis/camel/v1/trait/builder.go +++ b/pkg/apis/camel/v1/trait/builder.go @@ -59,11 +59,8 @@ type BuilderTrait struct { // // Deprecated: use TasksRequestCPU instead with task name `builder`. LimitMemory string `json:"limitMemory,omitempty" property:"limit-memory"` - // A list of references pointing to configmaps/secrets that contains a maven profile. - // This configmap/secret is a resource of the IntegrationKit created, therefore it needs to be present in the namespace where the operator is going to create the IntegrationKit. - // The content of the maven profile is expected to be a text containing a valid maven profile starting with `<profile>` and ending with `</profile>` that will be integrated as an inline profile in the POM. - // Syntax: [configmap|secret]:name[/key], where name represents the resource name, key optionally represents the resource key to be filtered (default key value = profile.xml). - MavenProfiles []string `json:"mavenProfiles,omitempty" property:"maven-profiles"` + // Deprecated: no longer in use. + DeprecatedMavenProfiles []string `json:"mavenProfiles,omitempty" property:"maven-profiles"` // A list of tasks to be executed (available only when using `pod` strategy) with format `<name>;<container-image>;<container-command>`. Tasks []string `json:"tasks,omitempty" property:"tasks"` // A list of tasks sorted by the order of execution in a csv format, ie, `<taskName1>,<taskName2>,...`. diff --git a/pkg/apis/camel/v1/trait/zz_generated.deepcopy.go b/pkg/apis/camel/v1/trait/zz_generated.deepcopy.go index 7fc4e10bc..87c608088 100644 --- a/pkg/apis/camel/v1/trait/zz_generated.deepcopy.go +++ b/pkg/apis/camel/v1/trait/zz_generated.deepcopy.go @@ -85,8 +85,8 @@ func (in *BuilderTrait) DeepCopyInto(out *BuilderTrait) { *out = new(bool) **out = **in } - if in.MavenProfiles != nil { - in, out := &in.MavenProfiles, &out.MavenProfiles + if in.DeprecatedMavenProfiles != nil { + in, out := &in.DeprecatedMavenProfiles, &out.DeprecatedMavenProfiles *out = make([]string, len(*in)) copy(*out, *in) } diff --git a/pkg/apis/camel/v1/zz_generated.deepcopy.go b/pkg/apis/camel/v1/zz_generated.deepcopy.go index 2d3e8c2a7..82f03d4d7 100644 --- a/pkg/apis/camel/v1/zz_generated.deepcopy.go +++ b/pkg/apis/camel/v1/zz_generated.deepcopy.go @@ -2395,8 +2395,8 @@ func (in *MavenSpec) DeepCopyInto(out *MavenSpec) { (*out)[key] = val } } - if in.Profiles != nil { - in, out := &in.Profiles, &out.Profiles + if in.DeprecatedProfiles != nil { + in, out := &in.DeprecatedProfiles, &out.DeprecatedProfiles *out = make([]ValueSource, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) diff --git a/pkg/builder/project.go b/pkg/builder/project.go index 39fb5430b..95374b07e 100644 --- a/pkg/builder/project.go +++ b/pkg/builder/project.go @@ -20,7 +20,6 @@ package builder import ( "bytes" "encoding/xml" - "fmt" "os" "regexp" "strings" @@ -44,7 +43,6 @@ func init() { Project.GenerateProjectSettings, Project.InjectDependencies, Project.SanitizeDependencies, - Project.InjectProfiles, } } @@ -54,7 +52,6 @@ type projectSteps struct { GenerateProjectSettings Step InjectDependencies Step SanitizeDependencies Step - InjectProfiles Step CommonSteps []Step } @@ -66,7 +63,6 @@ var Project = projectSteps{ GenerateProjectSettings: NewStep(ProjectGenerationPhase+1, generateProjectSettings), InjectDependencies: NewStep(ProjectGenerationPhase+2, injectDependencies), SanitizeDependencies: NewStep(ProjectGenerationPhase+3, sanitizeDependencies), - InjectProfiles: NewStep(ProjectGenerationPhase+4, injectProfiles), } func cleanUpBuildDir(ctx *builderContext) error { @@ -204,23 +200,3 @@ func injectDependencies(ctx *builderContext) error { func sanitizeDependencies(ctx *builderContext) error { return camel.SanitizeIntegrationDependencies(ctx.Maven.Project.Dependencies) } - -func injectProfiles(ctx *builderContext) error { - if ctx.Build.Maven.Profiles != nil { - for _, p := range ctx.Build.Maven.Profiles { - val, err := kubernetes.ResolveValueSource(ctx.C, ctx.Client, ctx.Namespace, &p) - if err != nil { - return fmt.Errorf("could not load profile : %s: %w. ", p.String(), err) - } - if val != "" { - profile := maven.Profile{} - if err := xml.Unmarshal([]byte(val), &profile); err != nil { - return err - } - ctx.Maven.Project.AddProfile(profile) - } - } - } - - return nil -} diff --git a/pkg/client/camel/applyconfiguration/camel/v1/mavenbuildspec.go b/pkg/client/camel/applyconfiguration/camel/v1/mavenbuildspec.go index f9532c274..e98b43b8a 100644 --- a/pkg/client/camel/applyconfiguration/camel/v1/mavenbuildspec.go +++ b/pkg/client/camel/applyconfiguration/camel/v1/mavenbuildspec.go @@ -64,15 +64,15 @@ func (b *MavenBuildSpecApplyConfiguration) WithProperties(entries map[string]str return b } -// WithProfiles adds the given value to the Profiles field in the declarative configuration +// WithDeprecatedProfiles adds the given value to the DeprecatedProfiles field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Profiles field. -func (b *MavenBuildSpecApplyConfiguration) WithProfiles(values ...*ValueSourceApplyConfiguration) *MavenBuildSpecApplyConfiguration { +// If called multiple times, values provided by each call will be appended to the DeprecatedProfiles field. +func (b *MavenBuildSpecApplyConfiguration) WithDeprecatedProfiles(values ...*ValueSourceApplyConfiguration) *MavenBuildSpecApplyConfiguration { for i := range values { if values[i] == nil { - panic("nil value passed to WithProfiles") + panic("nil value passed to WithDeprecatedProfiles") } - b.MavenSpecApplyConfiguration.Profiles = append(b.MavenSpecApplyConfiguration.Profiles, *values[i]) + b.MavenSpecApplyConfiguration.DeprecatedProfiles = append(b.MavenSpecApplyConfiguration.DeprecatedProfiles, *values[i]) } return b } diff --git a/pkg/client/camel/applyconfiguration/camel/v1/mavenspec.go b/pkg/client/camel/applyconfiguration/camel/v1/mavenspec.go index 3a9e987ce..3e91882fa 100644 --- a/pkg/client/camel/applyconfiguration/camel/v1/mavenspec.go +++ b/pkg/client/camel/applyconfiguration/camel/v1/mavenspec.go @@ -32,9 +32,8 @@ type MavenSpecApplyConfiguration struct { LocalRepository *string `json:"localRepository,omitempty"` // The Maven properties. Properties map[string]string `json:"properties,omitempty"` - // A reference to the ConfigMap or Secret key that contains - // the Maven profile. - Profiles []ValueSourceApplyConfiguration `json:"profiles,omitempty"` + // Deprecated: no longer in use. + DeprecatedProfiles []ValueSourceApplyConfiguration `json:"profiles,omitempty"` // A reference to the ConfigMap or Secret key that contains // the Maven settings. Settings *ValueSourceApplyConfiguration `json:"settings,omitempty"` @@ -85,15 +84,15 @@ func (b *MavenSpecApplyConfiguration) WithProperties(entries map[string]string) return b } -// WithProfiles adds the given value to the Profiles field in the declarative configuration +// WithDeprecatedProfiles adds the given value to the DeprecatedProfiles field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Profiles field. -func (b *MavenSpecApplyConfiguration) WithProfiles(values ...*ValueSourceApplyConfiguration) *MavenSpecApplyConfiguration { +// If called multiple times, values provided by each call will be appended to the DeprecatedProfiles field. +func (b *MavenSpecApplyConfiguration) WithDeprecatedProfiles(values ...*ValueSourceApplyConfiguration) *MavenSpecApplyConfiguration { for i := range values { if values[i] == nil { - panic("nil value passed to WithProfiles") + panic("nil value passed to WithDeprecatedProfiles") } - b.Profiles = append(b.Profiles, *values[i]) + b.DeprecatedProfiles = append(b.DeprecatedProfiles, *values[i]) } return b } diff --git a/pkg/resources/config/crd/bases/camel.apache.org_builds.yaml b/pkg/resources/config/crd/bases/camel.apache.org_builds.yaml index f3f49eda9..3ebb7733e 100644 --- a/pkg/resources/config/crd/bases/camel.apache.org_builds.yaml +++ b/pkg/resources/config/crd/bases/camel.apache.org_builds.yaml @@ -456,9 +456,7 @@ spec: description: The path of the local Maven repository. type: string profiles: - description: |- - A reference to the ConfigMap or Secret key that contains - the Maven profile. + description: 'Deprecated: no longer in use.' items: description: ValueSource --. properties: @@ -1390,9 +1388,7 @@ spec: description: The path of the local Maven repository. type: string profiles: - description: |- - A reference to the ConfigMap or Secret key that contains - the Maven profile. + description: 'Deprecated: no longer in use.' items: description: ValueSource --. properties: diff --git a/pkg/resources/config/crd/bases/camel.apache.org_integrationkits.yaml b/pkg/resources/config/crd/bases/camel.apache.org_integrationkits.yaml index 1bf4da1d3..004fb9534 100644 --- a/pkg/resources/config/crd/bases/camel.apache.org_integrationkits.yaml +++ b/pkg/resources/config/crd/bases/camel.apache.org_integrationkits.yaml @@ -254,11 +254,7 @@ spec: Deprecated: use TasksRequestCPU instead with task name `builder`. type: string mavenProfiles: - description: |- - A list of references pointing to configmaps/secrets that contains a maven profile. - This configmap/secret is a resource of the IntegrationKit created, therefore it needs to be present in the namespace where the operator is going to create the IntegrationKit. - The content of the maven profile is expected to be a text containing a valid maven profile starting with `<profile>` and ending with `</profile>` that will be integrated as an inline profile in the POM. - Syntax: [configmap|secret]:name[/key], where name represents the resource name, key optionally represents the resource key to be filtered (default key value = profile.xml). + description: 'Deprecated: no longer in use.' items: type: string type: array diff --git a/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml b/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml index 103226d89..0c7bcc941 100644 --- a/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml +++ b/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml @@ -247,9 +247,7 @@ spec: description: The path of the local Maven repository. type: string profiles: - description: |- - A reference to the ConfigMap or Secret key that contains - the Maven profile. + description: 'Deprecated: no longer in use.' items: description: ValueSource --. properties: @@ -618,11 +616,7 @@ spec: Deprecated: use TasksRequestCPU instead with task name `builder`. type: string mavenProfiles: - description: |- - A list of references pointing to configmaps/secrets that contains a maven profile. - This configmap/secret is a resource of the IntegrationKit created, therefore it needs to be present in the namespace where the operator is going to create the IntegrationKit. - The content of the maven profile is expected to be a text containing a valid maven profile starting with `<profile>` and ending with `</profile>` that will be integrated as an inline profile in the POM. - Syntax: [configmap|secret]:name[/key], where name represents the resource name, key optionally represents the resource key to be filtered (default key value = profile.xml). + description: 'Deprecated: no longer in use.' items: type: string type: array @@ -2726,9 +2720,7 @@ spec: description: The path of the local Maven repository. type: string profiles: - description: |- - A reference to the ConfigMap or Secret key that contains - the Maven profile. + description: 'Deprecated: no longer in use.' items: description: ValueSource --. properties: @@ -3145,11 +3137,7 @@ spec: Deprecated: use TasksRequestCPU instead with task name `builder`. type: string mavenProfiles: - description: |- - A list of references pointing to configmaps/secrets that contains a maven profile. - This configmap/secret is a resource of the IntegrationKit created, therefore it needs to be present in the namespace where the operator is going to create the IntegrationKit. - The content of the maven profile is expected to be a text containing a valid maven profile starting with `<profile>` and ending with `</profile>` that will be integrated as an inline profile in the POM. - Syntax: [configmap|secret]:name[/key], where name represents the resource name, key optionally represents the resource key to be filtered (default key value = profile.xml). + description: 'Deprecated: no longer in use.' items: type: string type: array diff --git a/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml b/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml index 2cac857c9..719e6efca 100644 --- a/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml +++ b/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml @@ -149,9 +149,7 @@ spec: description: The path of the local Maven repository. type: string profiles: - description: |- - A reference to the ConfigMap or Secret key that contains - the Maven profile. + description: 'Deprecated: no longer in use.' items: description: ValueSource --. properties: @@ -480,11 +478,7 @@ spec: Deprecated: use TasksRequestCPU instead with task name `builder`. type: string mavenProfiles: - description: |- - A list of references pointing to configmaps/secrets that contains a maven profile. - This configmap/secret is a resource of the IntegrationKit created, therefore it needs to be present in the namespace where the operator is going to create the IntegrationKit. - The content of the maven profile is expected to be a text containing a valid maven profile starting with `<profile>` and ending with `</profile>` that will be integrated as an inline profile in the POM. - Syntax: [configmap|secret]:name[/key], where name represents the resource name, key optionally represents the resource key to be filtered (default key value = profile.xml). + description: 'Deprecated: no longer in use.' items: type: string type: array @@ -2516,9 +2510,7 @@ spec: description: The path of the local Maven repository. type: string profiles: - description: |- - A reference to the ConfigMap or Secret key that contains - the Maven profile. + description: 'Deprecated: no longer in use.' items: description: ValueSource --. properties: @@ -2889,11 +2881,7 @@ spec: Deprecated: use TasksRequestCPU instead with task name `builder`. type: string mavenProfiles: - description: |- - A list of references pointing to configmaps/secrets that contains a maven profile. - This configmap/secret is a resource of the IntegrationKit created, therefore it needs to be present in the namespace where the operator is going to create the IntegrationKit. - The content of the maven profile is expected to be a text containing a valid maven profile starting with `<profile>` and ending with `</profile>` that will be integrated as an inline profile in the POM. - Syntax: [configmap|secret]:name[/key], where name represents the resource name, key optionally represents the resource key to be filtered (default key value = profile.xml). + description: 'Deprecated: no longer in use.' items: type: string type: array diff --git a/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml b/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml index 62508f0e9..4f62f0ec9 100644 --- a/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml +++ b/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml @@ -7324,11 +7324,7 @@ spec: Deprecated: use TasksRequestCPU instead with task name `builder`. type: string mavenProfiles: - description: |- - A list of references pointing to configmaps/secrets that contains a maven profile. - This configmap/secret is a resource of the IntegrationKit created, therefore it needs to be present in the namespace where the operator is going to create the IntegrationKit. - The content of the maven profile is expected to be a text containing a valid maven profile starting with `<profile>` and ending with `</profile>` that will be integrated as an inline profile in the POM. - Syntax: [configmap|secret]:name[/key], where name represents the resource name, key optionally represents the resource key to be filtered (default key value = profile.xml). + description: 'Deprecated: no longer in use.' items: type: string type: array @@ -9687,11 +9683,7 @@ spec: Deprecated: use TasksRequestCPU instead with task name `builder`. type: string mavenProfiles: - description: |- - A list of references pointing to configmaps/secrets that contains a maven profile. - This configmap/secret is a resource of the IntegrationKit created, therefore it needs to be present in the namespace where the operator is going to create the IntegrationKit. - The content of the maven profile is expected to be a text containing a valid maven profile starting with `<profile>` and ending with `</profile>` that will be integrated as an inline profile in the POM. - Syntax: [configmap|secret]:name[/key], where name represents the resource name, key optionally represents the resource key to be filtered (default key value = profile.xml). + description: 'Deprecated: no longer in use.' items: type: string type: array diff --git a/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml b/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml index 506d1378a..271fb99c5 100644 --- a/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml +++ b/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml @@ -7376,11 +7376,7 @@ spec: Deprecated: use TasksRequestCPU instead with task name `builder`. type: string mavenProfiles: - description: |- - A list of references pointing to configmaps/secrets that contains a maven profile. - This configmap/secret is a resource of the IntegrationKit created, therefore it needs to be present in the namespace where the operator is going to create the IntegrationKit. - The content of the maven profile is expected to be a text containing a valid maven profile starting with `<profile>` and ending with `</profile>` that will be integrated as an inline profile in the POM. - Syntax: [configmap|secret]:name[/key], where name represents the resource name, key optionally represents the resource key to be filtered (default key value = profile.xml). + description: 'Deprecated: no longer in use.' items: type: string type: array @@ -9669,11 +9665,7 @@ spec: Deprecated: use TasksRequestCPU instead with task name `builder`. type: string mavenProfiles: - description: |- - A list of references pointing to configmaps/secrets that contains a maven profile. - This configmap/secret is a resource of the IntegrationKit created, therefore it needs to be present in the namespace where the operator is going to create the IntegrationKit. - The content of the maven profile is expected to be a text containing a valid maven profile starting with `<profile>` and ending with `</profile>` that will be integrated as an inline profile in the POM. - Syntax: [configmap|secret]:name[/key], where name represents the resource name, key optionally represents the resource key to be filtered (default key value = profile.xml). + description: 'Deprecated: no longer in use.' items: type: string type: array diff --git a/pkg/trait/builder.go b/pkg/trait/builder.go index 81755a742..bda791655 100644 --- a/pkg/trait/builder.go +++ b/pkg/trait/builder.go @@ -443,21 +443,6 @@ func (t *builderTrait) builderTask(e *Environment, taskConf *v1.BuildConfigurati } } - // User provides a maven profile - if t.MavenProfiles != nil { - mavenProfiles := make([]v1.ValueSource, 0) - for _, v := range t.MavenProfiles { - if v != "" { - mavenProfile, err := v1.DecodeValueSource(v, "profile.xml") - if err != nil { - return nil, fmt.Errorf("invalid maven profile: %s: %w. ", v, err) - } - mavenProfiles = append(mavenProfiles, mavenProfile) - } - } - task.Maven.Profiles = mavenProfiles - } - steps := make([]builder.Step, 0, len(builder.Project.CommonSteps)) steps = append(steps, builder.Project.CommonSteps...) diff --git a/pkg/trait/builder_test.go b/pkg/trait/builder_test.go index 067e91ff2..3677cb5b4 100644 --- a/pkg/trait/builder_test.go +++ b/pkg/trait/builder_test.go @@ -245,47 +245,6 @@ func TestCustomTaskBuilderTraitInvalidStrategyOverride(t *testing.T) { assert.Equal(t, env.IntegrationKit.Status.Conditions[0].Type, v1.IntegrationKitConditionType("IntegrationKitTasksValid")) } -func TestMavenProfilesBuilderTrait(t *testing.T) { - env := createBuilderTestEnv(v1.IntegrationPlatformClusterKubernetes, v1.IntegrationPlatformBuildPublishStrategyJib, v1.BuildStrategyRoutine) - builderTrait := createNominalBuilderTraitTest() - builderTrait.MavenProfiles = []string{"configmap:maven-profile/owasp-profile.xml", "secret:maven-profile-secret"} - - err := builderTrait.Apply(env) - - require.NoError(t, err) - - assert.Equal(t, v1.ValueSource{ - ConfigMapKeyRef: &corev1.ConfigMapKeySelector{ - LocalObjectReference: corev1.LocalObjectReference{ - Name: "maven-profile", - }, - Key: "owasp-profile.xml", - }, - }, env.Pipeline[0].Builder.Maven.MavenSpec.Profiles[0]) - assert.Equal(t, v1.ValueSource{ - SecretKeyRef: &corev1.SecretKeySelector{ - LocalObjectReference: corev1.LocalObjectReference{ - Name: "maven-profile-secret", - }, - Key: "profile.xml", - }, - }, env.Pipeline[0].Builder.Maven.MavenSpec.Profiles[1]) -} - -func TestInvalidMavenProfilesBuilderTrait(t *testing.T) { - env := createBuilderTestEnv(v1.IntegrationPlatformClusterKubernetes, v1.IntegrationPlatformBuildPublishStrategyJib, v1.BuildStrategyRoutine) - builderTrait := createNominalBuilderTraitTest() - builderTrait.MavenProfiles = []string{"fakeprofile"} - - err := builderTrait.Apply(env) - - // The error will be reported to IntegrationKits - require.NoError(t, err) - assert.Equal(t, v1.IntegrationKitPhaseError, env.IntegrationKit.Status.Phase) - assert.Equal(t, corev1.ConditionFalse, env.IntegrationKit.Status.Conditions[0].Status) - assert.Contains(t, env.IntegrationKit.Status.Conditions[0].Message, "fakeprofile") -} - func TestBuilderCustomTasks(t *testing.T) { builderTrait := createNominalBuilderTraitTest() builderTrait.Tasks = append(builderTrait.Tasks, "test;alpine;ls")
