This is an automated email from the ASF dual-hosted git repository. squakez pushed a commit to branch release-2.9.x in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 46b98e7a46575fcbe3e66192d842092047259886 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 | 44 ++++++++---- .../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 | 17 +---- pkg/trait/builder_test.go | 41 ------------ 18 files changed, 78 insertions(+), 247 deletions(-) diff --git a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc index 7845f885f..1a932f688 100644 --- a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc +++ b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc @@ -4577,8 +4577,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]* @@ -6522,10 +6521,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 c83da3ed7..5f97612e7 100755 --- a/docs/modules/traits/pages/builder.adoc +++ b/docs/modules/traits/pages/builder.adoc @@ -78,10 +78,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 e5a5d0d76..4560b3c09 100644 --- a/helm/camel-k/crds/camel-k-crds.yaml +++ b/helm/camel-k/crds/camel-k-crds.yaml @@ -447,9 +447,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: @@ -1373,9 +1371,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: @@ -2934,11 +2930,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 @@ -3505,9 +3497,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: @@ -3871,11 +3861,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 @@ -5872,9 +5858,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: @@ -6286,11 +6270,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 @@ -8281,9 +8261,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: @@ -8601,11 +8579,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 @@ -10531,9 +10505,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: @@ -10893,11 +10865,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 @@ -20019,11 +19987,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 @@ -22265,11 +22229,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 @@ -32749,11 +32709,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 @@ -34931,11 +34887,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 18af05277..88887faff 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 6ef4a54c2..6bb924950 100644 --- a/pkg/apis/camel/v1/trait/builder.go +++ b/pkg/apis/camel/v1/trait/builder.go @@ -52,11 +52,8 @@ type BuilderTrait struct { // When using `pod` strategy, the maximum amount of memory required by the pod builder. // 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 24cd6c132..44a53c967 100644 --- a/pkg/apis/camel/v1/trait/zz_generated.deepcopy.go +++ b/pkg/apis/camel/v1/trait/zz_generated.deepcopy.go @@ -70,8 +70,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 9b1a09711..03514b9af 100644 --- a/pkg/apis/camel/v1/zz_generated.deepcopy.go +++ b/pkg/apis/camel/v1/zz_generated.deepcopy.go @@ -2386,8 +2386,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 51971abee..8b8d592b0 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 b8ba49df4..bf01e9811 100644 --- a/pkg/client/camel/applyconfiguration/camel/v1/mavenbuildspec.go +++ b/pkg/client/camel/applyconfiguration/camel/v1/mavenbuildspec.go @@ -59,15 +59,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 4fa73b535..e9142419f 100644 --- a/pkg/client/camel/applyconfiguration/camel/v1/mavenspec.go +++ b/pkg/client/camel/applyconfiguration/camel/v1/mavenspec.go @@ -26,14 +26,32 @@ import ( // MavenSpecApplyConfiguration represents a declarative configuration of the MavenSpec type for use // with apply. type MavenSpecApplyConfiguration struct { - LocalRepository *string `json:"localRepository,omitempty"` - Properties map[string]string `json:"properties,omitempty"` - Profiles []ValueSourceApplyConfiguration `json:"profiles,omitempty"` - Settings *ValueSourceApplyConfiguration `json:"settings,omitempty"` - SettingsSecurity *ValueSourceApplyConfiguration `json:"settingsSecurity,omitempty"` - CASecrets []corev1.SecretKeySelector `json:"caSecrets,omitempty"` - Extension []MavenArtifactApplyConfiguration `json:"extension,omitempty"` - CLIOptions []string `json:"cliOptions,omitempty"` + // The path of the local Maven repository. + LocalRepository *string `json:"localRepository,omitempty"` + // The Maven properties. + Properties map[string]string `json:"properties,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"` + // A reference to the ConfigMap or Secret key that contains + // the security of the Maven settings. + SettingsSecurity *ValueSourceApplyConfiguration `json:"settingsSecurity,omitempty"` + // The Secrets name and key, containing the CA certificate(s) used to connect + // to remote Maven repositories. + // It can contain X.509 certificates, and PKCS#7 formatted certificate chains. + // A JKS formatted keystore is automatically created to store the CA certificate(s), + // and configured to be used as a trusted certificate(s) by the Maven commands. + // Note that the root CA certificates are also imported into the created keystore. + CASecrets []corev1.SecretKeySelector `json:"caSecrets,omitempty"` + // The Maven build extensions. + // See https://maven.apache.org/guides/mini/guide-using-extensions.html. + Extension []MavenArtifactApplyConfiguration `json:"extension,omitempty"` + // The CLI options that are appended to the list of arguments for Maven commands, + // e.g., `-V,--no-transfer-progress,-Dstyle.color=never`. + // See https://maven.apache.org/ref/3.9.14/maven-embedder/cli.html. + CLIOptions []string `json:"cliOptions,omitempty"` } // MavenSpecApplyConfiguration constructs a declarative configuration of the MavenSpec type for use with @@ -64,15 +82,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 cfff79c7f..1fef21c1d 100644 --- a/pkg/resources/config/crd/bases/camel.apache.org_builds.yaml +++ b/pkg/resources/config/crd/bases/camel.apache.org_builds.yaml @@ -447,9 +447,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: @@ -1373,9 +1371,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 2b7c50488..4e701777e 100644 --- a/pkg/resources/config/crd/bases/camel.apache.org_integrationkits.yaml +++ b/pkg/resources/config/crd/bases/camel.apache.org_integrationkits.yaml @@ -249,11 +249,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 7b89b0e30..95e6d4390 100644 --- a/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml +++ b/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml @@ -246,9 +246,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: @@ -612,11 +610,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 @@ -2613,9 +2607,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: @@ -3027,11 +3019,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 9c023a8d6..444600a91 100644 --- a/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml +++ b/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml @@ -158,9 +158,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: @@ -478,11 +476,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 @@ -2408,9 +2402,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: @@ -2770,11 +2762,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 b971ddedf..4a209889b 100644 --- a/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml +++ b/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml @@ -7292,11 +7292,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 @@ -9538,11 +9534,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 e3504f7f6..ca28a7cf7 100644 --- a/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml +++ b/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml @@ -7344,11 +7344,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 @@ -9526,11 +9522,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 ed616e4bb..56ca48676 100644 --- a/pkg/trait/builder.go +++ b/pkg/trait/builder.go @@ -439,22 +439,7 @@ 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) + steps := make([]builder.Step, 0, len(builder.Project.CommonSteps)) steps = append(steps, builder.Project.CommonSteps...) // sort steps by phase 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")
