Skip to content

Commit

Permalink
feat(trait): Add maven profile to Integration in builder trait
Browse files Browse the repository at this point in the history
Ref #4560

* Add builder.maven-profile property referencing a secret or a configmap
* Inject the given profile into the pom.xml generated
* Some refactoring on configmap/secret decoding from cli
  • Loading branch information
gansheer committed Jul 13, 2023
1 parent 489ed44 commit 21dd232
Show file tree
Hide file tree
Showing 30 changed files with 700 additions and 1 deletion.
44 changes: 44 additions & 0 deletions config/crd/bases/camel.apache.org_builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,50 @@ spec:
localRepository:
description: The path of the local Maven repository.
type: string
profile:
description: A reference to the ConfigMap or Secret
key that contains the Maven profile.
properties:
configMapKeyRef:
description: Selects a key of a ConfigMap.
properties:
key:
description: The key to select.
type: string
name:
description: 'Name of the referent. More info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion,
kind, uid?'
type: string
optional:
description: Specify whether the ConfigMap or
its key must be defined
type: boolean
required:
- key
type: object
secretKeyRef:
description: Selects a key of a secret.
properties:
key:
description: The key of the secret to select
from. Must be a valid secret key.
type: string
name:
description: 'Name of the referent. More info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion,
kind, uid?'
type: string
optional:
description: Specify whether the Secret or its
key must be defined
type: boolean
required:
- key
type: object
type: object
properties:
additionalProperties:
type: string
Expand Down
10 changes: 10 additions & 0 deletions config/crd/bases/camel.apache.org_integrationkits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,16 @@ spec:
description: When using `pod` strategy, the maximum amount
of memory required by the pod builder.
type: string
mavenProfile:
description: 'A reference pointing to a configmap/secret that
contains a maven profile. 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).'
type: string
orderStrategy:
description: The build order strategy to use, either `dependencies`,
`fifo` or `sequential` (default sequential)
Expand Down
104 changes: 104 additions & 0 deletions config/crd/bases/camel.apache.org_integrationplatforms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,48 @@ spec:
localRepository:
description: The path of the local Maven repository.
type: string
profile:
description: A reference to the ConfigMap or Secret key that
contains the Maven profile.
properties:
configMapKeyRef:
description: Selects a key of a ConfigMap.
properties:
key:
description: The key to select.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the ConfigMap or its
key must be defined
type: boolean
required:
- key
type: object
secretKeyRef:
description: Selects a key of a secret.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
type: object
properties:
additionalProperties:
type: string
Expand Down Expand Up @@ -469,6 +511,16 @@ spec:
description: When using `pod` strategy, the maximum amount
of memory required by the pod builder.
type: string
mavenProfile:
description: 'A reference pointing to a configmap/secret that
contains a maven profile. 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).'
type: string
orderStrategy:
description: The build order strategy to use, either `dependencies`,
`fifo` or `sequential` (default sequential)
Expand Down Expand Up @@ -1850,6 +1902,48 @@ spec:
localRepository:
description: The path of the local Maven repository.
type: string
profile:
description: A reference to the ConfigMap or Secret key that
contains the Maven profile.
properties:
configMapKeyRef:
description: Selects a key of a ConfigMap.
properties:
key:
description: The key to select.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the ConfigMap or its
key must be defined
type: boolean
required:
- key
type: object
secretKeyRef:
description: Selects a key of a secret.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
type: object
properties:
additionalProperties:
type: string
Expand Down Expand Up @@ -2165,6 +2259,16 @@ spec:
description: When using `pod` strategy, the maximum amount
of memory required by the pod builder.
type: string
mavenProfile:
description: 'A reference pointing to a configmap/secret that
contains a maven profile. 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).'
type: string
orderStrategy:
description: The build order strategy to use, either `dependencies`,
`fifo` or `sequential` (default sequential)
Expand Down
10 changes: 10 additions & 0 deletions config/crd/bases/camel.apache.org_integrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6194,6 +6194,16 @@ spec:
description: When using `pod` strategy, the maximum amount
of memory required by the pod builder.
type: string
mavenProfile:
description: 'A reference pointing to a configmap/secret that
contains a maven profile. 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).'
type: string
orderStrategy:
description: The build order strategy to use, either `dependencies`,
`fifo` or `sequential` (default sequential)
Expand Down
11 changes: 11 additions & 0 deletions config/crd/bases/camel.apache.org_kameletbindings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6469,6 +6469,17 @@ spec:
description: When using `pod` strategy, the maximum amount
of memory required by the pod builder.
type: string
mavenProfile:
description: 'A reference pointing to a configmap/secret
that contains a maven profile. 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).'
type: string
orderStrategy:
description: The build order strategy to use, either `dependencies`,
`fifo` or `sequential` (default sequential)
Expand Down
11 changes: 11 additions & 0 deletions config/crd/bases/camel.apache.org_pipes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6466,6 +6466,17 @@ spec:
description: When using `pod` strategy, the maximum amount
of memory required by the pod builder.
type: string
mavenProfile:
description: 'A reference pointing to a configmap/secret
that contains a maven profile. 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).'
type: string
orderStrategy:
description: The build order strategy to use, either `dependencies`,
`fifo` or `sequential` (default sequential)
Expand Down
17 changes: 17 additions & 0 deletions docs/modules/ROOT/partials/apis/camel-k-crds.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3836,6 +3836,14 @@ map[string]string
The Maven properties.
|`profile` +
*xref:#_camel_apache_org_v1_ValueSource[ValueSource]*
|
A reference to the ConfigMap or Secret key that contains
the Maven profile.
|`settings` +
*xref:#_camel_apache_org_v1_ValueSource[ValueSource]*
|
Expand Down Expand Up @@ -5442,6 +5450,15 @@ string
When using `pod` strategy, the maximum amount of memory required by the pod builder.
|`mavenProfile` +
string
|
A reference pointing to a configmap/secret that contains a maven profile.
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).
|`tasks` +
[]string
|
Expand Down
6 changes: 6 additions & 0 deletions docs/modules/traits/pages/builder.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ The following configuration options are available:
| string
| When using `pod` strategy, the maximum amount of memory required by the pod builder.

| builder.maven-profile
| string
| A reference pointing to a configmap/secret that contains a maven profile.
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).

| builder.tasks
| []string
| A list of tasks to be executed (available only when using `pod` strategy) with format <name>;<container-image>;<container-command>
Expand Down
Loading

0 comments on commit 21dd232

Please sign in to comment.