Skip to content

Commit

Permalink
feat(catalog): support placeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
squakez committed Mar 22, 2024
1 parent 8a3773f commit f49e0b1
Show file tree
Hide file tree
Showing 13 changed files with 320 additions and 69 deletions.
35 changes: 33 additions & 2 deletions docs/modules/ROOT/partials/apis/camel-k-crds.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,37 @@ map[string]string
the metadata of the loader
|===
[#_camel_apache_org_v1_CamelProperty]
=== CamelProperty
*Appears on:*
* <<#_camel_apache_org_v1_Capability, Capability>>
CamelProperty represents a Camel property that may end up in an application.properties file.
[cols="2,2a",options="header"]
|===
|Field
|Description
|`key` +
string
|
|`value` +
string
|
|===
[#_camel_apache_org_v1_CamelScheme]
Expand Down Expand Up @@ -1423,14 +1454,14 @@ which are specified in the runtime catalog.
List of required Maven dependencies
|`runtimeProperties` +
map[string]string
*xref:#_camel_apache_org_v1_CamelProperty[[\]CamelProperty]*
|
Set of required Camel runtime properties
|`buildTimeProperties` +
map[string]string
*xref:#_camel_apache_org_v1_CamelProperty[[\]CamelProperty]*
|
Expand Down
64 changes: 52 additions & 12 deletions helm/camel-k/crds/crd-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -660,11 +660,21 @@ spec:
properties which are specified in the runtime catalog.
properties:
buildTimeProperties:
additionalProperties:
type: string
description: Set of required Camel build time
properties
type: object
items:
description: CamelProperty represents a Camel
property that may end up in an application.properties
file.
properties:
key:
type: string
value:
type: string
required:
- key
type: object
type: array
dependencies:
description: List of required Maven dependencies
items:
Expand Down Expand Up @@ -697,10 +707,20 @@ spec:
description: Set of generic metadata
type: object
runtimeProperties:
additionalProperties:
type: string
description: Set of required Camel runtime properties
type: object
items:
description: CamelProperty represents a Camel
property that may end up in an application.properties
file.
properties:
key:
type: string
value:
type: string
required:
- key
type: object
type: array
type: object
description: features offered by this runtime
type: object
Expand Down Expand Up @@ -1514,11 +1534,21 @@ spec:
properties which are specified in the runtime catalog.
properties:
buildTimeProperties:
additionalProperties:
type: string
description: Set of required Camel build time
properties
type: object
items:
description: CamelProperty represents a Camel
property that may end up in an application.properties
file.
properties:
key:
type: string
value:
type: string
required:
- key
type: object
type: array
dependencies:
description: List of required Maven dependencies
items:
Expand Down Expand Up @@ -1551,10 +1581,20 @@ spec:
description: Set of generic metadata
type: object
runtimeProperties:
additionalProperties:
type: string
description: Set of required Camel runtime properties
type: object
items:
description: CamelProperty represents a Camel
property that may end up in an application.properties
file.
properties:
key:
type: string
value:
type: string
required:
- key
type: object
type: array
type: object
description: features offered by this runtime
type: object
Expand Down
30 changes: 24 additions & 6 deletions helm/camel-k/crds/crd-camel-catalog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,19 @@ spec:
are specified in the runtime catalog.
properties:
buildTimeProperties:
additionalProperties:
type: string
description: Set of required Camel build time properties
type: object
items:
description: CamelProperty represents a Camel property
that may end up in an application.properties file.
properties:
key:
type: string
value:
type: string
required:
- key
type: object
type: array
dependencies:
description: List of required Maven dependencies
items:
Expand Down Expand Up @@ -412,10 +421,19 @@ spec:
description: Set of generic metadata
type: object
runtimeProperties:
additionalProperties:
type: string
description: Set of required Camel runtime properties
type: object
items:
description: CamelProperty represents a Camel property
that may end up in an application.properties file.
properties:
key:
type: string
value:
type: string
required:
- key
type: object
type: array
type: object
description: features offered by this runtime
type: object
Expand Down
12 changes: 9 additions & 3 deletions pkg/apis/camel/v1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,17 @@ type Capability struct {
// List of required Maven dependencies
Dependencies []MavenArtifact `json:"dependencies,omitempty" yaml:"dependencies,omitempty"`
// Set of required Camel runtime properties
RuntimeProperties map[string]string `json:"runtimeProperties,omitempty" yaml:"runtimeProperties,omitempty"`
RuntimeProperties []CamelProperty `json:"runtimeProperties,omitempty" yaml:"runtimeProperties,omitempty"`
// Set of required Camel build time properties
BuildTimeProperties map[string]string `json:"buildTimeProperties,omitempty" yaml:"buildTimeProperties,omitempty"`
BuildTimeProperties []CamelProperty `json:"buildTimeProperties,omitempty" yaml:"buildTimeProperties,omitempty"`
// Set of generic metadata
Metadata map[string]string `json:"metadata,omitempty" yaml:"Metadata,omitempty"`
Metadata map[string]string `json:"metadata,omitempty" yaml:"metadata,omitempty"`
}

// CamelProperty represents a Camel property that may end up in an application.properties file.
type CamelProperty struct {
Key string `json:"key" yaml:"key"`
Value string `json:"value,omitempty" yaml:"value,omitempty"`
}

const (
Expand Down
11 changes: 11 additions & 0 deletions pkg/apis/camel/v1/integrationkit_types_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,17 @@ func (in *IntegrationKit) IsExternal() bool {
return in.Labels[IntegrationKitTypeLabel] == IntegrationKitTypeExternal
}

// HasCapability returns true if the Kit is enabled with such a capability.
func (in *IntegrationKit) HasCapability(capability string) bool {
for _, cap := range in.Spec.Capabilities {
if cap == capability {
return true
}
}

return false
}

// GetCondition returns the condition with the provided type.
func (in *IntegrationKitStatus) GetCondition(condType IntegrationKitConditionType) *IntegrationKitCondition {
for i := range in.Conditions {
Expand Down
27 changes: 19 additions & 8 deletions pkg/apis/camel/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 49 additions & 0 deletions pkg/client/camel/applyconfiguration/camel/v1/camelproperty.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 18 additions & 20 deletions pkg/client/camel/applyconfiguration/camel/v1/capability.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/client/camel/applyconfiguration/utils.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f49e0b1

Please sign in to comment.