You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ts...@apache.org on 2022/07/08 06:11:55 UTC
[camel-k] branch main updated (49e690c6d -> 35ed0ee29)
This is an automated email from the ASF dual-hosted git repository.
tsato pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
from 49e690c6d Updated CHANGELOG.md
new a92aaa405 feat(api): strongly-typed traits configuration API
new 9b13525e2 feat(api): strongly-typed traits configuration API for addons
new c959a3f17 chore(trait): move traits to a dedicated API pkg
new 2dbdaf4a1 fix(api): restore TraitSpec/Configuration for backward compatibility
new 69707cfb4 feat(api): support addons in Traits schema
new 1707ed187 fix(api): fix Trait property name conflicts for generating CRDs
new aeca95989 chore(crd,doc): regen crd & docs
new d3c4cfe7d fix(trait): fix addon handling at kamel run
new 4fb8a2251 fix(trait): fix misconfigurations for traits
new 642127041 fix(trait): refactor and fix quarkus native build
new 4e909c8b0 fix(digest): fix hash computation for the new Traits schema
new 6468ae63d chore: regen resources
new 3c3a30277 fix(e2e): upgrade olm to 0.21.2
new 35ed0ee29 fix(cli): make promote aware of legacy and new trait configurations
The 14 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.github/actions/kamel-config-cluster/action.yaml | 4 +-
addons/addons_test.go | 104 +
addons/keda/keda.go | 10 +-
addons/master/master.go | 12 +-
.../buildah.go => addons/master/test_support.go | 5 +-
addons/strimzi/strimzi_test.go | 4 +-
addons/threescale/3scale.go | 10 +-
.../buildah.go => addons/tracing/test_support.go | 5 +-
addons/tracing/tracing.go | 10 +-
addons/tracing/tracing_test.go | 6 +-
.../bases/camel.apache.org_integrationkits.yaml | 91 +-
.../camel.apache.org_integrationplatforms.yaml | 2996 ++++++++++++++++++--
.../crd/bases/camel.apache.org_integrations.yaml | 1259 +++++++-
.../bases/camel.apache.org_kameletbindings.yaml | 1282 ++++++++-
docs/modules/traits/pages/container.adoc | 2 +-
docs/modules/traits/pages/gc.adoc | 2 +-
docs/modules/traits/pages/quarkus.adoc | 2 +-
docs/modules/traits/pages/service-binding.adoc | 3 +-
e2e/global/common/secondary_platform_test.go | 14 +-
e2e/global/common/traits/toleration_test.go | 4 +-
.../install/cli/duplicate_parameters_test.go | 2 +-
.../install/cli/files/JavaDuplicateParams.java | 14 +-
e2e/namespace/native/native_test.go | 2 +-
e2e/support/test_support.go | 8 +-
helm/camel-k/crds/crd-integration-kit.yaml | 91 +-
helm/camel-k/crds/crd-integration-platform.yaml | 2996 ++++++++++++++++++--
helm/camel-k/crds/crd-integration.yaml | 1259 +++++++-
helm/camel-k/crds/crd-kamelet-binding.yaml | 1282 ++++++++-
pkg/apis/camel/v1/common_types.go | 105 +-
pkg/apis/camel/v1/integration_types.go | 2 +-
pkg/apis/camel/v1/integrationkit_types.go | 23 +-
pkg/apis/camel/v1/integrationplatform_types.go | 2 +-
pkg/apis/camel/v1/trait/affinity.go | 40 +
.../camel/v1/trait/base.go} | 24 +-
.../camel/v1/trait/builder.go} | 19 +-
.../camel/v1/trait/camel.go} | 18 +-
pkg/apis/camel/v1/trait/container.go | 103 +
pkg/apis/camel/v1/trait/cron.go | 71 +
.../doc.go => apis/camel/v1/trait/dependencies.go} | 9 +-
pkg/apis/camel/v1/trait/deployer.go | 31 +
.../camel/v1/trait/deployment.go} | 18 +-
pkg/apis/camel/v1/{ => trait}/doc.go | 4 +-
pkg/apis/camel/v1/trait/environment.go | 34 +
.../camel/v1/trait/error_handler.go} | 16 +-
.../trait_factory.go => apis/camel/v1/trait/gc.go} | 22 +-
pkg/apis/camel/v1/trait/health.go | 57 +
.../camel/v1/trait/ingress.go} | 21 +-
.../camel/v1/trait/istio.go} | 19 +-
pkg/apis/camel/v1/trait/jolokia.go | 58 +
pkg/apis/camel/v1/trait/jvm.go | 37 +
.../camel/v1/trait/kamelets.go} | 18 +-
pkg/apis/camel/v1/trait/knative.go | 60 +
pkg/apis/camel/v1/trait/knative_service.go | 60 +
pkg/apis/camel/v1/trait/logging.go | 36 +
pkg/apis/camel/v1/trait/mount.go | 38 +
.../camel/v1/trait/openapi.go} | 16 +-
.../camel/v1/trait/owner.go} | 19 +-
pkg/apis/camel/v1/trait/pdb.go | 33 +
pkg/apis/camel/v1/trait/platform.go | 35 +
.../camel/v1/trait/pod.go} | 19 +-
pkg/apis/camel/v1/trait/prometheus.go | 38 +
pkg/apis/camel/v1/trait/pull_secret.go | 40 +
pkg/apis/camel/v1/trait/quarkus.go | 50 +
.../doc.go => apis/camel/v1/trait/registry.go} | 9 +-
pkg/apis/camel/v1/trait/route.go | 80 +
.../camel/v1/trait/service.go} | 21 +-
.../camel/v1/trait/service_binding.go} | 18 +-
.../{common_types_support.go => trait/support.go} | 30 +-
pkg/{ => apis/camel/v1}/trait/toleration.go | 48 +-
pkg/apis/camel/v1/trait/zz_generated.deepcopy.go | 991 +++++++
pkg/apis/camel/v1/zz_generated.deepcopy.go | 299 +-
pkg/cmd/bind.go | 6 +-
pkg/cmd/bind_test.go | 10 +-
pkg/cmd/debug.go | 32 +-
pkg/cmd/describe.go | 27 +-
pkg/cmd/kit_create.go | 12 +-
pkg/cmd/promote.go | 157 +-
pkg/cmd/promote_test.go | 60 -
pkg/cmd/run.go | 18 +-
pkg/cmd/run_test.go | 84 +-
pkg/cmd/trait_support.go | 107 +-
pkg/controller/integration/kits.go | 177 +-
.../{build_kit_test.go => kits_test.go} | 73 +-
pkg/controller/kameletbinding/integration.go | 7 +-
pkg/resources/resources.go | 24 +-
pkg/trait/affinity.go | 30 +-
pkg/trait/builder.go | 12 +-
pkg/trait/camel.go | 11 +-
pkg/trait/camel_test.go | 2 +-
pkg/trait/container.go | 100 +-
pkg/trait/container_probes_test.go | 59 +-
pkg/trait/container_test.go | 41 +-
pkg/trait/cron.go | 53 +-
pkg/trait/cron_test.go | 29 +-
pkg/trait/dependencies.go | 8 +-
pkg/trait/deployer.go | 13 +-
pkg/trait/deployment.go | 11 +-
pkg/trait/deployment_test.go | 2 +-
pkg/trait/environment.go | 22 +-
pkg/trait/environment_test.go | 27 +-
pkg/trait/error_handler.go | 9 +-
pkg/trait/gc.go | 45 +-
pkg/trait/gc_test.go | 20 +-
pkg/trait/health.go | 47 +-
pkg/trait/ingress.go | 18 +-
pkg/trait/init.go | 4 +-
pkg/trait/istio.go | 17 +-
pkg/trait/istio_test.go | 25 +-
pkg/trait/jolokia.go | 44 +-
pkg/trait/jvm.go | 27 +-
pkg/trait/kamelets.go | 11 +-
pkg/trait/knative.go | 42 +-
pkg/trait/knative_service.go | 42 +-
pkg/trait/knative_service_test.go | 48 +-
pkg/trait/knative_test.go | 54 +-
pkg/trait/logging.go | 22 +-
pkg/trait/logging_test.go | 19 +-
pkg/trait/mount.go | 20 +-
pkg/trait/mount_test.go | 15 +-
pkg/trait/openapi.go | 9 +-
pkg/trait/owner.go | 12 +-
pkg/trait/owner_test.go | 12 +-
pkg/trait/pdb.go | 15 +-
pkg/trait/platform.go | 17 +-
pkg/trait/pod.go | 12 +-
pkg/trait/prometheus.go | 26 +-
pkg/trait/pull_secret.go | 22 +-
pkg/trait/quarkus.go | 295 +-
pkg/trait/registry.go | 8 +-
pkg/trait/route.go | 65 +-
pkg/trait/route_test.go | 146 +-
pkg/trait/service.go | 14 +-
pkg/trait/service_binding.go | 10 +-
pkg/trait/service_test.go | 81 +-
pkg/trait/test_support.go | 46 +
pkg/trait/toleration.go | 20 +-
pkg/trait/trait_catalog.go | 2 +-
pkg/trait/trait_configure.go | 70 +-
pkg/trait/trait_configure_test.go | 118 +-
pkg/trait/trait_register.go | 2 +-
pkg/trait/trait_test.go | 70 +-
pkg/trait/trait_types.go | 4 +-
pkg/trait/util.go | 99 +
pkg/trait/util_test.go | 203 ++
pkg/util/bindings/api.go | 2 +-
pkg/util/bindings/bindings_test.go | 45 +-
pkg/util/bindings/knative_uri.go | 20 +-
pkg/util/digest/digest.go | 89 +-
pkg/util/test/trait.go | 55 -
resources/traits.yaml | 322 +--
script/Makefile | 3 +
script/gen_crd.sh | 10 +-
script/gen_doc.sh | 7 +-
153 files changed, 15047 insertions(+), 2797 deletions(-)
create mode 100644 addons/addons_test.go
copy pkg/builder/buildah.go => addons/master/test_support.go (89%)
copy pkg/builder/buildah.go => addons/tracing/test_support.go (89%)
create mode 100644 pkg/apis/camel/v1/trait/affinity.go
copy pkg/{trait/trait_factory.go => apis/camel/v1/trait/base.go} (55%)
copy pkg/{trait/trait_factory.go => apis/camel/v1/trait/builder.go} (61%)
copy pkg/{trait/trait_factory.go => apis/camel/v1/trait/camel.go} (57%)
create mode 100644 pkg/apis/camel/v1/trait/container.go
create mode 100644 pkg/apis/camel/v1/trait/cron.go
copy pkg/{trait/doc.go => apis/camel/v1/trait/dependencies.go} (75%)
create mode 100644 pkg/apis/camel/v1/trait/deployer.go
copy pkg/{trait/trait_factory.go => apis/camel/v1/trait/deployment.go} (61%)
copy pkg/apis/camel/v1/{ => trait}/doc.go (89%)
create mode 100644 pkg/apis/camel/v1/trait/environment.go
copy pkg/{trait/trait_factory.go => apis/camel/v1/trait/error_handler.go} (68%)
copy pkg/{trait/trait_factory.go => apis/camel/v1/trait/gc.go} (57%)
create mode 100644 pkg/apis/camel/v1/trait/health.go
copy pkg/{trait/trait_factory.go => apis/camel/v1/trait/ingress.go} (56%)
copy pkg/{trait/trait_factory.go => apis/camel/v1/trait/istio.go} (54%)
create mode 100644 pkg/apis/camel/v1/trait/jolokia.go
create mode 100644 pkg/apis/camel/v1/trait/jvm.go
copy pkg/{trait/trait_factory.go => apis/camel/v1/trait/kamelets.go} (61%)
create mode 100644 pkg/apis/camel/v1/trait/knative.go
create mode 100644 pkg/apis/camel/v1/trait/knative_service.go
create mode 100644 pkg/apis/camel/v1/trait/logging.go
create mode 100644 pkg/apis/camel/v1/trait/mount.go
copy pkg/{trait/trait_factory.go => apis/camel/v1/trait/openapi.go} (70%)
copy pkg/{trait/trait_factory.go => apis/camel/v1/trait/owner.go} (59%)
create mode 100644 pkg/apis/camel/v1/trait/pdb.go
create mode 100644 pkg/apis/camel/v1/trait/platform.go
copy pkg/{trait/trait_factory.go => apis/camel/v1/trait/pod.go} (62%)
create mode 100644 pkg/apis/camel/v1/trait/prometheus.go
create mode 100644 pkg/apis/camel/v1/trait/pull_secret.go
create mode 100644 pkg/apis/camel/v1/trait/quarkus.go
copy pkg/{trait/doc.go => apis/camel/v1/trait/registry.go} (80%)
create mode 100644 pkg/apis/camel/v1/trait/route.go
copy pkg/{trait/trait_factory.go => apis/camel/v1/trait/service.go} (55%)
copy pkg/{trait/trait_factory.go => apis/camel/v1/trait/service_binding.go} (62%)
copy pkg/apis/camel/v1/{common_types_support.go => trait/support.go} (66%)
copy pkg/{ => apis/camel/v1}/trait/toleration.go (60%)
create mode 100644 pkg/apis/camel/v1/trait/zz_generated.deepcopy.go
delete mode 100644 pkg/cmd/promote_test.go
rename pkg/controller/integration/{build_kit_test.go => kits_test.go} (87%)
create mode 100644 pkg/trait/util_test.go
delete mode 100644 pkg/util/test/trait.go
[camel-k] 09/14: fix(trait): fix misconfigurations for traits
Posted by ts...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tsato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 4fb8a2251e3fe8027dc9201c0cbc4d71a5013f16
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Sat Jul 2 00:28:22 2022 +0900
fix(trait): fix misconfigurations for traits
---
config/crd/bases/camel.apache.org_integrationkits.yaml | 14 ++++++++++++++
helm/camel-k/crds/crd-integration-kit.yaml | 14 ++++++++++++++
pkg/apis/camel/v1/integrationkit_types.go | 2 ++
pkg/apis/camel/v1/zz_generated.deepcopy.go | 5 +++++
pkg/resources/resources.go | 4 ++--
pkg/trait/init.go | 2 +-
pkg/trait/quarkus.go | 5 +++--
pkg/trait/registry.go | 2 +-
8 files changed, 42 insertions(+), 6 deletions(-)
diff --git a/config/crd/bases/camel.apache.org_integrationkits.yaml b/config/crd/bases/camel.apache.org_integrationkits.yaml
index 06e61aaf3..2757e6ceb 100644
--- a/config/crd/bases/camel.apache.org_integrationkits.yaml
+++ b/config/crd/bases/camel.apache.org_integrationkits.yaml
@@ -189,6 +189,20 @@ spec:
type: string
type: array
type: object
+ registry:
+ description: The Registry trait sets up Maven to use the Image
+ registry as a Maven repository.
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
type: object
type: object
status:
diff --git a/helm/camel-k/crds/crd-integration-kit.yaml b/helm/camel-k/crds/crd-integration-kit.yaml
index 06e61aaf3..2757e6ceb 100644
--- a/helm/camel-k/crds/crd-integration-kit.yaml
+++ b/helm/camel-k/crds/crd-integration-kit.yaml
@@ -189,6 +189,20 @@ spec:
type: string
type: array
type: object
+ registry:
+ description: The Registry trait sets up Maven to use the Image
+ registry as a Maven repository.
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
type: object
type: object
status:
diff --git a/pkg/apis/camel/v1/integrationkit_types.go b/pkg/apis/camel/v1/integrationkit_types.go
index 56f7e829a..79c853863 100644
--- a/pkg/apis/camel/v1/integrationkit_types.go
+++ b/pkg/apis/camel/v1/integrationkit_types.go
@@ -75,6 +75,8 @@ type IntegrationKitTraits struct {
// It's enabled by default.
// NOTE: Compiling to a native executable, i.e. when using `package-type=native`, is only supported for kamelets, as well as YAML and XML integrations. It also requires at least 4GiB of memory, so the Pod running the native build, that is either the operator Pod, or the build Pod (depending on the build strategy configured for the platform), must have enough memory available.
Quarkus *trait.QuarkusTrait `property:"quarkus" json:"quarkus,omitempty"`
+ // The Registry trait sets up Maven to use the Image registry as a Maven repository.
+ Registry *trait.RegistryTrait `property:"registry" json:"registry,omitempty"`
// The collection of addon trait configurations
Addons map[string]AddonTrait `json:"addons,omitempty"`
diff --git a/pkg/apis/camel/v1/zz_generated.deepcopy.go b/pkg/apis/camel/v1/zz_generated.deepcopy.go
index 3a7ef475b..f93e893ef 100644
--- a/pkg/apis/camel/v1/zz_generated.deepcopy.go
+++ b/pkg/apis/camel/v1/zz_generated.deepcopy.go
@@ -833,6 +833,11 @@ func (in *IntegrationKitTraits) DeepCopyInto(out *IntegrationKitTraits) {
*out = new(trait.QuarkusTrait)
(*in).DeepCopyInto(*out)
}
+ if in.Registry != nil {
+ in, out := &in.Registry, &out.Registry
+ *out = new(trait.RegistryTrait)
+ (*in).DeepCopyInto(*out)
+ }
if in.Addons != nil {
in, out := &in.Addons, &out.Addons
*out = make(map[string]AddonTrait, len(*in))
diff --git a/pkg/resources/resources.go b/pkg/resources/resources.go
index d0710fcea..a9851feea 100644
--- a/pkg/resources/resources.go
+++ b/pkg/resources/resources.go
@@ -131,9 +131,9 @@ var assets = func() http.FileSystem {
"/crd/bases/camel.apache.org_integrationkits.yaml": &vfsgen۰CompressedFileInfo{
name: "camel.apache.org_integrationkits.yaml",
modTime: time.Time{},
- uncompressedSize: 14289,
+ uncompressedSize: 15017,
- compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x3a\x4d\x93\xdb\x38\x76\x77\xfd\x8a\x57\xd3\x07\xdb\x55\x12\x7b\x27\xd9\xda\x4a\x75\x2a\x87\xde\xb6\x3d\xdb\x65\xbb\xdb\xb1\x34\xb3\x99\xaa\x39\xf4\x13\xf9\x44\x61\x44\x02\x5c\x00\x94\x5a\x49\xe5\xbf\xa7\xde\x03\x48\x51\x12\x29\x69\xda\xe3\xec\x65\x78\xb1\x5b\x00\xde\xf7\x37\x70\x05\x93\xdf\xef\x1b\x5d\xc1\x47\x95\x92\x76\x94\x81\x37\xe0\x97\x04\xb7\x15\xa6\x4b\x82\xa9\x59\xf8\x0d\x5a\x82\xf7\xa6\xd6\x19\x7a\x65\x [...]
+ compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x3b\x5d\x73\xdb\x48\x72\xef\xfc\x15\x5d\xab\x07\xdb\x55\x24\x74\x9b\x5c\x5d\xa5\x94\xca\x83\x4e\xb6\xf7\x54\xb6\x25\xc7\xe4\xee\x65\xab\xf6\x41\x4d\xa0\x09\xce\x12\x98\xc1\xcd\x0c\x48\x31\xa9\xfc\xf7\x54\xf7\x0c\x40\x90\x04\x48\xae\x76\x9d\x7b\x31\x5e\x2c\x02\x33\x3d\xfd\xfd\x39\xbe\x82\xc9\x1f\xf7\x8c\xae\xe0\xa3\x4a\x49\x3b\xca\xc0\x1b\xf0\x4b\x82\xdb\x0a\xd3\x25\xc1\xd4\x2c\xfc\x06\x2d\xc1\x7b\x53\xeb\x0c\xbd\x [...]
},
"/crd/bases/camel.apache.org_integrationplatforms.yaml": &vfsgen۰CompressedFileInfo{
name: "camel.apache.org_integrationplatforms.yaml",
diff --git a/pkg/trait/init.go b/pkg/trait/init.go
index 9e29e5b91..dbb6c8c10 100644
--- a/pkg/trait/init.go
+++ b/pkg/trait/init.go
@@ -34,7 +34,7 @@ const flowsInternalSourceName = "camel-k-embedded-flow.yaml"
type initTrait struct {
BaseTrait
- traitv1.Trait
+ traitv1.Trait `property:",squash"`
}
func NewInitTrait() Trait {
diff --git a/pkg/trait/quarkus.go b/pkg/trait/quarkus.go
index fc5509595..92e34fc19 100644
--- a/pkg/trait/quarkus.go
+++ b/pkg/trait/quarkus.go
@@ -243,8 +243,9 @@ func (t *quarkusTrait) newIntegrationKit(e *Environment, packageType traitv1.Qua
Dependencies: e.Integration.Status.Dependencies,
Repositories: e.Integration.Spec.Repositories,
Traits: v1.IntegrationKitTraits{
- Builder: e.Integration.Spec.Traits.Builder,
- Quarkus: e.Integration.Spec.Traits.Quarkus,
+ Builder: e.Integration.Spec.Traits.Builder,
+ Quarkus: e.Integration.Spec.Traits.Quarkus,
+ Registry: e.Integration.Spec.Traits.Registry,
},
}
diff --git a/pkg/trait/registry.go b/pkg/trait/registry.go
index 2a7cbc61d..c303c5b03 100644
--- a/pkg/trait/registry.go
+++ b/pkg/trait/registry.go
@@ -39,7 +39,7 @@ import (
type registryTrait struct {
BaseTrait
- traitv1.RegistryTrait
+ traitv1.RegistryTrait `property:",squash"`
}
func newRegistryTrait() Trait {
[camel-k] 06/14: fix(api): fix Trait property name conflicts for generating CRDs
Posted by ts...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tsato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 1707ed18763c153aa8c1f08cdc4791672c2c5a98
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Wed Jun 29 20:07:23 2022 +0900
fix(api): fix Trait property name conflicts for generating CRDs
---
pkg/apis/camel/v1/common_types.go | 7 +++----
pkg/apis/camel/v1/trait/base.go | 3 +++
pkg/apis/camel/v1/trait/knative.go | 2 +-
pkg/trait/trait_configure.go | 7 +++++++
4 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/pkg/apis/camel/v1/common_types.go b/pkg/apis/camel/v1/common_types.go
index f49bc83e1..a0906a52d 100644
--- a/pkg/apis/camel/v1/common_types.go
+++ b/pkg/apis/camel/v1/common_types.go
@@ -209,13 +209,12 @@ type TraitConfiguration struct {
RawMessage `json:",inline"`
}
-// +kubebuilder:validation:Type=object
-// +kubebuilder:validation:Format=""
-// +kubebuilder:pruning:PreserveUnknownFields
-
// RawMessage is a raw encoded JSON value.
// It implements Marshaler and Unmarshaler and can
// be used to delay JSON decoding or precompute a JSON encoding.
+// +kubebuilder:validation:Type=object
+// +kubebuilder:validation:Format=""
+// +kubebuilder:pruning:PreserveUnknownFields
type RawMessage []byte
// +kubebuilder:object:generate=false
diff --git a/pkg/apis/camel/v1/trait/base.go b/pkg/apis/camel/v1/trait/base.go
index 5117e1ac9..8c571ba02 100644
--- a/pkg/apis/camel/v1/trait/base.go
+++ b/pkg/apis/camel/v1/trait/base.go
@@ -32,5 +32,8 @@ type Configuration struct {
RawMessage `json:",inline"`
}
+// +kubebuilder:validation:Type=object
+// +kubebuilder:validation:Format=""
+// +kubebuilder:pruning:PreserveUnknownFields
// Deprecated: for backward compatibility.
type RawMessage []byte
diff --git a/pkg/apis/camel/v1/trait/knative.go b/pkg/apis/camel/v1/trait/knative.go
index 13590557a..666953b08 100644
--- a/pkg/apis/camel/v1/trait/knative.go
+++ b/pkg/apis/camel/v1/trait/knative.go
@@ -29,7 +29,7 @@ package trait
type KnativeTrait struct {
Trait `property:",squash" json:",inline"`
// Can be used to inject a Knative complete configuration in JSON format.
- Configuration string `property:"configuration" json:"configuration,omitempty"`
+ Configuration string `property:"configuration" json:"config,omitempty"`
// List of channels used as source of integration routes.
// Can contain simple channel names or full Camel URIs.
ChannelSources []string `property:"channel-sources" json:"channelSources,omitempty"`
diff --git a/pkg/trait/trait_configure.go b/pkg/trait/trait_configure.go
index f50fc26d2..94ae5578f 100644
--- a/pkg/trait/trait_configure.go
+++ b/pkg/trait/trait_configure.go
@@ -100,6 +100,13 @@ func decodeTrait(in map[string]interface{}, target Trait, root bool) error {
// decode legacy configuration first if it exists
if root && in["configuration"] != nil {
if config, ok := in["configuration"].(map[string]interface{}); ok {
+ // for traits that had the same property name "configuration",
+ // it needs to be renamed to "config" to avoid naming conflicts
+ // (e.g. Knative trait).
+ if config["configuration"] != nil {
+ config["config"] = config["configuration"]
+ }
+
if err := decodeTrait(config, target, false); err != nil {
return err
}
[camel-k] 13/14: fix(e2e): upgrade olm to 0.21.2
Posted by ts...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tsato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 3c3a30277dd292ef2cf77ccb64ffe767daaf7ccb
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Tue Jul 5 01:00:30 2022 +0900
fix(e2e): upgrade olm to 0.21.2
Since OLM 0.19.0 the max total size of bundle is increased from ~1MB to
~4MB and now the bloated Camel K Operator bundle requires >1.3MB, so
upgrading OLM to >= 0.19.0 is necessary.
https://groups.google.com/g/operator-framework/c/79UO6oGwuTs
---
.github/actions/kamel-config-cluster/action.yaml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/actions/kamel-config-cluster/action.yaml b/.github/actions/kamel-config-cluster/action.yaml
index 4f7dda95b..f58327aad 100644
--- a/.github/actions/kamel-config-cluster/action.yaml
+++ b/.github/actions/kamel-config-cluster/action.yaml
@@ -158,10 +158,10 @@ runs:
if [ $? != 0 ]; then
set -e
echo "OLM not detected on cluster so downloading and installing"
- kubectl apply -f https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.17.0/crds.yaml
+ kubectl create -f https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.21.2/crds.yaml
# wait for a while to be sure CRDs are installed
sleep 1
- kubectl apply -f https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.17.0/olm.yaml
+ kubectl create -f https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.21.2/olm.yaml
fi
set -e
[camel-k] 12/14: chore: regen resources
Posted by ts...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tsato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 6468ae63d8966f605143193697e021721d24a50d
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Mon Jul 4 23:50:21 2022 +0900
chore: regen resources
---
pkg/resources/resources.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pkg/resources/resources.go b/pkg/resources/resources.go
index d50f1734c..af230eb89 100644
--- a/pkg/resources/resources.go
+++ b/pkg/resources/resources.go
@@ -392,9 +392,9 @@ var assets = func() http.FileSystem {
"/rbac/operator-role-knative.yaml": &vfsgen۰CompressedFileInfo{
name: "operator-role-knative.yaml",
modTime: time.Time{},
- uncompressedSize: 1620,
+ uncompressedSize: 1677,
- compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x94\x41\x6f\xdb\x46\x10\x85\xef\xfb\x2b\x1e\xc4\x4b\x02\x58\x74\xdb\x53\xa1\x9e\x54\xc7\x6e\x89\x06\x12\x60\x2a\x0d\x72\x1c\x92\x23\x72\x20\x72\x77\x3b\xbb\x14\xe3\xfe\xfa\x82\x2b\xaa\x71\xe0\x83\x2f\x0e\x2f\x1a\xad\x66\x67\xbe\x37\x6f\xc4\x0c\xeb\xb7\x7b\x4c\x86\x8f\x52\xb3\x0d\xdc\x20\x3a\xc4\x8e\xb1\xf5\x54\x77\x8c\xd2\x1d\xe3\x44\xca\x78\x70\xa3\x6d\x28\x8a\xb3\x78\xb7\x2d\x1f\xde\x63\xb4\x0d\x2b\x9c\x65\x38\x [...]
+ compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x94\x41\x8f\xdb\x46\x0c\x85\xef\xf3\x2b\x1e\xac\x4b\x02\xac\xb5\x6d\x4f\x85\x7b\x72\x37\xbb\xad\xd1\xc0\x06\x56\x4e\x83\x1c\x29\x89\x96\x08\x4b\x33\x53\xce\xc8\x8a\xfb\xeb\x0b\x8d\xe5\xc6\xc1\x1e\xf6\xb2\xd1\xc5\x1c\xf9\x0d\xf9\x91\x8f\x76\x86\xe5\xdb\x3d\x26\xc3\x47\xa9\xd8\x06\xae\x11\x1d\x62\xcb\x58\x7b\xaa\x5a\x46\xe1\x0e\x71\x24\x65\x3c\xb9\xc1\xd6\x14\xc5\x59\xbc\x5b\x17\x4f\xef\x31\xd8\x9a\x15\xce\x32\x9c\x [...]
},
"/rbac/operator-role-leases.yaml": &vfsgen۰CompressedFileInfo{
name: "operator-role-leases.yaml",
[camel-k] 01/14: feat(api): strongly-typed traits configuration API
Posted by ts...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tsato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit a92aaa405cf8a38a722c476251d04b99221f9682
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Thu Jun 30 14:17:40 2022 +0900
feat(api): strongly-typed traits configuration API
---
e2e/global/common/traits/toleration_test.go | 4 +-
e2e/support/test_support.go | 2 +-
pkg/apis/camel/v1/common_types.go | 80 +-
pkg/apis/camel/v1/integration_types.go | 2 +-
pkg/apis/camel/v1/integrationkit_types.go | 12 +-
pkg/apis/camel/v1/integrationplatform_types.go | 2 +-
pkg/apis/camel/v1/trait_affinity.go | 40 +
.../test/trait.go => apis/camel/v1/trait_base.go} | 41 +-
.../trait.go => apis/camel/v1/trait_builder.go} | 49 +-
.../test/trait.go => apis/camel/v1/trait_camel.go} | 48 +-
pkg/apis/camel/v1/trait_container.go | 102 ++
pkg/apis/camel/v1/trait_cron.go | 71 ++
.../camel/v1/trait_dependencies.go} | 45 +-
pkg/apis/camel/v1/trait_deployer.go | 31 +
.../trait.go => apis/camel/v1/trait_deployment.go} | 48 +-
pkg/apis/camel/v1/trait_environment.go | 34 +
.../camel/v1/trait_error_handler.go} | 46 +-
.../test/trait.go => apis/camel/v1/trait_gc.go} | 50 +-
pkg/apis/camel/v1/trait_health.go | 57 +
.../trait.go => apis/camel/v1/trait_ingress.go} | 51 +-
.../test/trait.go => apis/camel/v1/trait_istio.go} | 49 +-
pkg/apis/camel/v1/trait_jolokia.go | 58 +
pkg/apis/camel/v1/trait_jvm.go | 37 +
.../trait.go => apis/camel/v1/trait_kamelets.go} | 48 +-
pkg/apis/camel/v1/trait_knative.go | 60 +
pkg/apis/camel/v1/trait_knative_service.go | 60 +
pkg/apis/camel/v1/trait_logging.go | 36 +
pkg/apis/camel/v1/trait_mount.go | 38 +
.../trait.go => apis/camel/v1/trait_openapi.go} | 46 +-
.../test/trait.go => apis/camel/v1/trait_owner.go} | 49 +-
pkg/apis/camel/v1/trait_pdb.go | 33 +
pkg/apis/camel/v1/trait_platform.go | 35 +
.../test/trait.go => apis/camel/v1/trait_pod.go} | 49 +-
pkg/apis/camel/v1/trait_prometheus.go | 38 +
pkg/apis/camel/v1/trait_pull_secret.go | 40 +
pkg/apis/camel/v1/trait_quarkus.go | 47 +
.../trait.go => apis/camel/v1/trait_registry.go} | 45 +-
pkg/apis/camel/v1/trait_route.go | 80 ++
.../trait.go => apis/camel/v1/trait_service.go} | 51 +-
.../camel/v1/trait_service_binding.go} | 48 +-
.../camel/v1/trait_toleration.go} | 50 +-
pkg/apis/camel/v1/zz_generated.deepcopy.go | 1161 +++++++++++++++++++-
pkg/cmd/bind.go | 5 +-
pkg/cmd/bind_test.go | 10 +-
pkg/cmd/debug.go | 30 +-
pkg/cmd/describe.go | 27 +-
pkg/cmd/kit_create.go | 12 +-
pkg/cmd/run.go | 4 +-
pkg/cmd/run_test.go | 69 +-
pkg/cmd/trait_support.go | 49 +-
pkg/controller/integration/kits.go | 175 +--
.../{build_kit_test.go => kits_test.go} | 72 +-
pkg/controller/kameletbinding/integration.go | 7 +-
pkg/trait/affinity.go | 29 +-
pkg/trait/builder.go | 11 +-
pkg/trait/camel.go | 10 +-
pkg/trait/camel_test.go | 2 +-
pkg/trait/container.go | 99 +-
pkg/trait/container_probes_test.go | 58 +-
pkg/trait/container_test.go | 40 +-
pkg/trait/cron.go | 52 +-
pkg/trait/cron_test.go | 28 +-
pkg/trait/dependencies.go | 7 +-
pkg/trait/deployer.go | 13 +-
pkg/trait/deployment.go | 10 +-
pkg/trait/deployment_test.go | 2 +-
pkg/trait/environment.go | 22 +-
pkg/trait/environment_test.go | 26 +-
pkg/trait/error_handler.go | 8 +-
pkg/trait/gc.go | 44 +-
pkg/trait/gc_test.go | 20 +-
pkg/trait/health.go | 46 +-
pkg/trait/ingress.go | 17 +-
pkg/trait/init.go | 3 +-
pkg/trait/istio.go | 16 +-
pkg/trait/istio_test.go | 24 +-
pkg/trait/jolokia.go | 43 +-
pkg/trait/jvm.go | 26 +-
pkg/trait/kamelets.go | 10 +-
pkg/trait/knative.go | 41 +-
pkg/trait/knative_service.go | 41 +-
pkg/trait/knative_service_test.go | 47 +-
pkg/trait/knative_test.go | 45 +-
pkg/trait/logging.go | 22 +-
pkg/trait/logging_test.go | 18 +-
pkg/trait/mount.go | 19 +-
pkg/trait/mount_test.go | 14 +-
pkg/trait/openapi.go | 8 +-
pkg/trait/owner.go | 11 +-
pkg/trait/owner_test.go | 11 +-
pkg/trait/pdb.go | 14 +-
pkg/trait/platform.go | 16 +-
pkg/trait/pod.go | 11 +-
pkg/trait/prometheus.go | 25 +-
pkg/trait/pull_secret.go | 22 +-
pkg/trait/quarkus.go | 91 +-
pkg/trait/registry.go | 7 +-
pkg/trait/route.go | 64 +-
pkg/trait/route_test.go | 145 +--
pkg/trait/service.go | 13 +-
pkg/trait/service_binding.go | 9 +-
pkg/trait/service_test.go | 80 +-
pkg/trait/toleration.go | 20 +-
pkg/trait/trait_configure.go | 35 +-
pkg/trait/trait_configure_test.go | 45 +-
pkg/trait/trait_register.go | 2 +-
pkg/trait/trait_test.go | 65 +-
pkg/trait/trait_types.go | 4 +-
pkg/trait/util.go | 36 +
pkg/util/bindings/api.go | 2 +-
pkg/util/bindings/bindings_test.go | 44 +-
pkg/util/bindings/knative_uri.go | 19 +-
pkg/util/digest/digest.go | 39 +-
113 files changed, 3021 insertions(+), 2163 deletions(-)
diff --git a/e2e/global/common/traits/toleration_test.go b/e2e/global/common/traits/toleration_test.go
index 8c71c52c7..f834deac6 100644
--- a/e2e/global/common/traits/toleration_test.go
+++ b/e2e/global/common/traits/toleration_test.go
@@ -69,7 +69,7 @@ func TestTolerationTrait(t *testing.T) {
Key: "camel.apache.org/master",
Operator: corev1.TolerationOpExists,
Effect: corev1.TaintEffectNoExecute,
- TolerationSeconds: pointer.Int64Ptr(300),
+ TolerationSeconds: pointer.Int64(300),
}))
})
@@ -91,7 +91,7 @@ func TestTolerationTrait(t *testing.T) {
Key: "camel.apache.org/master",
Operator: corev1.TolerationOpEqual,
Value: "test", Effect: corev1.TaintEffectNoExecute,
- TolerationSeconds: pointer.Int64Ptr(300),
+ TolerationSeconds: pointer.Int64(300),
}))
})
diff --git a/e2e/support/test_support.go b/e2e/support/test_support.go
index b98be7ef7..cec5e580b 100644
--- a/e2e/support/test_support.go
+++ b/e2e/support/test_support.go
@@ -347,7 +347,7 @@ func IntegrationLogs(ns, name string) func() string {
}
options := corev1.PodLogOptions{
- TailLines: pointer.Int64Ptr(100),
+ TailLines: pointer.Int64(100),
}
if len(pod.Spec.Containers) > 1 {
diff --git a/pkg/apis/camel/v1/common_types.go b/pkg/apis/camel/v1/common_types.go
index 1d9be8ceb..34553daa7 100644
--- a/pkg/apis/camel/v1/common_types.go
+++ b/pkg/apis/camel/v1/common_types.go
@@ -101,16 +101,76 @@ type FailureRecovery struct {
AttemptTime metav1.Time `json:"attemptTime"`
}
-// A TraitSpec contains the configuration of a trait
-type TraitSpec struct {
- // TraitConfiguration parameters configuration
- Configuration TraitConfiguration `json:"configuration"`
-}
-
-// TraitConfiguration represents the expected configuration for a given trait parameter
-type TraitConfiguration struct {
- // generic raw message, tipically a map containing the keys (trait parameters) and the values (either single text or array)
- RawMessage `json:",inline"`
+// Traits represents the collection of trait configurations
+type Traits struct {
+ // The configuration of Affinity trait
+ Affinity *AffinityTrait `property:"affinity" json:"affinity,omitempty"`
+ // The configuration of Builder trait
+ Builder *BuilderTrait `property:"builder" json:"builder,omitempty"`
+ // The configuration of Camel trait
+ Camel *CamelTrait `property:"camel" json:"camel,omitempty"`
+ // The configuration of Container trait
+ Container *ContainerTrait `property:"container" json:"container,omitempty"`
+ // The configuration of Cron trait
+ Cron *CronTrait `property:"cron" json:"cron,omitempty"`
+ // DependenciesTrait is the configuration of Dependencies trait
+ Dependencies *DependenciesTrait `property:"dependencies" json:"dependencies,omitempty"`
+ // The configuration of Deployer trait
+ Deployer *DeployerTrait `property:"deployer" json:"deployer,omitempty"`
+ // The configuration of Deployment trait
+ Deployment *DeploymentTrait `property:"deployment" json:"deployment,omitempty"`
+ // The configuration of Environment trait
+ Environment *EnvironmentTrait `property:"environment" json:"environment,omitempty"`
+ // The configuration of Error Handler trait
+ ErrorHandler *ErrorHandlerTrait `property:"error-handler" json:"error-handler,omitempty"`
+ // The configuration of GC trait
+ GC *GCTrait `property:"gc" json:"gc,omitempty"`
+ // The configuration of Health trait
+ Health *HealthTrait `property:"health" json:"health,omitempty"`
+ // The configuration of Ingress trait
+ Ingress *IngressTrait `property:"ingress" json:"ingress,omitempty"`
+ // The configuration of Istio trait
+ Istio *IstioTrait `property:"istio" json:"istio,omitempty"`
+ // The configuration of Jolokia trait
+ Jolokia *JolokiaTrait `property:"jolokia" json:"jolokia,omitempty"`
+ // The configuration of JVM trait
+ JVM *JVMTrait `property:"jvm" json:"jvm,omitempty"`
+ // The configuration of Kamelets trait
+ Kamelets *KameletsTrait `property:"kamelets" json:"kamelets,omitempty"`
+ // The configuration of Knative trait
+ Knative *KnativeTrait `property:"knative" json:"knative,omitempty"`
+ // The configuration of Knative Service trait
+ KnativeService *KnativeServiceTrait `property:"knative-service" json:"knative-service,omitempty"`
+ // The configuration of Logging trait
+ Logging *LoggingTrait `property:"logging" json:"logging,omitempty"`
+ // The configuration of Mount trait
+ Mount *MountTrait `property:"mount" json:"mount,omitempty"`
+ // The configuration of OpenAPI trait
+ OpenAPI *OpenAPITrait `property:"openapi" json:"openapi,omitempty"`
+ // The configuration of Owner trait
+ Owner *OwnerTrait `property:"owner" json:"owner,omitempty"`
+ // The configuration of PDB trait
+ PDB *PDBTrait `property:"pdb" json:"pdb,omitempty"`
+ // The configuration of Platform trait
+ Platform *PlatformTrait `property:"platform" json:"platform,omitempty"`
+ // The configuration of Pod trait
+ Pod *PodTrait `property:"pod" json:"pod,omitempty"`
+ // The configuration of Prometheus trait
+ Prometheus *PrometheusTrait `property:"prometheus" json:"prometheus,omitempty"`
+ // The configuration of Pull Secret trait
+ PullSecret *PullSecretTrait `property:"pull-secret" json:"pull-secret,omitempty"`
+ // The configuration of Quarkus trait
+ Quarkus *QuarkusTrait `property:"quarkus" json:"quarkus,omitempty"`
+ // The configuration of Registry trait
+ Registry *RegistryTrait `property:"registry" json:"registry,omitempty"`
+ // The configuration of Route trait
+ Route *RouteTrait `property:"route" json:"route,omitempty"`
+ // The configuration of Service trait
+ Service *ServiceTrait `property:"service" json:"service,omitempty"`
+ // The configuration of Service Binding trait
+ ServiceBinding *ServiceBindingTrait `property:"service-binding" json:"service-binding,omitempty"`
+ // The configuration of Toleration trait
+ Toleration *TolerationTrait `property:"toleration" json:"toleration,omitempty"`
}
// +kubebuilder:validation:Type=object
diff --git a/pkg/apis/camel/v1/integration_types.go b/pkg/apis/camel/v1/integration_types.go
index 9cafb294f..ad99904af 100644
--- a/pkg/apis/camel/v1/integration_types.go
+++ b/pkg/apis/camel/v1/integration_types.go
@@ -68,7 +68,7 @@ type IntegrationSpec struct {
// the profile needed to run this Integration
Profile TraitProfile `json:"profile,omitempty"`
// the traits needed to run this Integration
- Traits map[string]TraitSpec `json:"traits,omitempty"`
+ Traits Traits `json:"traits,omitempty"`
// Pod template customization
PodTemplate *PodSpecTemplate `json:"template,omitempty"`
// Deprecated:
diff --git a/pkg/apis/camel/v1/integrationkit_types.go b/pkg/apis/camel/v1/integrationkit_types.go
index 0c8a9f5e9..b3865ff57 100644
--- a/pkg/apis/camel/v1/integrationkit_types.go
+++ b/pkg/apis/camel/v1/integrationkit_types.go
@@ -48,16 +48,16 @@ type IntegrationKit struct {
Status IntegrationKitStatus `json:"status,omitempty"`
}
-// IntegrationKitSpec defines a container image and additional configurations required to kick off an `Integration` which certain features
+// IntegrationKitSpec defines a container image and additional configurations required to kick off an `Integration` with certain features
type IntegrationKitSpec struct {
- // the container image as identify in the container registry
+ // the container image as identified in the container registry
Image string `json:"image,omitempty"`
// a list of Camel dependecies used by this kit
Dependencies []string `json:"dependencies,omitempty"`
// the profile which is expected by this kit
Profile TraitProfile `json:"profile,omitempty"`
// traits that the kit will execute
- Traits map[string]TraitSpec `json:"traits,omitempty"`
+ Traits IntegrationKitTraits `json:"traits,omitempty"`
// configuration used by the kit
// TODO: we should deprecate in future releases in favour of mount, openapi or camel traits
Configuration []ConfigurationSpec `json:"configuration,omitempty"`
@@ -65,6 +65,12 @@ type IntegrationKitSpec struct {
Repositories []string `json:"repositories,omitempty"`
}
+// IntegrationKitTraits defines traits assigned to an `IntegrationKit`
+type IntegrationKitTraits struct {
+ Builder *BuilderTrait `property:"builder" json:"builder,omitempty"`
+ Quarkus *QuarkusTrait `property:"quarkus" json:"quarkus,omitempty"`
+}
+
// IntegrationKitStatus defines the observed state of IntegrationKit
type IntegrationKitStatus struct {
// ObservedGeneration is the most recent generation observed for this IntegrationKit.
diff --git a/pkg/apis/camel/v1/integrationplatform_types.go b/pkg/apis/camel/v1/integrationplatform_types.go
index 8a71a21dd..b2265c0ce 100644
--- a/pkg/apis/camel/v1/integrationplatform_types.go
+++ b/pkg/apis/camel/v1/integrationplatform_types.go
@@ -37,7 +37,7 @@ type IntegrationPlatformSpec struct {
// Deprecated: not used
Resources IntegrationPlatformResourcesSpec `json:"resources,omitempty"`
// list of traits to be executed for all the Integration/IntegrationKits built from this IntegrationPlatform
- Traits map[string]TraitSpec `json:"traits,omitempty"`
+ Traits Traits `json:"traits,omitempty"`
// list of configuration properties to be attached to all the Integration/IntegrationKits built from this IntegrationPlatform
Configuration []ConfigurationSpec `json:"configuration,omitempty"`
// configuration to be executed to all Kamelets controlled by this IntegrationPlatform
diff --git a/pkg/apis/camel/v1/trait_affinity.go b/pkg/apis/camel/v1/trait_affinity.go
new file mode 100644
index 000000000..c710c86cf
--- /dev/null
+++ b/pkg/apis/camel/v1/trait_affinity.go
@@ -0,0 +1,40 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+// Allows constraining which nodes the integration pod(s) are eligible to be scheduled on, based on labels on the node,
+// or with inter-pod affinity and anti-affinity, based on labels on pods that are already running on the nodes.
+//
+// It's disabled by default.
+//
+// +camel-k:trait=affinity.
+type AffinityTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // Always co-locates multiple replicas of the integration in the same node (default *false*).
+ PodAffinity *bool `property:"pod-affinity" json:"podAffinity,omitempty"`
+ // Never co-locates multiple replicas of the integration in the same node (default *false*).
+ PodAntiAffinity *bool `property:"pod-anti-affinity" json:"podAntiAffinity,omitempty"`
+ // Defines a set of nodes the integration pod(s) are eligible to be scheduled on, based on labels on the node.
+ NodeAffinityLabels []string `property:"node-affinity-labels" json:"nodeAffinityLabels,omitempty"`
+ // Defines a set of pods (namely those matching the label selector, relative to the given namespace) that the
+ // integration pod(s) should be co-located with.
+ PodAffinityLabels []string `property:"pod-affinity-labels" json:"podAffinityLabels,omitempty"`
+ // Defines a set of pods (namely those matching the label selector, relative to the given namespace) that the
+ // integration pod(s) should not be co-located with.
+ PodAntiAffinityLabels []string `property:"pod-anti-affinity-labels" json:"podAntiAffinityLabels,omitempty"`
+}
diff --git a/pkg/util/test/trait.go b/pkg/apis/camel/v1/trait_base.go
similarity index 53%
copy from pkg/util/test/trait.go
copy to pkg/apis/camel/v1/trait_base.go
index 653194972..8cb984830 100644
--- a/pkg/util/test/trait.go
+++ b/pkg/apis/camel/v1/trait_base.go
@@ -15,41 +15,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package test
+package v1
-import (
- "encoding/json"
- "testing"
-
- "github.com/stretchr/testify/assert"
-
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
-)
-
-func TraitSpecFromMap(t *testing.T, spec map[string]interface{}) v1.TraitSpec {
- t.Helper()
-
- var trait v1.TraitSpec
-
- data, err := json.Marshal(spec)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait.Configuration)
- assert.Nil(t, err)
-
- return trait
-}
-
-func TraitSpecToMap(t *testing.T, spec v1.TraitSpec) map[string]string {
- t.Helper()
-
- trait := make(map[string]string)
-
- data, err := json.Marshal(spec.Configuration)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait)
- assert.Nil(t, err)
-
- return trait
+// Base type for all traits.
+type Trait struct {
+ // Can be used to enable or disable a trait. All traits share this common property.
+ Enabled *bool `property:"enabled" json:"enabled,omitempty"`
}
diff --git a/pkg/util/test/trait.go b/pkg/apis/camel/v1/trait_builder.go
similarity index 53%
copy from pkg/util/test/trait.go
copy to pkg/apis/camel/v1/trait_builder.go
index 653194972..c619284b2 100644
--- a/pkg/util/test/trait.go
+++ b/pkg/apis/camel/v1/trait_builder.go
@@ -15,41 +15,16 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package test
-
-import (
- "encoding/json"
- "testing"
-
- "github.com/stretchr/testify/assert"
-
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
-)
-
-func TraitSpecFromMap(t *testing.T, spec map[string]interface{}) v1.TraitSpec {
- t.Helper()
-
- var trait v1.TraitSpec
-
- data, err := json.Marshal(spec)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait.Configuration)
- assert.Nil(t, err)
-
- return trait
-}
-
-func TraitSpecToMap(t *testing.T, spec v1.TraitSpec) map[string]string {
- t.Helper()
-
- trait := make(map[string]string)
-
- data, err := json.Marshal(spec.Configuration)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait)
- assert.Nil(t, err)
-
- return trait
+package v1
+
+// The builder trait is internally used to determine the best strategy to
+// build and configure IntegrationKits.
+//
+// +camel-k:trait=builder.
+type BuilderTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // Enable verbose logging on build components that support it (e.g. Kaniko build pod).
+ Verbose *bool `property:"verbose" json:"verbose,omitempty"`
+ // A list of properties to be provided to the build task
+ Properties []string `property:"properties" json:"properties,omitempty"`
}
diff --git a/pkg/util/test/trait.go b/pkg/apis/camel/v1/trait_camel.go
similarity index 53%
copy from pkg/util/test/trait.go
copy to pkg/apis/camel/v1/trait_camel.go
index 653194972..55a63f665 100644
--- a/pkg/util/test/trait.go
+++ b/pkg/apis/camel/v1/trait_camel.go
@@ -15,41 +15,15 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package test
-
-import (
- "encoding/json"
- "testing"
-
- "github.com/stretchr/testify/assert"
-
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
-)
-
-func TraitSpecFromMap(t *testing.T, spec map[string]interface{}) v1.TraitSpec {
- t.Helper()
-
- var trait v1.TraitSpec
-
- data, err := json.Marshal(spec)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait.Configuration)
- assert.Nil(t, err)
-
- return trait
-}
-
-func TraitSpecToMap(t *testing.T, spec v1.TraitSpec) map[string]string {
- t.Helper()
-
- trait := make(map[string]string)
-
- data, err := json.Marshal(spec.Configuration)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait)
- assert.Nil(t, err)
-
- return trait
+package v1
+
+// The Camel trait can be used to configure versions of Apache Camel K runtime and related libraries, it cannot be disabled.
+//
+// +camel-k:trait=camel.
+type CamelTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // The camel-k-runtime version to use for the integration. It overrides the default version set in the Integration Platform.
+ RuntimeVersion string `property:"runtime-version" json:"runtimeVersion,omitempty"`
+ // A list of properties to be provided to the Integration runtime
+ Properties []string `property:"properties" json:"properties,omitempty"`
}
diff --git a/pkg/apis/camel/v1/trait_container.go b/pkg/apis/camel/v1/trait_container.go
new file mode 100644
index 000000000..c88b2be34
--- /dev/null
+++ b/pkg/apis/camel/v1/trait_container.go
@@ -0,0 +1,102 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+import corev1 "k8s.io/api/core/v1"
+
+// The Container trait can be used to configure properties of the container where the integration will run.
+//
+// It also provides configuration for Services associated to the container.
+//
+// +camel-k:trait=container
+// nolint: tagliatelle
+type ContainerTrait struct {
+ Trait `property:",squash" json:",inline"`
+
+ Auto *bool `property:"auto" json:"auto,omitempty"`
+
+ // The minimum amount of CPU required.
+ RequestCPU string `property:"request-cpu" json:"requestCPU,omitempty"`
+ // The minimum amount of memory required.
+ RequestMemory string `property:"request-memory" json:"requestMemory,omitempty"`
+ // The maximum amount of CPU required.
+ LimitCPU string `property:"limit-cpu" json:"limitCPU,omitempty"`
+ // The maximum amount of memory required.
+ LimitMemory string `property:"limit-memory" json:"limitMemory,omitempty"`
+
+ // Can be used to enable/disable exposure via kubernetes Service.
+ Expose *bool `property:"expose" json:"expose,omitempty"`
+ // To configure a different port exposed by the container (default `8080`).
+ Port int `property:"port" json:"port,omitempty"`
+ // To configure a different port name for the port exposed by the container. It defaults to `http` only when the `expose` parameter is true.
+ PortName string `property:"port-name" json:"portName,omitempty"`
+ // To configure under which service port the container port is to be exposed (default `80`).
+ ServicePort int `property:"service-port" json:"servicePort,omitempty"`
+ // To configure under which service port name the container port is to be exposed (default `http`).
+ ServicePortName string `property:"service-port-name" json:"servicePortName,omitempty"`
+ // The main container name. It's named `integration` by default.
+ Name string `property:"name" json:"name,omitempty"`
+ // The main container image
+ Image string `property:"image" json:"image,omitempty"`
+ // The pull policy: Always|Never|IfNotPresent
+ ImagePullPolicy corev1.PullPolicy `property:"image-pull-policy" json:"imagePullPolicy,omitempty"`
+
+ // DeprecatedProbesEnabled enable/disable probes on the container (default `false`)
+ // Deprecated: replaced by the health trait.
+ DeprecatedProbesEnabled *bool `property:"probes-enabled" json:"probesEnabled,omitempty"`
+ // Scheme to use when connecting. Defaults to HTTP. Applies to the liveness probe.
+ // Deprecated: replaced by the health trait.
+ DeprecatedLivenessScheme string `property:"liveness-scheme" json:"livenessScheme,omitempty"`
+ // Number of seconds after the container has started before liveness probes are initiated.
+ // Deprecated: replaced by the health trait.
+ DeprecatedLivenessInitialDelay int32 `property:"liveness-initial-delay" json:"livenessInitialDelay,omitempty"`
+ // Number of seconds after which the probe times out. Applies to the liveness probe.
+ // Deprecated: replaced by the health trait.
+ DeprecatedLivenessTimeout int32 `property:"liveness-timeout" json:"livenessTimeout,omitempty"`
+ // How often to perform the probe. Applies to the liveness probe.
+ // Deprecated: replaced by the health trait.
+ DeprecatedLivenessPeriod int32 `property:"liveness-period" json:"livenessPeriod,omitempty"`
+ // Minimum consecutive successes for the probe to be considered successful after having failed.
+ // Applies to the liveness probe.
+ // Deprecated: replaced by the health trait.
+ DeprecatedLivenessSuccessThreshold int32 `property:"liveness-success-threshold" json:"livenessSuccessThreshold,omitempty"`
+ // Minimum consecutive failures for the probe to be considered failed after having succeeded.
+ // Applies to the liveness probe.
+ // Deprecated: replaced by the health trait.
+ DeprecatedLivenessFailureThreshold int32 `property:"liveness-failure-threshold" json:"livenessFailureThreshold,omitempty"`
+ // Scheme to use when connecting. Defaults to HTTP. Applies to the readiness probe.
+ // Deprecated: replaced by the health trait.
+ DeprecatedReadinessScheme string `property:"readiness-scheme" json:"readinessScheme,omitempty"`
+ // Number of seconds after the container has started before readiness probes are initiated.
+ // Deprecated: replaced by the health trait.
+ DeprecatedReadinessInitialDelay int32 `property:"readiness-initial-delay" json:"readinessInitialDelay,omitempty"`
+ // Number of seconds after which the probe times out. Applies to the readiness probe.
+ // Deprecated: replaced by the health trait.
+ DeprecatedReadinessTimeout int32 `property:"readiness-timeout" json:"readinessTimeout,omitempty"`
+ // How often to perform the probe. Applies to the readiness probe.
+ // Deprecated: replaced by the health trait.
+ DeprecatedReadinessPeriod int32 `property:"readiness-period" json:"readinessPeriod,omitempty"`
+ // Minimum consecutive successes for the probe to be considered successful after having failed.
+ // Applies to the readiness probe.
+ // Deprecated: replaced by the health trait.
+ DeprecatedReadinessSuccessThreshold int32 `property:"readiness-success-threshold" json:"readinessSuccessThreshold,omitempty"`
+ // Minimum consecutive failures for the probe to be considered failed after having succeeded.
+ // Applies to the readiness probe.
+ // Deprecated: replaced by the health trait.
+ DeprecatedReadinessFailureThreshold int32 `property:"readiness-failure-threshold" json:"readinessFailureThreshold,omitempty"`
+}
diff --git a/pkg/apis/camel/v1/trait_cron.go b/pkg/apis/camel/v1/trait_cron.go
new file mode 100644
index 000000000..3f0578c71
--- /dev/null
+++ b/pkg/apis/camel/v1/trait_cron.go
@@ -0,0 +1,71 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+// The Cron trait can be used to customize the behaviour of periodic timer/cron based integrations.
+//
+// While normally an integration requires a pod to be always up and running, some periodic tasks, such as batch jobs,
+// require to be activated at specific hours of the day or with a periodic delay of minutes.
+// For such tasks, the cron trait can materialize the integration as a Kubernetes CronJob instead of a standard deployment,
+// in order to save resources when the integration does not need to be executed.
+//
+// Integrations that start from the following components are evaluated by the cron trait: `timer`, `cron`, `quartz`.
+//
+// The rules for using a Kubernetes CronJob are the following:
+// - `timer`: when periods can be written as cron expressions. E.g. `timer:tick?period=60000`.
+// - `cron`, `quartz`: when the cron expression does not contain seconds (or the "seconds" part is set to 0). E.g.
+// `cron:tab?schedule=0/2${plus}*{plus}*{plus}*{plus}?` or `quartz:trigger?cron=0{plus}0/2{plus}*{plus}*{plus}*{plus}?`.
+//
+// +camel-k:trait=cron.
+type CronTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // The CronJob schedule for the whole integration. If multiple routes are declared, they must have the same schedule for this
+ // mechanism to work correctly.
+ Schedule string `property:"schedule" json:"schedule,omitempty"`
+ // A comma separated list of the Camel components that need to be customized in order for them to work when the schedule is triggered externally by Kubernetes.
+ // A specific customizer is activated for each specified component. E.g. for the `timer` component, the `cron-timer` customizer is
+ // activated (it's present in the `org.apache.camel.k:camel-k-cron` library).
+ //
+ // Supported components are currently: `cron`, `timer` and `quartz`.
+ Components string `property:"components" json:"components,omitempty"`
+ // Use the default Camel implementation of the `cron` endpoint (`quartz`) instead of trying to materialize the integration
+ // as Kubernetes CronJob.
+ Fallback *bool `property:"fallback" json:"fallback,omitempty"`
+ // Specifies how to treat concurrent executions of a Job.
+ // Valid values are:
+ // - "Allow": allows CronJobs to run concurrently;
+ // - "Forbid" (default): forbids concurrent runs, skipping next run if previous run hasn't finished yet;
+ // - "Replace": cancels currently running job and replaces it with a new one
+ ConcurrencyPolicy string `property:"concurrency-policy" json:"concurrencyPolicy,omitempty"`
+ // Automatically deploy the integration as CronJob when all routes are
+ // either starting from a periodic consumer (only `cron`, `timer` and `quartz` are supported) or a passive consumer (e.g. `direct` is a passive consumer).
+ //
+ // It's required that all periodic consumers have the same period and it can be expressed as cron schedule (e.g. `1m` can be expressed as `0/1 * * * *`,
+ // while `35m` or `50s` cannot).
+ Auto *bool `property:"auto" json:"auto,omitempty"`
+ // Optional deadline in seconds for starting the job if it misses scheduled
+ // time for any reason. Missed jobs executions will be counted as failed ones.
+ StartingDeadlineSeconds *int64 `property:"starting-deadline-seconds" json:"startingDeadlineSeconds,omitempty"`
+ // Specifies the duration in seconds, relative to the start time, that the job
+ // may be continuously active before it is considered to be failed.
+ // It defaults to 60s.
+ ActiveDeadlineSeconds *int64 `property:"active-deadline-seconds" json:"activeDeadlineSeconds,omitempty"`
+ // Specifies the number of retries before marking the job failed.
+ // It defaults to 2.
+ BackoffLimit *int32 `property:"backoff-limit" json:"backoffLimit,omitempty"`
+}
diff --git a/pkg/util/test/trait.go b/pkg/apis/camel/v1/trait_dependencies.go
similarity index 53%
copy from pkg/util/test/trait.go
copy to pkg/apis/camel/v1/trait_dependencies.go
index 653194972..07a639ae8 100644
--- a/pkg/util/test/trait.go
+++ b/pkg/apis/camel/v1/trait_dependencies.go
@@ -15,41 +15,12 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package test
-
-import (
- "encoding/json"
- "testing"
-
- "github.com/stretchr/testify/assert"
-
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
-)
-
-func TraitSpecFromMap(t *testing.T, spec map[string]interface{}) v1.TraitSpec {
- t.Helper()
-
- var trait v1.TraitSpec
-
- data, err := json.Marshal(spec)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait.Configuration)
- assert.Nil(t, err)
-
- return trait
-}
-
-func TraitSpecToMap(t *testing.T, spec v1.TraitSpec) map[string]string {
- t.Helper()
-
- trait := make(map[string]string)
-
- data, err := json.Marshal(spec.Configuration)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait)
- assert.Nil(t, err)
-
- return trait
+package v1
+
+// The Dependencies trait is internally used to automatically add runtime dependencies based on the
+// integration that the user wants to run.
+//
+// +camel-k:trait=dependencies.
+type DependenciesTrait struct {
+ Trait `property:",squash" json:",inline"`
}
diff --git a/pkg/apis/camel/v1/trait_deployer.go b/pkg/apis/camel/v1/trait_deployer.go
new file mode 100644
index 000000000..a651d5ead
--- /dev/null
+++ b/pkg/apis/camel/v1/trait_deployer.go
@@ -0,0 +1,31 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+// The deployer trait is responsible for deploying the resources owned by the integration, and can be used
+// to explicitly select the underlying controller that will manage the integration pods.
+//
+// +camel-k:trait=deployer.
+type DeployerTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // Allows to explicitly select the desired deployment kind between `deployment`, `cron-job` or `knative-service` when creating the resources for running the integration.
+ Kind string `property:"kind" json:"kind,omitempty"`
+ // Use server-side apply to update the owned resources (default `true`).
+ // Note that it automatically falls back to client-side patching, if SSA is not available, e.g., on old Kubernetes clusters.
+ UseSSA *bool `property:"use-ssa" json:"useSSA,omitempty"`
+}
diff --git a/pkg/util/test/trait.go b/pkg/apis/camel/v1/trait_deployment.go
similarity index 53%
copy from pkg/util/test/trait.go
copy to pkg/apis/camel/v1/trait_deployment.go
index 653194972..e1df04b16 100644
--- a/pkg/util/test/trait.go
+++ b/pkg/apis/camel/v1/trait_deployment.go
@@ -15,41 +15,15 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package test
-
-import (
- "encoding/json"
- "testing"
-
- "github.com/stretchr/testify/assert"
-
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
-)
-
-func TraitSpecFromMap(t *testing.T, spec map[string]interface{}) v1.TraitSpec {
- t.Helper()
-
- var trait v1.TraitSpec
-
- data, err := json.Marshal(spec)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait.Configuration)
- assert.Nil(t, err)
-
- return trait
-}
-
-func TraitSpecToMap(t *testing.T, spec v1.TraitSpec) map[string]string {
- t.Helper()
-
- trait := make(map[string]string)
-
- data, err := json.Marshal(spec.Configuration)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait)
- assert.Nil(t, err)
-
- return trait
+package v1
+
+// The Deployment trait is responsible for generating the Kubernetes deployment that will make sure
+// the integration will run in the cluster.
+//
+// +camel-k:trait=deployment.
+type DeploymentTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // The maximum time in seconds for the deployment to make progress before it
+ // is considered to be failed. It defaults to 60s.
+ ProgressDeadlineSeconds *int32 `property:"progress-deadline-seconds" json:"progressDeadlineSeconds,omitempty"`
}
diff --git a/pkg/apis/camel/v1/trait_environment.go b/pkg/apis/camel/v1/trait_environment.go
new file mode 100644
index 000000000..e7d7c8055
--- /dev/null
+++ b/pkg/apis/camel/v1/trait_environment.go
@@ -0,0 +1,34 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+// The environment trait is used internally to inject standard environment variables in the integration container,
+// such as `NAMESPACE`, `POD_NAME` and others.
+//
+// +camel-k:trait=environment.
+type EnvironmentTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // Enables injection of `NAMESPACE` and `POD_NAME` environment variables (default `true`)
+ ContainerMeta *bool `property:"container-meta" json:"containerMeta,omitempty"`
+ // Propagates the `HTTP_PROXY`, `HTTPS_PROXY` and `NO_PROXY` environment variables (default `true`)
+ HTTPProxy *bool `property:"http-proxy" json:"httpProxy,omitempty"`
+ // A list of environment variables to be added to the integration container.
+ // The syntax is KEY=VALUE, e.g., `MY_VAR="my value"`.
+ // These take precedence over the previously defined environment variables.
+ Vars []string `property:"vars" json:"vars,omitempty"`
+}
diff --git a/pkg/util/test/trait.go b/pkg/apis/camel/v1/trait_error_handler.go
similarity index 53%
copy from pkg/util/test/trait.go
copy to pkg/apis/camel/v1/trait_error_handler.go
index 653194972..1638a1b9f 100644
--- a/pkg/util/test/trait.go
+++ b/pkg/apis/camel/v1/trait_error_handler.go
@@ -15,41 +15,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package test
-
-import (
- "encoding/json"
- "testing"
-
- "github.com/stretchr/testify/assert"
-
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
-)
-
-func TraitSpecFromMap(t *testing.T, spec map[string]interface{}) v1.TraitSpec {
- t.Helper()
-
- var trait v1.TraitSpec
-
- data, err := json.Marshal(spec)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait.Configuration)
- assert.Nil(t, err)
-
- return trait
-}
-
-func TraitSpecToMap(t *testing.T, spec v1.TraitSpec) map[string]string {
- t.Helper()
-
- trait := make(map[string]string)
-
- data, err := json.Marshal(spec.Configuration)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait)
- assert.Nil(t, err)
-
- return trait
+package v1
+
+// The error-handler is a platform trait used to inject Error Handler source into the integration runtime.
+//
+// +camel-k:trait=error-handler.
+type ErrorHandlerTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // The error handler ref name provided or found in application properties
+ ErrorHandlerRef string `property:"ref" json:"ref,omitempty"`
}
diff --git a/pkg/util/test/trait.go b/pkg/apis/camel/v1/trait_gc.go
similarity index 53%
copy from pkg/util/test/trait.go
copy to pkg/apis/camel/v1/trait_gc.go
index 653194972..c371952fe 100644
--- a/pkg/util/test/trait.go
+++ b/pkg/apis/camel/v1/trait_gc.go
@@ -15,41 +15,21 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package test
-
-import (
- "encoding/json"
- "testing"
-
- "github.com/stretchr/testify/assert"
-
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
-)
-
-func TraitSpecFromMap(t *testing.T, spec map[string]interface{}) v1.TraitSpec {
- t.Helper()
-
- var trait v1.TraitSpec
-
- data, err := json.Marshal(spec)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait.Configuration)
- assert.Nil(t, err)
-
- return trait
+package v1
+
+// The GC Trait garbage-collects all resources that are no longer necessary upon integration updates.
+//
+// +camel-k:trait=gc.
+type GCTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // Discovery client cache to be used, either `disabled`, `disk` or `memory` (default `memory`)
+ DiscoveryCache *DiscoveryCacheType `property:"discovery-cache" json:"discoveryCache,omitempty"`
}
-func TraitSpecToMap(t *testing.T, spec v1.TraitSpec) map[string]string {
- t.Helper()
-
- trait := make(map[string]string)
-
- data, err := json.Marshal(spec.Configuration)
- assert.Nil(t, err)
+type DiscoveryCacheType string
- err = json.Unmarshal(data, &trait)
- assert.Nil(t, err)
-
- return trait
-}
+const (
+ DisabledDiscoveryCache DiscoveryCacheType = "disabled"
+ DiskDiscoveryCache DiscoveryCacheType = "disk"
+ MemoryDiscoveryCache DiscoveryCacheType = "memory"
+)
diff --git a/pkg/apis/camel/v1/trait_health.go b/pkg/apis/camel/v1/trait_health.go
new file mode 100644
index 000000000..be7ae169d
--- /dev/null
+++ b/pkg/apis/camel/v1/trait_health.go
@@ -0,0 +1,57 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+// The health trait is responsible for configuring the health probes on the integration container.
+//
+// It's disabled by default.
+//
+// +camel-k:trait=health.
+type HealthTrait struct {
+ Trait `property:",squash" json:",inline"`
+
+ // Configures the liveness probe for the integration container (default `false`).
+ LivenessProbeEnabled *bool `property:"liveness-probe-enabled" json:"livenessProbeEnabled,omitempty"`
+ // Scheme to use when connecting to the liveness probe (default `HTTP`).
+ LivenessScheme string `property:"liveness-scheme" json:"livenessScheme,omitempty"`
+ // Number of seconds after the container has started before the liveness probe is initiated.
+ LivenessInitialDelay int32 `property:"liveness-initial-delay" json:"livenessInitialDelay,omitempty"`
+ // Number of seconds after which the liveness probe times out.
+ LivenessTimeout int32 `property:"liveness-timeout" json:"livenessTimeout,omitempty"`
+ // How often to perform the liveness probe.
+ LivenessPeriod int32 `property:"liveness-period" json:"livenessPeriod,omitempty"`
+ // Minimum consecutive successes for the liveness probe to be considered successful after having failed.
+ LivenessSuccessThreshold int32 `property:"liveness-success-threshold" json:"livenessSuccessThreshold,omitempty"`
+ // Minimum consecutive failures for the liveness probe to be considered failed after having succeeded.
+ LivenessFailureThreshold int32 `property:"liveness-failure-threshold" json:"livenessFailureThreshold,omitempty"`
+
+ // Configures the readiness probe for the integration container (default `true`).
+ ReadinessProbeEnabled *bool `property:"readiness-probe-enabled" json:"readinessProbeEnabled,omitempty"`
+ // Scheme to use when connecting to the readiness probe (default `HTTP`).
+ ReadinessScheme string `property:"readiness-scheme" json:"readinessScheme,omitempty"`
+ // Number of seconds after the container has started before the readiness probe is initiated.
+ ReadinessInitialDelay int32 `property:"readiness-initial-delay" json:"readinessInitialDelay,omitempty"`
+ // Number of seconds after which the readiness probe times out.
+ ReadinessTimeout int32 `property:"readiness-timeout" json:"readinessTimeout,omitempty"`
+ // How often to perform the readiness probe.
+ ReadinessPeriod int32 `property:"readiness-period" json:"readinessPeriod,omitempty"`
+ // Minimum consecutive successes for the readiness probe to be considered successful after having failed.
+ ReadinessSuccessThreshold int32 `property:"readiness-success-threshold" json:"readinessSuccessThreshold,omitempty"`
+ // Minimum consecutive failures for the readiness probe to be considered failed after having succeeded.
+ ReadinessFailureThreshold int32 `property:"readiness-failure-threshold" json:"readinessFailureThreshold,omitempty"`
+}
diff --git a/pkg/util/test/trait.go b/pkg/apis/camel/v1/trait_ingress.go
similarity index 53%
copy from pkg/util/test/trait.go
copy to pkg/apis/camel/v1/trait_ingress.go
index 653194972..db841d929 100644
--- a/pkg/util/test/trait.go
+++ b/pkg/apis/camel/v1/trait_ingress.go
@@ -15,41 +15,18 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package test
-
-import (
- "encoding/json"
- "testing"
-
- "github.com/stretchr/testify/assert"
-
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
-)
-
-func TraitSpecFromMap(t *testing.T, spec map[string]interface{}) v1.TraitSpec {
- t.Helper()
-
- var trait v1.TraitSpec
-
- data, err := json.Marshal(spec)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait.Configuration)
- assert.Nil(t, err)
-
- return trait
-}
-
-func TraitSpecToMap(t *testing.T, spec v1.TraitSpec) map[string]string {
- t.Helper()
-
- trait := make(map[string]string)
-
- data, err := json.Marshal(spec.Configuration)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait)
- assert.Nil(t, err)
-
- return trait
+package v1
+
+// The Ingress trait can be used to expose the service associated with the integration
+// to the outside world with a Kubernetes Ingress.
+//
+// It's enabled by default whenever a Service is added to the integration (through the `service` trait).
+//
+// +camel-k:trait=ingress.
+type IngressTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // **Required**. To configure the host exposed by the ingress.
+ Host string `property:"host" json:"host,omitempty"`
+ // To automatically add an ingress whenever the integration uses a HTTP endpoint consumer.
+ Auto *bool `property:"auto" json:"auto,omitempty"`
}
diff --git a/pkg/util/test/trait.go b/pkg/apis/camel/v1/trait_istio.go
similarity index 53%
copy from pkg/util/test/trait.go
copy to pkg/apis/camel/v1/trait_istio.go
index 653194972..6c19af1f8 100644
--- a/pkg/util/test/trait.go
+++ b/pkg/apis/camel/v1/trait_istio.go
@@ -15,41 +15,16 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package test
-
-import (
- "encoding/json"
- "testing"
-
- "github.com/stretchr/testify/assert"
-
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
-)
-
-func TraitSpecFromMap(t *testing.T, spec map[string]interface{}) v1.TraitSpec {
- t.Helper()
-
- var trait v1.TraitSpec
-
- data, err := json.Marshal(spec)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait.Configuration)
- assert.Nil(t, err)
-
- return trait
-}
-
-func TraitSpecToMap(t *testing.T, spec v1.TraitSpec) map[string]string {
- t.Helper()
-
- trait := make(map[string]string)
-
- data, err := json.Marshal(spec.Configuration)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait)
- assert.Nil(t, err)
-
- return trait
+package v1
+
+// The Istio trait allows configuring properties related to the Istio service mesh,
+// such as sidecar injection and outbound IP ranges.
+//
+// +camel-k:trait=istio.
+type IstioTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // Configures a (comma-separated) list of CIDR subnets that should not be intercepted by the Istio proxy (`10.0.0.0/8,172.16.0.0/12,192.168.0.0/16` by default).
+ Allow string `property:"allow" json:"allow,omitempty"`
+ // Forces the value for labels `sidecar.istio.io/inject`. By default the label is set to `true` on deployment and not set on Knative Service.
+ Inject *bool `property:"inject" json:"inject,omitempty"`
}
diff --git a/pkg/apis/camel/v1/trait_jolokia.go b/pkg/apis/camel/v1/trait_jolokia.go
new file mode 100644
index 000000000..62f0b4b29
--- /dev/null
+++ b/pkg/apis/camel/v1/trait_jolokia.go
@@ -0,0 +1,58 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+// The Jolokia trait activates and configures the Jolokia Java agent.
+//
+// See https://jolokia.org/reference/html/agents.html
+//
+// +camel-k:trait=jolokia
+// nolint: tagliatelle
+type JolokiaTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // The PEM encoded CA certification file path, used to verify client certificates,
+ // applicable when `protocol` is `https` and `use-ssl-client-authentication` is `true`
+ // (default `/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt` for OpenShift).
+ CaCert *string `property:"ca-cert" json:"CACert,omitempty"`
+ // The principal(s) which must be given in a client certificate to allow access to the Jolokia endpoint,
+ // applicable when `protocol` is `https` and `use-ssl-client-authentication` is `true`
+ // (default `clientPrincipal=cn=system:master-proxy`, `cn=hawtio-online.hawtio.svc` and `cn=fuse-console.fuse.svc` for OpenShift).
+ ClientPrincipal []string `property:"client-principal" json:"clientPrincipal,omitempty"`
+ // Listen for multicast requests (default `false`)
+ DiscoveryEnabled *bool `property:"discovery-enabled" json:"discoveryEnabled,omitempty"`
+ // Mandate the client certificate contains a client flag in the extended key usage section,
+ // applicable when `protocol` is `https` and `use-ssl-client-authentication` is `true`
+ // (default `true` for OpenShift).
+ ExtendedClientCheck *bool `property:"extended-client-check" json:"extendedClientCheck,omitempty"`
+ // The Host address to which the Jolokia agent should bind to. If `"\*"` or `"0.0.0.0"` is given,
+ // the servers binds to every network interface (default `"*"`).
+ Host *string `property:"host" json:"host,omitempty"`
+ // The password used for authentication, applicable when the `user` option is set.
+ Password *string `property:"password" json:"password,omitempty"`
+ // The Jolokia endpoint port (default `8778`).
+ Port int `property:"port" json:"port,omitempty"`
+ // The protocol to use, either `http` or `https` (default `https` for OpenShift)
+ Protocol *string `property:"protocol" json:"protocol,omitempty"`
+ // The user to be used for authentication
+ User *string `property:"user" json:"user,omitempty"`
+ // Whether client certificates should be used for authentication (default `true` for OpenShift).
+ UseSslClientAuthentication *bool `property:"use-ssl-client-authentication" json:"useSSLClientAuthentication,omitempty"`
+ // A list of additional Jolokia options as defined
+ // in https://jolokia.org/reference/html/agents.html#agent-jvm-config[JVM agent configuration options]
+ Options []string `property:"options" json:"options,omitempty"`
+}
diff --git a/pkg/apis/camel/v1/trait_jvm.go b/pkg/apis/camel/v1/trait_jvm.go
new file mode 100644
index 000000000..16d304033
--- /dev/null
+++ b/pkg/apis/camel/v1/trait_jvm.go
@@ -0,0 +1,37 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+// The JVM trait is used to configure the JVM that runs the integration.
+//
+// +camel-k:trait=jvm.
+type JVMTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // Activates remote debugging, so that a debugger can be attached to the JVM, e.g., using port-forwarding
+ Debug *bool `property:"debug" json:"debug,omitempty"`
+ // Suspends the target JVM immediately before the main class is loaded
+ DebugSuspend *bool `property:"debug-suspend" json:"debugSuspend,omitempty"`
+ // Prints the command used the start the JVM in the container logs (default `true`)
+ PrintCommand *bool `property:"print-command" json:"printCommand,omitempty"`
+ // Transport address at which to listen for the newly launched JVM (default `*:5005`)
+ DebugAddress string `property:"debug-address" json:"debugAddress,omitempty"`
+ // A list of JVM options
+ Options []string `property:"options" json:"options,omitempty"`
+ // Additional JVM classpath (use `Linux` classpath separator)
+ Classpath string `property:"classpath" json:"classpath,omitempty"`
+}
diff --git a/pkg/util/test/trait.go b/pkg/apis/camel/v1/trait_kamelets.go
similarity index 53%
copy from pkg/util/test/trait.go
copy to pkg/apis/camel/v1/trait_kamelets.go
index 653194972..80d8e0b5e 100644
--- a/pkg/util/test/trait.go
+++ b/pkg/apis/camel/v1/trait_kamelets.go
@@ -15,41 +15,15 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package test
-
-import (
- "encoding/json"
- "testing"
-
- "github.com/stretchr/testify/assert"
-
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
-)
-
-func TraitSpecFromMap(t *testing.T, spec map[string]interface{}) v1.TraitSpec {
- t.Helper()
-
- var trait v1.TraitSpec
-
- data, err := json.Marshal(spec)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait.Configuration)
- assert.Nil(t, err)
-
- return trait
-}
-
-func TraitSpecToMap(t *testing.T, spec v1.TraitSpec) map[string]string {
- t.Helper()
-
- trait := make(map[string]string)
-
- data, err := json.Marshal(spec.Configuration)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait)
- assert.Nil(t, err)
-
- return trait
+package v1
+
+// The kamelets trait is a platform trait used to inject Kamelets into the integration runtime.
+//
+// +camel-k:trait=kamelets.
+type KameletsTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // Automatically inject all referenced Kamelets and their default configuration (enabled by default)
+ Auto *bool `property:"auto" json:"auto,omitempty"`
+ // Comma separated list of Kamelet names to load into the current integration
+ List string `property:"list" json:"list,omitempty"`
}
diff --git a/pkg/apis/camel/v1/trait_knative.go b/pkg/apis/camel/v1/trait_knative.go
new file mode 100644
index 000000000..00ac879e0
--- /dev/null
+++ b/pkg/apis/camel/v1/trait_knative.go
@@ -0,0 +1,60 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+// The Knative trait automatically discovers addresses of Knative resources and inject them into the
+// running integration.
+//
+// The full Knative configuration is injected in the CAMEL_KNATIVE_CONFIGURATION in JSON format.
+// The Camel Knative component will then use the full configuration to configure the routes.
+//
+// The trait is enabled by default when the Knative profile is active.
+//
+// +camel-k:trait=knative.
+type KnativeTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // Can be used to inject a Knative complete configuration in JSON format.
+ Configuration string `property:"configuration" json:"configuration,omitempty"`
+ // List of channels used as source of integration routes.
+ // Can contain simple channel names or full Camel URIs.
+ ChannelSources []string `property:"channel-sources" json:"channelSources,omitempty"`
+ // List of channels used as destination of integration routes.
+ // Can contain simple channel names or full Camel URIs.
+ ChannelSinks []string `property:"channel-sinks" json:"channelSinks,omitempty"`
+ // List of channels used as source of integration routes.
+ EndpointSources []string `property:"endpoint-sources" json:"endpointSources,omitempty"`
+ // List of endpoints used as destination of integration routes.
+ // Can contain simple endpoint names or full Camel URIs.
+ EndpointSinks []string `property:"endpoint-sinks" json:"endpointSinks,omitempty"`
+ // List of event types that the integration will be subscribed to.
+ // Can contain simple event types or full Camel URIs (to use a specific broker different from "default").
+ EventSources []string `property:"event-sources" json:"eventSources,omitempty"`
+ // List of event types that the integration will produce.
+ // Can contain simple event types or full Camel URIs (to use a specific broker).
+ EventSinks []string `property:"event-sinks" json:"eventSinks,omitempty"`
+ // Enables filtering on events based on the header "ce-knativehistory". Since this header has been removed in newer versions of
+ // Knative, filtering is disabled by default.
+ FilterSourceChannels *bool `property:"filter-source-channels" json:"filterSourceChannels,omitempty"`
+ // Allows binding the integration to a sink via a Knative SinkBinding resource.
+ // This can be used when the integration targets a single sink.
+ // It's enabled by default when the integration targets a single sink
+ // (except when the integration is owned by a Knative source).
+ SinkBinding *bool `property:"sink-binding" json:"sinkBinding,omitempty"`
+ // Enable automatic discovery of all trait properties.
+ Auto *bool `property:"auto" json:"auto,omitempty"`
+}
diff --git a/pkg/apis/camel/v1/trait_knative_service.go b/pkg/apis/camel/v1/trait_knative_service.go
new file mode 100644
index 000000000..1bf07343d
--- /dev/null
+++ b/pkg/apis/camel/v1/trait_knative_service.go
@@ -0,0 +1,60 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+// The Knative Service trait allows configuring options when running the Integration as a Knative service, instead of
+// a standard Kubernetes Deployment.
+//
+// Running an Integration as a Knative Service enables auto-scaling (and scaling-to-zero), but those features
+// are only relevant when the Camel route(s) use(s) an HTTP endpoint consumer.
+//
+// +camel-k:trait=knative-service.
+type KnativeServiceTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // Configures the Knative autoscaling class property (e.g. to set `hpa.autoscaling.knative.dev` or `kpa.autoscaling.knative.dev` autoscaling).
+ //
+ // Refer to the Knative documentation for more information.
+ Class string `property:"autoscaling-class" json:"class,omitempty"`
+ // Configures the Knative autoscaling metric property (e.g. to set `concurrency` based or `cpu` based autoscaling).
+ //
+ // Refer to the Knative documentation for more information.
+ Metric string `property:"autoscaling-metric" json:"autoscalingMetric,omitempty"`
+ // Sets the allowed concurrency level or CPU percentage (depending on the autoscaling metric) for each Pod.
+ //
+ // Refer to the Knative documentation for more information.
+ Target *int `property:"autoscaling-target" json:"autoscalingTarget,omitempty"`
+ // The minimum number of Pods that should be running at any time for the integration. It's **zero** by default, meaning that
+ // the integration is scaled down to zero when not used for a configured amount of time.
+ //
+ // Refer to the Knative documentation for more information.
+ MinScale *int `property:"min-scale" json:"minScale,omitempty"`
+ // An upper bound for the number of Pods that can be running in parallel for the integration.
+ // Knative has its own cap value that depends on the installation.
+ //
+ // Refer to the Knative documentation for more information.
+ MaxScale *int `property:"max-scale" json:"maxScale,omitempty"`
+ // Enables to gradually shift traffic to the latest Revision and sets the rollout duration.
+ // It's disabled by default and must be expressed as a Golang `time.Duration` string representation,
+ // rounded to a second precision.
+ RolloutDuration string `property:"rollout-duration" json:"rolloutDuration,omitempty"`
+ // Automatically deploy the integration as Knative service when all conditions hold:
+ //
+ // * Integration is using the Knative profile
+ // * All routes are either starting from a HTTP based consumer or a passive consumer (e.g. `direct` is a passive consumer)
+ Auto *bool `property:"auto" json:"auto,omitempty"`
+}
diff --git a/pkg/apis/camel/v1/trait_logging.go b/pkg/apis/camel/v1/trait_logging.go
new file mode 100644
index 000000000..1f8946e27
--- /dev/null
+++ b/pkg/apis/camel/v1/trait_logging.go
@@ -0,0 +1,36 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+// The Logging trait is used to configure Integration runtime logging options (such as color and format).
+// The logging backend is provided by Quarkus, whose configuration is documented at https://quarkus.io/guides/logging.
+//
+// +camel-k:trait=logging.
+type LoggingTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // Colorize the log output
+ Color *bool `property:"color" json:"color,omitempty"`
+ // Logs message format
+ Format string `property:"format" json:"format,omitempty"`
+ // Adjust the logging level (defaults to INFO)
+ Level string `property:"level" json:"level,omitempty"`
+ // Output the logs in JSON
+ JSON *bool `property:"json" json:"json,omitempty"`
+ // Enable "pretty printing" of the JSON logs
+ JSONPrettyPrint *bool `property:"json-pretty-print" json:"jsonPrettyPrint,omitempty"`
+}
diff --git a/pkg/apis/camel/v1/trait_mount.go b/pkg/apis/camel/v1/trait_mount.go
new file mode 100644
index 000000000..1a498e406
--- /dev/null
+++ b/pkg/apis/camel/v1/trait_mount.go
@@ -0,0 +1,38 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+// The Mount trait can be used to configure volumes mounted on the Integration Pods.
+//
+// +camel-k:trait=mount
+// nolint: tagliatelle
+type MountTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // A list of configuration pointing to configmap/secret.
+ // The configuration are expected to be UTF-8 resources as they are processed by runtime Camel Context and tried to be parsed as property files.
+ // They are also made available on the classpath in order to ease their usage directly from the Route.
+ // Syntax: [configmap|secret]:name[/key], where name represents the resource name and key optionally represents the resource key to be filtered
+ Configs []string `property:"configs" json:"configs,omitempty"`
+ // A list of resources (text or binary content) pointing to configmap/secret.
+ // The resources are expected to be any resource type (text or binary content).
+ // The destination path can be either a default location or any path specified by the user.
+ // Syntax: [configmap|secret]:name[/key][@path], where name represents the resource name, key optionally represents the resource key to be filtered and path represents the destination path
+ Resources []string `property:"resources" json:"resources,omitempty"`
+ // A list of Persistent Volume Claims to be mounted. Syntax: [pvcname:/container/path]
+ Volumes []string `property:"volumes" json:"volumes,omitempty"`
+}
diff --git a/pkg/util/test/trait.go b/pkg/apis/camel/v1/trait_openapi.go
similarity index 53%
copy from pkg/util/test/trait.go
copy to pkg/apis/camel/v1/trait_openapi.go
index 653194972..e9bbf1fa7 100644
--- a/pkg/util/test/trait.go
+++ b/pkg/apis/camel/v1/trait_openapi.go
@@ -15,41 +15,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package test
-
-import (
- "encoding/json"
- "testing"
-
- "github.com/stretchr/testify/assert"
-
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
-)
-
-func TraitSpecFromMap(t *testing.T, spec map[string]interface{}) v1.TraitSpec {
- t.Helper()
-
- var trait v1.TraitSpec
-
- data, err := json.Marshal(spec)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait.Configuration)
- assert.Nil(t, err)
-
- return trait
-}
-
-func TraitSpecToMap(t *testing.T, spec v1.TraitSpec) map[string]string {
- t.Helper()
-
- trait := make(map[string]string)
-
- data, err := json.Marshal(spec.Configuration)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait)
- assert.Nil(t, err)
-
- return trait
+package v1
+
+// The OpenAPI DSL trait is internally used to allow creating integrations from a OpenAPI specs.
+//
+// +camel-k:trait=openapi.
+type OpenAPITrait struct {
+ Trait `property:",squash" json:",inline"`
+ // The configmaps holding the spec of the OpenAPI
+ Configmaps []string `property:"configmaps" json:"configmaps,omitempty"`
}
diff --git a/pkg/util/test/trait.go b/pkg/apis/camel/v1/trait_owner.go
similarity index 53%
copy from pkg/util/test/trait.go
copy to pkg/apis/camel/v1/trait_owner.go
index 653194972..7791aec31 100644
--- a/pkg/util/test/trait.go
+++ b/pkg/apis/camel/v1/trait_owner.go
@@ -15,41 +15,16 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package test
-
-import (
- "encoding/json"
- "testing"
-
- "github.com/stretchr/testify/assert"
-
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
-)
-
-func TraitSpecFromMap(t *testing.T, spec map[string]interface{}) v1.TraitSpec {
- t.Helper()
-
- var trait v1.TraitSpec
-
- data, err := json.Marshal(spec)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait.Configuration)
- assert.Nil(t, err)
-
- return trait
-}
-
-func TraitSpecToMap(t *testing.T, spec v1.TraitSpec) map[string]string {
- t.Helper()
-
- trait := make(map[string]string)
-
- data, err := json.Marshal(spec.Configuration)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait)
- assert.Nil(t, err)
-
- return trait
+package v1
+
+// The Owner trait ensures that all created resources belong to the integration being created
+// and transfers annotations and labels on the integration onto these owned resources.
+//
+// +camel-k:trait=owner.
+type OwnerTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // The set of annotations to be transferred
+ TargetAnnotations []string `property:"target-annotations" json:"targetAnnotations,omitempty"`
+ // The set of labels to be transferred
+ TargetLabels []string `property:"target-labels" json:"targetLabels,omitempty"`
}
diff --git a/pkg/apis/camel/v1/trait_pdb.go b/pkg/apis/camel/v1/trait_pdb.go
new file mode 100644
index 000000000..d99bd23b0
--- /dev/null
+++ b/pkg/apis/camel/v1/trait_pdb.go
@@ -0,0 +1,33 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+// The PDB trait allows to configure the PodDisruptionBudget resource for the Integration pods.
+//
+// +camel-k:trait=pdb.
+type PDBTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // The number of pods for the Integration that must still be available after an eviction.
+ // It can be either an absolute number or a percentage.
+ // Only one of `min-available` and `max-unavailable` can be specified.
+ MinAvailable string `property:"min-available" json:"minAvailable,omitempty"`
+ // The number of pods for the Integration that can be unavailable after an eviction.
+ // It can be either an absolute number or a percentage (default `1` if `min-available` is also not set).
+ // Only one of `max-unavailable` and `min-available` can be specified.
+ MaxUnavailable string `property:"max-unavailable" json:"maxUnavailable,omitempty"`
+}
diff --git a/pkg/apis/camel/v1/trait_platform.go b/pkg/apis/camel/v1/trait_platform.go
new file mode 100644
index 000000000..b16199478
--- /dev/null
+++ b/pkg/apis/camel/v1/trait_platform.go
@@ -0,0 +1,35 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+// The platform trait is a base trait that is used to assign an integration platform to an integration.
+//
+// In case the platform is missing, the trait is allowed to create a default platform.
+// This feature is especially useful in contexts where there's no need to provide a custom configuration for the platform
+// (e.g. on OpenShift the default settings work, since there's an embedded container image registry).
+//
+// +camel-k:trait=platform.
+type PlatformTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // To create a default (empty) platform when the platform is missing.
+ CreateDefault *bool `property:"create-default" json:"createDefault,omitempty"`
+ // Indicates if the platform should be created globally in the case of global operator (default true).
+ Global *bool `property:"global" json:"global,omitempty"`
+ // To automatically detect from the environment if a default platform can be created (it will be created on OpenShift only).
+ Auto *bool `property:"auto" json:"auto,omitempty"`
+}
diff --git a/pkg/util/test/trait.go b/pkg/apis/camel/v1/trait_pod.go
similarity index 53%
copy from pkg/util/test/trait.go
copy to pkg/apis/camel/v1/trait_pod.go
index 653194972..fe41bc552 100644
--- a/pkg/util/test/trait.go
+++ b/pkg/apis/camel/v1/trait_pod.go
@@ -15,41 +15,16 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package test
-
-import (
- "encoding/json"
- "testing"
-
- "github.com/stretchr/testify/assert"
-
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
-)
-
-func TraitSpecFromMap(t *testing.T, spec map[string]interface{}) v1.TraitSpec {
- t.Helper()
-
- var trait v1.TraitSpec
-
- data, err := json.Marshal(spec)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait.Configuration)
- assert.Nil(t, err)
-
- return trait
-}
-
-func TraitSpecToMap(t *testing.T, spec v1.TraitSpec) map[string]string {
- t.Helper()
-
- trait := make(map[string]string)
-
- data, err := json.Marshal(spec.Configuration)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait)
- assert.Nil(t, err)
-
- return trait
+package v1
+
+// The pod trait allows the customization of the Integration pods.
+// It applies the `PodSpecTemplate` struct contained in the Integration `.spec.podTemplate` field,
+// into the Integration deployment Pods template, using strategic merge patch.
+//
+// This can be used to customize the container where Camel routes execute,
+// by using the `integration` container name.
+//
+// +camel-k:trait=pod.
+type PodTrait struct {
+ Trait `property:",squash" json:",inline"`
}
diff --git a/pkg/apis/camel/v1/trait_prometheus.go b/pkg/apis/camel/v1/trait_prometheus.go
new file mode 100644
index 000000000..75054c5d1
--- /dev/null
+++ b/pkg/apis/camel/v1/trait_prometheus.go
@@ -0,0 +1,38 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+// The Prometheus trait configures a Prometheus-compatible endpoint. It also creates a `PodMonitor` resource,
+// so that the endpoint can be scraped automatically, when using the Prometheus operator.
+//
+// The metrics are exposed using MicroProfile Metrics.
+//
+// WARNING: The creation of the `PodMonitor` resource requires the https://github.com/coreos/prometheus-operator[Prometheus Operator]
+// custom resource definition to be installed.
+// You can set `pod-monitor` to `false` for the Prometheus trait to work without the Prometheus Operator.
+//
+// The Prometheus trait is disabled by default.
+//
+// +camel-k:trait=prometheus.
+type PrometheusTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // Whether a `PodMonitor` resource is created (default `true`).
+ PodMonitor *bool `property:"pod-monitor" json:"podMonitor,omitempty"`
+ // The `PodMonitor` resource labels, applicable when `pod-monitor` is `true`.
+ PodMonitorLabels []string `property:"pod-monitor-labels" json:"podMonitorLabels,omitempty"`
+}
diff --git a/pkg/apis/camel/v1/trait_pull_secret.go b/pkg/apis/camel/v1/trait_pull_secret.go
new file mode 100644
index 000000000..e80d8adf7
--- /dev/null
+++ b/pkg/apis/camel/v1/trait_pull_secret.go
@@ -0,0 +1,40 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+// The Pull Secret trait sets a pull secret on the pod,
+// to allow Kubernetes to retrieve the container image from an external registry.
+//
+// The pull secret can be specified manually or, in case you've configured authentication for an external container registry
+// on the `IntegrationPlatform`, the same secret is used to pull images.
+//
+// It's enabled by default whenever you configure authentication for an external container registry,
+// so it assumes that external registries are private.
+//
+// If your registry does not need authentication for pulling images, you can disable this trait.
+//
+// +camel-k:trait=pull-secret.
+type PullSecretTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // The pull secret name to set on the Pod. If left empty this is automatically taken from the `IntegrationPlatform` registry configuration.
+ SecretName string `property:"secret-name" json:"secretName,omitempty"`
+ // When using a global operator with a shared platform, this enables delegation of the `system:image-puller` cluster role on the operator namespace to the integration service account.
+ ImagePullerDelegation *bool `property:"image-puller-delegation" json:"imagePullerDelegation,omitempty"`
+ // Automatically configures the platform registry secret on the pod if it is of type `kubernetes.io/dockerconfigjson`.
+ Auto *bool `property:"auto" json:"auto,omitempty"`
+}
diff --git a/pkg/apis/camel/v1/trait_quarkus.go b/pkg/apis/camel/v1/trait_quarkus.go
new file mode 100644
index 000000000..6e2560278
--- /dev/null
+++ b/pkg/apis/camel/v1/trait_quarkus.go
@@ -0,0 +1,47 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+// The Quarkus trait configures the Quarkus runtime.
+//
+// It's enabled by default.
+//
+// NOTE: Compiling to a native executable, i.e. when using `package-type=native`, is only supported
+// for kamelets, as well as YAML and XML integrations.
+// It also requires at least 4GiB of memory, so the Pod running the native build, that is either
+// the operator Pod, or the build Pod (depending on the build strategy configured for the platform),
+// must have enough memory available.
+//
+// +camel-k:trait=quarkus.
+type QuarkusTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // The Quarkus package types, either `fast-jar` or `native` (default `fast-jar`).
+ // In case both `fast-jar` and `native` are specified, two `IntegrationKit` resources are created,
+ // with the `native` kit having precedence over the `fast-jar` one once ready.
+ // The order influences the resolution of the current kit for the integration.
+ // The kit corresponding to the first package type will be assigned to the
+ // integration in case no existing kit that matches the integration exists.
+ PackageTypes []QuarkusPackageType `property:"package-type" json:"packageTypes,omitempty"`
+}
+
+type QuarkusPackageType string
+
+const (
+ FastJarPackageType QuarkusPackageType = "fast-jar"
+ NativePackageType QuarkusPackageType = "native"
+)
diff --git a/pkg/util/test/trait.go b/pkg/apis/camel/v1/trait_registry.go
similarity index 53%
copy from pkg/util/test/trait.go
copy to pkg/apis/camel/v1/trait_registry.go
index 653194972..939cf01c7 100644
--- a/pkg/util/test/trait.go
+++ b/pkg/apis/camel/v1/trait_registry.go
@@ -15,41 +15,12 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package test
-
-import (
- "encoding/json"
- "testing"
-
- "github.com/stretchr/testify/assert"
-
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
-)
-
-func TraitSpecFromMap(t *testing.T, spec map[string]interface{}) v1.TraitSpec {
- t.Helper()
-
- var trait v1.TraitSpec
-
- data, err := json.Marshal(spec)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait.Configuration)
- assert.Nil(t, err)
-
- return trait
-}
-
-func TraitSpecToMap(t *testing.T, spec v1.TraitSpec) map[string]string {
- t.Helper()
-
- trait := make(map[string]string)
-
- data, err := json.Marshal(spec.Configuration)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait)
- assert.Nil(t, err)
-
- return trait
+package v1
+
+// The Registry trait sets up Maven to use the Image registry
+// as a Maven repository.
+//
+// +camel-k:trait=registry.
+type RegistryTrait struct {
+ Trait `property:",squash" json:",inline"`
}
diff --git a/pkg/apis/camel/v1/trait_route.go b/pkg/apis/camel/v1/trait_route.go
new file mode 100644
index 000000000..4276a39c3
--- /dev/null
+++ b/pkg/apis/camel/v1/trait_route.go
@@ -0,0 +1,80 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1
+
+// The Route trait can be used to configure the creation of OpenShift routes for the integration.
+//
+// The certificate and key contents may be sourced either from the local filesystem or in a Openshift `secret` object.
+// The user may use the parameters ending in `-secret` (example: `tls-certificate-secret`) to reference a certificate stored in a `secret`.
+// Parameters ending in `-secret` have higher priorities and in case the same route parameter is set, for example: `tls-key-secret` and `tls-key`,
+// then `tls-key-secret` is used.
+// The recommended approach to set the key and certificates is to use `secrets` to store their contents and use the
+// following parameters to reference them: `tls-certificate-secret`, `tls-key-secret`, `tls-ca-certificate-secret`, `tls-destination-ca-certificate-secret`
+// See the examples section at the end of this page to see the setup options.
+//
+// +camel-k:trait=route
+// nolint: tagliatelle
+type RouteTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // To configure the host exposed by the route.
+ Host string `property:"host" json:"host,omitempty"`
+ // The TLS termination type, like `edge`, `passthrough` or `reencrypt`.
+ //
+ // Refer to the OpenShift route documentation for additional information.
+ TLSTermination string `property:"tls-termination" json:"tlsTermination,omitempty"`
+ // The TLS certificate contents.
+ //
+ // Refer to the OpenShift route documentation for additional information.
+ TLSCertificate string `property:"tls-certificate" json:"tlsCertificate,omitempty"`
+ // The secret name and key reference to the TLS certificate. The format is "secret-name[/key-name]", the value represents the secret name, if there is only one key in the secret it will be read, otherwise you can set a key name separated with a "/".
+ //
+ // Refer to the OpenShift route documentation for additional information.
+ TLSCertificateSecret string `property:"tls-certificate-secret" json:"tlsCertificateSecret,omitempty"`
+ // The TLS certificate key contents.
+ //
+ // Refer to the OpenShift route documentation for additional information.
+ TLSKey string `property:"tls-key" json:"tlsKey,omitempty"`
+ // The secret name and key reference to the TLS certificate key. The format is "secret-name[/key-name]", the value represents the secret name, if there is only one key in the secret it will be read, otherwise you can set a key name separated with a "/".
+ //
+ // Refer to the OpenShift route documentation for additional information.
+ TLSKeySecret string `property:"tls-key-secret" json:"tlsKeySecret,omitempty"`
+ // The TLS CA certificate contents.
+ //
+ // Refer to the OpenShift route documentation for additional information.
+ TLSCACertificate string `property:"tls-ca-certificate" json:"tlsCACertificate,omitempty"`
+ // The secret name and key reference to the TLS CA certificate. The format is "secret-name[/key-name]", the value represents the secret name, if there is only one key in the secret it will be read, otherwise you can set a key name separated with a "/".
+ //
+ // Refer to the OpenShift route documentation for additional information.
+ TLSCACertificateSecret string `property:"tls-ca-certificate-secret" json:"tlsCACertificateSecret,omitempty"`
+ // The destination CA certificate provides the contents of the ca certificate of the final destination. When using reencrypt
+ // termination this file should be provided in order to have routers use it for health checks on the secure connection.
+ // If this field is not specified, the router may provide its own destination CA and perform hostname validation using
+ // the short service name (service.namespace.svc), which allows infrastructure generated certificates to automatically
+ // verify.
+ //
+ // Refer to the OpenShift route documentation for additional information.
+ TLSDestinationCACertificate string `property:"tls-destination-ca-certificate" json:"tlsDestinationCACertificate,omitempty"`
+ // The secret name and key reference to the destination CA certificate. The format is "secret-name[/key-name]", the value represents the secret name, if there is only one key in the secret it will be read, otherwise you can set a key name separated with a "/".
+ //
+ // Refer to the OpenShift route documentation for additional information.
+ TLSDestinationCACertificateSecret string `property:"tls-destination-ca-certificate-secret" json:"tlsDestinationCACertificateSecret,omitempty"`
+ // To configure how to deal with insecure traffic, e.g. `Allow`, `Disable` or `Redirect` traffic.
+ //
+ // Refer to the OpenShift route documentation for additional information.
+ TLSInsecureEdgeTerminationPolicy string `property:"tls-insecure-edge-termination-policy" json:"tlsInsecureEdgeTerminationPolicy,omitempty"`
+}
diff --git a/pkg/util/test/trait.go b/pkg/apis/camel/v1/trait_service.go
similarity index 53%
copy from pkg/util/test/trait.go
copy to pkg/apis/camel/v1/trait_service.go
index 653194972..19e9951e1 100644
--- a/pkg/util/test/trait.go
+++ b/pkg/apis/camel/v1/trait_service.go
@@ -15,41 +15,18 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package test
-
-import (
- "encoding/json"
- "testing"
-
- "github.com/stretchr/testify/assert"
-
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
-)
-
-func TraitSpecFromMap(t *testing.T, spec map[string]interface{}) v1.TraitSpec {
- t.Helper()
-
- var trait v1.TraitSpec
-
- data, err := json.Marshal(spec)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait.Configuration)
- assert.Nil(t, err)
-
- return trait
-}
-
-func TraitSpecToMap(t *testing.T, spec v1.TraitSpec) map[string]string {
- t.Helper()
-
- trait := make(map[string]string)
-
- data, err := json.Marshal(spec.Configuration)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait)
- assert.Nil(t, err)
-
- return trait
+package v1
+
+// The Service trait exposes the integration with a Service resource so that it can be accessed by other applications
+// (or integrations) in the same namespace.
+//
+// It's enabled by default if the integration depends on a Camel component that can expose a HTTP endpoint.
+//
+// +camel-k:trait=service.
+type ServiceTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // To automatically detect from the code if a Service needs to be created.
+ Auto *bool `property:"auto" json:"auto,omitempty"`
+ // Enable Service to be exposed as NodePort (default `false`).
+ NodePort *bool `property:"node-port" json:"nodePort,omitempty"`
}
diff --git a/pkg/util/test/trait.go b/pkg/apis/camel/v1/trait_service_binding.go
similarity index 53%
rename from pkg/util/test/trait.go
rename to pkg/apis/camel/v1/trait_service_binding.go
index 653194972..55d533735 100644
--- a/pkg/util/test/trait.go
+++ b/pkg/apis/camel/v1/trait_service_binding.go
@@ -15,41 +15,15 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package test
-
-import (
- "encoding/json"
- "testing"
-
- "github.com/stretchr/testify/assert"
-
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
-)
-
-func TraitSpecFromMap(t *testing.T, spec map[string]interface{}) v1.TraitSpec {
- t.Helper()
-
- var trait v1.TraitSpec
-
- data, err := json.Marshal(spec)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait.Configuration)
- assert.Nil(t, err)
-
- return trait
-}
-
-func TraitSpecToMap(t *testing.T, spec v1.TraitSpec) map[string]string {
- t.Helper()
-
- trait := make(map[string]string)
-
- data, err := json.Marshal(spec.Configuration)
- assert.Nil(t, err)
-
- err = json.Unmarshal(data, &trait)
- assert.Nil(t, err)
-
- return trait
+package v1
+
+// The Service Binding trait allows users to connect to Services in Kubernetes:
+// https://github.com/k8s-service-bindings/spec#service-binding
+// As the specification is still evolving this is subject to change.
+//
+// +camel-k:trait=service-binding.
+type ServiceBindingTrait struct {
+ Trait `property:",squash" json:",inline"`
+ // List of Services in the form [[apigroup/]version:]kind:[namespace/]name
+ Services []string `property:"services" json:"services,omitempty"`
}
diff --git a/pkg/trait/toleration.go b/pkg/apis/camel/v1/trait_toleration.go
similarity index 59%
copy from pkg/trait/toleration.go
copy to pkg/apis/camel/v1/trait_toleration.go
index 925d53d78..839ee2755 100644
--- a/pkg/trait/toleration.go
+++ b/pkg/apis/camel/v1/trait_toleration.go
@@ -15,16 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package trait
-
-import (
- "fmt"
-
- corev1 "k8s.io/api/core/v1"
- "k8s.io/utils/pointer"
-
- "github.com/apache/camel-k/pkg/util/kubernetes"
-)
+package v1
// This trait sets Tolerations over Integration pods. Tolerations allow (but do not require) the pods to schedule onto nodes with matching taints.
// See https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ for more details.
@@ -40,43 +31,8 @@ import (
// It's disabled by default.
//
// +camel-k:trait=toleration.
-type tolerationTrait struct {
- BaseTrait `property:",squash"`
+type TolerationTrait struct {
+ Trait `property:",squash" json:",inline"`
// The list of taints to tolerate, in the form `Key[=Value]:Effect[:Seconds]`
Taints []string `property:"taints" json:"taints,omitempty"`
}
-
-func newTolerationTrait() Trait {
- return &tolerationTrait{
- BaseTrait: NewBaseTrait("toleration", 1200),
- }
-}
-
-func (t *tolerationTrait) Configure(e *Environment) (bool, error) {
- if !pointer.BoolDeref(t.Enabled, false) {
- return false, nil
- }
-
- if len(t.Taints) == 0 {
- return false, fmt.Errorf("no taint was provided")
- }
-
- return e.IntegrationInRunningPhases(), nil
-}
-
-func (t *tolerationTrait) Apply(e *Environment) (err error) {
- tolerations, err := kubernetes.NewTolerations(t.Taints)
- if err != nil {
- return err
- }
- podSpec := e.GetIntegrationPodSpec()
-
- if podSpec == nil {
- return fmt.Errorf("could not find any integration deployment for %v", e.Integration.Name)
- }
- if podSpec.Tolerations == nil {
- podSpec.Tolerations = make([]corev1.Toleration, 0)
- }
- podSpec.Tolerations = append(podSpec.Tolerations, tolerations...)
- return nil
-}
diff --git a/pkg/apis/camel/v1/zz_generated.deepcopy.go b/pkg/apis/camel/v1/zz_generated.deepcopy.go
index 521ba3cce..683a3c02b 100644
--- a/pkg/apis/camel/v1/zz_generated.deepcopy.go
+++ b/pkg/apis/camel/v1/zz_generated.deepcopy.go
@@ -11,6 +11,47 @@ import (
"k8s.io/apimachinery/pkg/runtime"
)
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AffinityTrait) DeepCopyInto(out *AffinityTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.PodAffinity != nil {
+ in, out := &in.PodAffinity, &out.PodAffinity
+ *out = new(bool)
+ **out = **in
+ }
+ if in.PodAntiAffinity != nil {
+ in, out := &in.PodAntiAffinity, &out.PodAntiAffinity
+ *out = new(bool)
+ **out = **in
+ }
+ if in.NodeAffinityLabels != nil {
+ in, out := &in.NodeAffinityLabels, &out.NodeAffinityLabels
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.PodAffinityLabels != nil {
+ in, out := &in.PodAffinityLabels, &out.PodAffinityLabels
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.PodAntiAffinityLabels != nil {
+ in, out := &in.PodAntiAffinityLabels, &out.PodAntiAffinityLabels
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AffinityTrait.
+func (in *AffinityTrait) DeepCopy() *AffinityTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(AffinityTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Artifact) DeepCopyInto(out *Artifact) {
*out = *in
@@ -240,6 +281,32 @@ func (in *BuilderTask) DeepCopy() *BuilderTask {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *BuilderTrait) DeepCopyInto(out *BuilderTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Verbose != nil {
+ in, out := &in.Verbose, &out.Verbose
+ *out = new(bool)
+ **out = **in
+ }
+ if in.Properties != nil {
+ in, out := &in.Properties, &out.Properties
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BuilderTrait.
+func (in *BuilderTrait) DeepCopy() *BuilderTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(BuilderTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CamelArtifact) DeepCopyInto(out *CamelArtifact) {
*out = *in
@@ -497,6 +564,27 @@ func (in *CamelSchemeScope) DeepCopy() *CamelSchemeScope {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *CamelTrait) DeepCopyInto(out *CamelTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Properties != nil {
+ in, out := &in.Properties, &out.Properties
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CamelTrait.
+func (in *CamelTrait) DeepCopy() *CamelTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(CamelTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Capability) DeepCopyInto(out *Capability) {
*out = *in
@@ -539,6 +627,78 @@ func (in *ConfigurationSpec) DeepCopy() *ConfigurationSpec {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ContainerTrait) DeepCopyInto(out *ContainerTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Auto != nil {
+ in, out := &in.Auto, &out.Auto
+ *out = new(bool)
+ **out = **in
+ }
+ if in.Expose != nil {
+ in, out := &in.Expose, &out.Expose
+ *out = new(bool)
+ **out = **in
+ }
+ if in.DeprecatedProbesEnabled != nil {
+ in, out := &in.DeprecatedProbesEnabled, &out.DeprecatedProbesEnabled
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerTrait.
+func (in *ContainerTrait) DeepCopy() *ContainerTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(ContainerTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *CronTrait) DeepCopyInto(out *CronTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Fallback != nil {
+ in, out := &in.Fallback, &out.Fallback
+ *out = new(bool)
+ **out = **in
+ }
+ if in.Auto != nil {
+ in, out := &in.Auto, &out.Auto
+ *out = new(bool)
+ **out = **in
+ }
+ if in.StartingDeadlineSeconds != nil {
+ in, out := &in.StartingDeadlineSeconds, &out.StartingDeadlineSeconds
+ *out = new(int64)
+ **out = **in
+ }
+ if in.ActiveDeadlineSeconds != nil {
+ in, out := &in.ActiveDeadlineSeconds, &out.ActiveDeadlineSeconds
+ *out = new(int64)
+ **out = **in
+ }
+ if in.BackoffLimit != nil {
+ in, out := &in.BackoffLimit, &out.BackoffLimit
+ *out = new(int32)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CronTrait.
+func (in *CronTrait) DeepCopy() *CronTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(CronTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DataSpec) DeepCopyInto(out *DataSpec) {
*out = *in
@@ -559,6 +719,106 @@ func (in *DataSpec) DeepCopy() *DataSpec {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *DependenciesTrait) DeepCopyInto(out *DependenciesTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DependenciesTrait.
+func (in *DependenciesTrait) DeepCopy() *DependenciesTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(DependenciesTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *DeployerTrait) DeepCopyInto(out *DeployerTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeployerTrait.
+func (in *DeployerTrait) DeepCopy() *DeployerTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(DeployerTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *DeploymentTrait) DeepCopyInto(out *DeploymentTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.ProgressDeadlineSeconds != nil {
+ in, out := &in.ProgressDeadlineSeconds, &out.ProgressDeadlineSeconds
+ *out = new(int32)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentTrait.
+func (in *DeploymentTrait) DeepCopy() *DeploymentTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(DeploymentTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *EnvironmentTrait) DeepCopyInto(out *EnvironmentTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.ContainerMeta != nil {
+ in, out := &in.ContainerMeta, &out.ContainerMeta
+ *out = new(bool)
+ **out = **in
+ }
+ if in.HTTPProxy != nil {
+ in, out := &in.HTTPProxy, &out.HTTPProxy
+ *out = new(bool)
+ **out = **in
+ }
+ if in.Vars != nil {
+ in, out := &in.Vars, &out.Vars
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentTrait.
+func (in *EnvironmentTrait) DeepCopy() *EnvironmentTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(EnvironmentTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ErrorHandlerTrait) DeepCopyInto(out *ErrorHandlerTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorHandlerTrait.
+func (in *ErrorHandlerTrait) DeepCopy() *ErrorHandlerTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(ErrorHandlerTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Failure) DeepCopyInto(out *Failure) {
*out = *in
@@ -612,6 +872,74 @@ func (in *Flow) DeepCopy() *Flow {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *GCTrait) DeepCopyInto(out *GCTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.DiscoveryCache != nil {
+ in, out := &in.DiscoveryCache, &out.DiscoveryCache
+ *out = new(DiscoveryCacheType)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCTrait.
+func (in *GCTrait) DeepCopy() *GCTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(GCTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *HealthTrait) DeepCopyInto(out *HealthTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.LivenessProbeEnabled != nil {
+ in, out := &in.LivenessProbeEnabled, &out.LivenessProbeEnabled
+ *out = new(bool)
+ **out = **in
+ }
+ if in.ReadinessProbeEnabled != nil {
+ in, out := &in.ReadinessProbeEnabled, &out.ReadinessProbeEnabled
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthTrait.
+func (in *HealthTrait) DeepCopy() *HealthTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(HealthTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *IngressTrait) DeepCopyInto(out *IngressTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Auto != nil {
+ in, out := &in.Auto, &out.Auto
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressTrait.
+func (in *IngressTrait) DeepCopy() *IngressTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(IngressTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Integration) DeepCopyInto(out *Integration) {
*out = *in
@@ -744,13 +1072,7 @@ func (in *IntegrationKitSpec) DeepCopyInto(out *IntegrationKitSpec) {
*out = make([]string, len(*in))
copy(*out, *in)
}
- if in.Traits != nil {
- in, out := &in.Traits, &out.Traits
- *out = make(map[string]TraitSpec, len(*in))
- for key, val := range *in {
- (*out)[key] = *val.DeepCopy()
- }
- }
+ in.Traits.DeepCopyInto(&out.Traits)
if in.Configuration != nil {
in, out := &in.Configuration, &out.Configuration
*out = make([]ConfigurationSpec, len(*in))
@@ -805,6 +1127,31 @@ func (in *IntegrationKitStatus) DeepCopy() *IntegrationKitStatus {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *IntegrationKitTraits) DeepCopyInto(out *IntegrationKitTraits) {
+ *out = *in
+ if in.Builder != nil {
+ in, out := &in.Builder, &out.Builder
+ *out = new(BuilderTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Quarkus != nil {
+ in, out := &in.Quarkus, &out.Quarkus
+ *out = new(QuarkusTrait)
+ (*in).DeepCopyInto(*out)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntegrationKitTraits.
+func (in *IntegrationKitTraits) DeepCopy() *IntegrationKitTraits {
+ if in == nil {
+ return nil
+ }
+ out := new(IntegrationKitTraits)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *IntegrationList) DeepCopyInto(out *IntegrationList) {
*out = *in
@@ -1002,13 +1349,7 @@ func (in *IntegrationPlatformSpec) DeepCopyInto(out *IntegrationPlatformSpec) {
*out = *in
in.Build.DeepCopyInto(&out.Build)
out.Resources = in.Resources
- if in.Traits != nil {
- in, out := &in.Traits, &out.Traits
- *out = make(map[string]TraitSpec, len(*in))
- for key, val := range *in {
- (*out)[key] = *val.DeepCopy()
- }
- }
+ in.Traits.DeepCopyInto(&out.Traits)
if in.Configuration != nil {
in, out := &in.Configuration, &out.Configuration
*out = make([]ConfigurationSpec, len(*in))
@@ -1096,13 +1437,7 @@ func (in *IntegrationSpec) DeepCopyInto(out *IntegrationSpec) {
*out = make([]string, len(*in))
copy(*out, *in)
}
- if in.Traits != nil {
- in, out := &in.Traits, &out.Traits
- *out = make(map[string]TraitSpec, len(*in))
- for key, val := range *in {
- (*out)[key] = *val.DeepCopy()
- }
- }
+ in.Traits.DeepCopyInto(&out.Traits)
if in.PodTemplate != nil {
in, out := &in.PodTemplate, &out.PodTemplate
*out = new(PodSpecTemplate)
@@ -1196,12 +1531,156 @@ func (in *IntegrationStatus) DeepCopy() *IntegrationStatus {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *KanikoTask) DeepCopyInto(out *KanikoTask) {
+func (in *IstioTrait) DeepCopyInto(out *IstioTrait) {
*out = *in
- out.BaseTask = in.BaseTask
- out.PublishTask = in.PublishTask
- if in.Verbose != nil {
- in, out := &in.Verbose, &out.Verbose
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Inject != nil {
+ in, out := &in.Inject, &out.Inject
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IstioTrait.
+func (in *IstioTrait) DeepCopy() *IstioTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(IstioTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *JVMTrait) DeepCopyInto(out *JVMTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Debug != nil {
+ in, out := &in.Debug, &out.Debug
+ *out = new(bool)
+ **out = **in
+ }
+ if in.DebugSuspend != nil {
+ in, out := &in.DebugSuspend, &out.DebugSuspend
+ *out = new(bool)
+ **out = **in
+ }
+ if in.PrintCommand != nil {
+ in, out := &in.PrintCommand, &out.PrintCommand
+ *out = new(bool)
+ **out = **in
+ }
+ if in.Options != nil {
+ in, out := &in.Options, &out.Options
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JVMTrait.
+func (in *JVMTrait) DeepCopy() *JVMTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(JVMTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *JolokiaTrait) DeepCopyInto(out *JolokiaTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.CaCert != nil {
+ in, out := &in.CaCert, &out.CaCert
+ *out = new(string)
+ **out = **in
+ }
+ if in.ClientPrincipal != nil {
+ in, out := &in.ClientPrincipal, &out.ClientPrincipal
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.DiscoveryEnabled != nil {
+ in, out := &in.DiscoveryEnabled, &out.DiscoveryEnabled
+ *out = new(bool)
+ **out = **in
+ }
+ if in.ExtendedClientCheck != nil {
+ in, out := &in.ExtendedClientCheck, &out.ExtendedClientCheck
+ *out = new(bool)
+ **out = **in
+ }
+ if in.Host != nil {
+ in, out := &in.Host, &out.Host
+ *out = new(string)
+ **out = **in
+ }
+ if in.Password != nil {
+ in, out := &in.Password, &out.Password
+ *out = new(string)
+ **out = **in
+ }
+ if in.Protocol != nil {
+ in, out := &in.Protocol, &out.Protocol
+ *out = new(string)
+ **out = **in
+ }
+ if in.User != nil {
+ in, out := &in.User, &out.User
+ *out = new(string)
+ **out = **in
+ }
+ if in.UseSslClientAuthentication != nil {
+ in, out := &in.UseSslClientAuthentication, &out.UseSslClientAuthentication
+ *out = new(bool)
+ **out = **in
+ }
+ if in.Options != nil {
+ in, out := &in.Options, &out.Options
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JolokiaTrait.
+func (in *JolokiaTrait) DeepCopy() *JolokiaTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(JolokiaTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *KameletsTrait) DeepCopyInto(out *KameletsTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Auto != nil {
+ in, out := &in.Auto, &out.Auto
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KameletsTrait.
+func (in *KameletsTrait) DeepCopy() *KameletsTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(KameletsTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *KanikoTask) DeepCopyInto(out *KanikoTask) {
+ *out = *in
+ out.BaseTask = in.BaseTask
+ out.PublishTask = in.PublishTask
+ if in.Verbose != nil {
+ in, out := &in.Verbose, &out.Verbose
*out = new(bool)
**out = **in
}
@@ -1238,6 +1717,134 @@ func (in *KanikoTaskCache) DeepCopy() *KanikoTaskCache {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *KnativeServiceTrait) DeepCopyInto(out *KnativeServiceTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Target != nil {
+ in, out := &in.Target, &out.Target
+ *out = new(int)
+ **out = **in
+ }
+ if in.MinScale != nil {
+ in, out := &in.MinScale, &out.MinScale
+ *out = new(int)
+ **out = **in
+ }
+ if in.MaxScale != nil {
+ in, out := &in.MaxScale, &out.MaxScale
+ *out = new(int)
+ **out = **in
+ }
+ if in.Auto != nil {
+ in, out := &in.Auto, &out.Auto
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KnativeServiceTrait.
+func (in *KnativeServiceTrait) DeepCopy() *KnativeServiceTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(KnativeServiceTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *KnativeTrait) DeepCopyInto(out *KnativeTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.ChannelSources != nil {
+ in, out := &in.ChannelSources, &out.ChannelSources
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.ChannelSinks != nil {
+ in, out := &in.ChannelSinks, &out.ChannelSinks
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.EndpointSources != nil {
+ in, out := &in.EndpointSources, &out.EndpointSources
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.EndpointSinks != nil {
+ in, out := &in.EndpointSinks, &out.EndpointSinks
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.EventSources != nil {
+ in, out := &in.EventSources, &out.EventSources
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.EventSinks != nil {
+ in, out := &in.EventSinks, &out.EventSinks
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.FilterSourceChannels != nil {
+ in, out := &in.FilterSourceChannels, &out.FilterSourceChannels
+ *out = new(bool)
+ **out = **in
+ }
+ if in.SinkBinding != nil {
+ in, out := &in.SinkBinding, &out.SinkBinding
+ *out = new(bool)
+ **out = **in
+ }
+ if in.Auto != nil {
+ in, out := &in.Auto, &out.Auto
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KnativeTrait.
+func (in *KnativeTrait) DeepCopy() *KnativeTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(KnativeTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *LoggingTrait) DeepCopyInto(out *LoggingTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Color != nil {
+ in, out := &in.Color, &out.Color
+ *out = new(bool)
+ **out = **in
+ }
+ if in.JSON != nil {
+ in, out := &in.JSON, &out.JSON
+ *out = new(bool)
+ **out = **in
+ }
+ if in.JSONPrettyPrint != nil {
+ in, out := &in.JSONPrettyPrint, &out.JSONPrettyPrint
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoggingTrait.
+func (in *LoggingTrait) DeepCopy() *LoggingTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(LoggingTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MavenArtifact) DeepCopyInto(out *MavenArtifact) {
*out = *in
@@ -1327,6 +1934,131 @@ func (in *MavenSpec) DeepCopy() *MavenSpec {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MountTrait) DeepCopyInto(out *MountTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Configs != nil {
+ in, out := &in.Configs, &out.Configs
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.Resources != nil {
+ in, out := &in.Resources, &out.Resources
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.Volumes != nil {
+ in, out := &in.Volumes, &out.Volumes
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MountTrait.
+func (in *MountTrait) DeepCopy() *MountTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(MountTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *OpenAPITrait) DeepCopyInto(out *OpenAPITrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Configmaps != nil {
+ in, out := &in.Configmaps, &out.Configmaps
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenAPITrait.
+func (in *OpenAPITrait) DeepCopy() *OpenAPITrait {
+ if in == nil {
+ return nil
+ }
+ out := new(OpenAPITrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *OwnerTrait) DeepCopyInto(out *OwnerTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.TargetAnnotations != nil {
+ in, out := &in.TargetAnnotations, &out.TargetAnnotations
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.TargetLabels != nil {
+ in, out := &in.TargetLabels, &out.TargetLabels
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OwnerTrait.
+func (in *OwnerTrait) DeepCopy() *OwnerTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(OwnerTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PDBTrait) DeepCopyInto(out *PDBTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDBTrait.
+func (in *PDBTrait) DeepCopy() *PDBTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(PDBTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PlatformTrait) DeepCopyInto(out *PlatformTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.CreateDefault != nil {
+ in, out := &in.CreateDefault, &out.CreateDefault
+ *out = new(bool)
+ **out = **in
+ }
+ if in.Global != nil {
+ in, out := &in.Global, &out.Global
+ *out = new(bool)
+ **out = **in
+ }
+ if in.Auto != nil {
+ in, out := &in.Auto, &out.Auto
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlatformTrait.
+func (in *PlatformTrait) DeepCopy() *PlatformTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(PlatformTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PodSpec) DeepCopyInto(out *PodSpec) {
*out = *in
@@ -1411,6 +2143,48 @@ func (in *PodSpecTemplate) DeepCopy() *PodSpecTemplate {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PodTrait) DeepCopyInto(out *PodTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodTrait.
+func (in *PodTrait) DeepCopy() *PodTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(PodTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PrometheusTrait) DeepCopyInto(out *PrometheusTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.PodMonitor != nil {
+ in, out := &in.PodMonitor, &out.PodMonitor
+ *out = new(bool)
+ **out = **in
+ }
+ if in.PodMonitorLabels != nil {
+ in, out := &in.PodMonitorLabels, &out.PodMonitorLabels
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusTrait.
+func (in *PrometheusTrait) DeepCopy() *PrometheusTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(PrometheusTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in Properties) DeepCopyInto(out *Properties) {
{
@@ -1448,6 +2222,53 @@ func (in *PublishTask) DeepCopy() *PublishTask {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PullSecretTrait) DeepCopyInto(out *PullSecretTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.ImagePullerDelegation != nil {
+ in, out := &in.ImagePullerDelegation, &out.ImagePullerDelegation
+ *out = new(bool)
+ **out = **in
+ }
+ if in.Auto != nil {
+ in, out := &in.Auto, &out.Auto
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PullSecretTrait.
+func (in *PullSecretTrait) DeepCopy() *PullSecretTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(PullSecretTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *QuarkusTrait) DeepCopyInto(out *QuarkusTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.PackageTypes != nil {
+ in, out := &in.PackageTypes, &out.PackageTypes
+ *out = make([]QuarkusPackageType, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QuarkusTrait.
+func (in *QuarkusTrait) DeepCopy() *QuarkusTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(QuarkusTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in RawMessage) DeepCopyInto(out *RawMessage) {
{
@@ -1482,6 +2303,22 @@ func (in *RegistrySpec) DeepCopy() *RegistrySpec {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *RegistryTrait) DeepCopyInto(out *RegistryTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistryTrait.
+func (in *RegistryTrait) DeepCopy() *RegistryTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(RegistryTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Repository) DeepCopyInto(out *Repository) {
*out = *in
@@ -1530,6 +2367,22 @@ func (in *ResourceSpec) DeepCopy() *ResourceSpec {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *RouteTrait) DeepCopyInto(out *RouteTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteTrait.
+func (in *RouteTrait) DeepCopy() *RouteTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(RouteTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RuntimeSpec) DeepCopyInto(out *RuntimeSpec) {
*out = *in
@@ -1603,6 +2456,53 @@ func (in *Server) DeepCopy() *Server {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ServiceBindingTrait) DeepCopyInto(out *ServiceBindingTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Services != nil {
+ in, out := &in.Services, &out.Services
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceBindingTrait.
+func (in *ServiceBindingTrait) DeepCopy() *ServiceBindingTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(ServiceBindingTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ServiceTrait) DeepCopyInto(out *ServiceTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Auto != nil {
+ in, out := &in.Auto, &out.Auto
+ *out = new(bool)
+ **out = **in
+ }
+ if in.NodePort != nil {
+ in, out := &in.NodePort, &out.NodePort
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceTrait.
+func (in *ServiceTrait) DeepCopy() *ServiceTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(ServiceTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SourceSpec) DeepCopyInto(out *SourceSpec) {
*out = *in
@@ -1687,37 +2587,222 @@ func (in *Task) DeepCopy() *Task {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *TraitConfiguration) DeepCopyInto(out *TraitConfiguration) {
+func (in *TolerationTrait) DeepCopyInto(out *TolerationTrait) {
*out = *in
- if in.RawMessage != nil {
- in, out := &in.RawMessage, &out.RawMessage
- *out = make(RawMessage, len(*in))
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Taints != nil {
+ in, out := &in.Taints, &out.Taints
+ *out = make([]string, len(*in))
copy(*out, *in)
}
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TraitConfiguration.
-func (in *TraitConfiguration) DeepCopy() *TraitConfiguration {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TolerationTrait.
+func (in *TolerationTrait) DeepCopy() *TolerationTrait {
if in == nil {
return nil
}
- out := new(TraitConfiguration)
+ out := new(TolerationTrait)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *TraitSpec) DeepCopyInto(out *TraitSpec) {
+func (in *Trait) DeepCopyInto(out *Trait) {
*out = *in
- in.Configuration.DeepCopyInto(&out.Configuration)
+ if in.Enabled != nil {
+ in, out := &in.Enabled, &out.Enabled
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Trait.
+func (in *Trait) DeepCopy() *Trait {
+ if in == nil {
+ return nil
+ }
+ out := new(Trait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Traits) DeepCopyInto(out *Traits) {
+ *out = *in
+ if in.Affinity != nil {
+ in, out := &in.Affinity, &out.Affinity
+ *out = new(AffinityTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Builder != nil {
+ in, out := &in.Builder, &out.Builder
+ *out = new(BuilderTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Camel != nil {
+ in, out := &in.Camel, &out.Camel
+ *out = new(CamelTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Container != nil {
+ in, out := &in.Container, &out.Container
+ *out = new(ContainerTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Cron != nil {
+ in, out := &in.Cron, &out.Cron
+ *out = new(CronTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Dependencies != nil {
+ in, out := &in.Dependencies, &out.Dependencies
+ *out = new(DependenciesTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Deployer != nil {
+ in, out := &in.Deployer, &out.Deployer
+ *out = new(DeployerTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Deployment != nil {
+ in, out := &in.Deployment, &out.Deployment
+ *out = new(DeploymentTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Environment != nil {
+ in, out := &in.Environment, &out.Environment
+ *out = new(EnvironmentTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.ErrorHandler != nil {
+ in, out := &in.ErrorHandler, &out.ErrorHandler
+ *out = new(ErrorHandlerTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.GC != nil {
+ in, out := &in.GC, &out.GC
+ *out = new(GCTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Health != nil {
+ in, out := &in.Health, &out.Health
+ *out = new(HealthTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Ingress != nil {
+ in, out := &in.Ingress, &out.Ingress
+ *out = new(IngressTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Istio != nil {
+ in, out := &in.Istio, &out.Istio
+ *out = new(IstioTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Jolokia != nil {
+ in, out := &in.Jolokia, &out.Jolokia
+ *out = new(JolokiaTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.JVM != nil {
+ in, out := &in.JVM, &out.JVM
+ *out = new(JVMTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Knative != nil {
+ in, out := &in.Knative, &out.Knative
+ *out = new(KnativeTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.KnativeService != nil {
+ in, out := &in.KnativeService, &out.KnativeService
+ *out = new(KnativeServiceTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Logging != nil {
+ in, out := &in.Logging, &out.Logging
+ *out = new(LoggingTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Mount != nil {
+ in, out := &in.Mount, &out.Mount
+ *out = new(MountTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.OpenAPI != nil {
+ in, out := &in.OpenAPI, &out.OpenAPI
+ *out = new(OpenAPITrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Owner != nil {
+ in, out := &in.Owner, &out.Owner
+ *out = new(OwnerTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.PDB != nil {
+ in, out := &in.PDB, &out.PDB
+ *out = new(PDBTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Platform != nil {
+ in, out := &in.Platform, &out.Platform
+ *out = new(PlatformTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Pod != nil {
+ in, out := &in.Pod, &out.Pod
+ *out = new(PodTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Prometheus != nil {
+ in, out := &in.Prometheus, &out.Prometheus
+ *out = new(PrometheusTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.PullSecret != nil {
+ in, out := &in.PullSecret, &out.PullSecret
+ *out = new(PullSecretTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Quarkus != nil {
+ in, out := &in.Quarkus, &out.Quarkus
+ *out = new(QuarkusTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Registry != nil {
+ in, out := &in.Registry, &out.Registry
+ *out = new(RegistryTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Route != nil {
+ in, out := &in.Route, &out.Route
+ *out = new(RouteTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Service != nil {
+ in, out := &in.Service, &out.Service
+ *out = new(ServiceTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.ServiceBinding != nil {
+ in, out := &in.ServiceBinding, &out.ServiceBinding
+ *out = new(ServiceBindingTrait)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Toleration != nil {
+ in, out := &in.Toleration, &out.Toleration
+ *out = new(TolerationTrait)
+ (*in).DeepCopyInto(*out)
+ }
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TraitSpec.
-func (in *TraitSpec) DeepCopy() *TraitSpec {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Traits.
+func (in *Traits) DeepCopy() *Traits {
if in == nil {
return nil
}
- out := new(TraitSpec)
+ out := new(Traits)
in.DeepCopyInto(out)
return out
}
diff --git a/pkg/cmd/bind.go b/pkg/cmd/bind.go
index 6a3073861..a5eac817e 100644
--- a/pkg/cmd/bind.go
+++ b/pkg/cmd/bind.go
@@ -158,7 +158,6 @@ func (o *bindCmdOptions) run(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
- catalog := trait.NewCatalog(client)
source, err := o.decode(args[0], sourceKey)
if err != nil {
@@ -210,11 +209,9 @@ func (o *bindCmdOptions) run(cmd *cobra.Command, args []string) error {
if binding.Spec.Integration == nil {
binding.Spec.Integration = &v1.IntegrationSpec{}
}
- traits, err := configureTraits(o.Traits, catalog)
- if err != nil {
+ if err := configureTraits(o.Traits, &binding.Spec.Integration.Traits); err != nil {
return err
}
- binding.Spec.Integration.Traits = traits
}
if o.OutputFormat != "" {
diff --git a/pkg/cmd/bind_test.go b/pkg/cmd/bind_test.go
index 72600ab6b..aa5778a5c 100644
--- a/pkg/cmd/bind_test.go
+++ b/pkg/cmd/bind_test.go
@@ -174,13 +174,11 @@ spec:
integration:
traits:
mount:
- configuration:
- configs:
- - configmap:my-cm
+ configs:
+ - configmap:my-cm
service-binding:
- configuration:
- services:
- - my-service-binding
+ services:
+ - my-service-binding
sink:
uri: my:dst
source:
diff --git a/pkg/cmd/debug.go b/pkg/cmd/debug.go
index 209927241..35f6c16f3 100644
--- a/pkg/cmd/debug.go
+++ b/pkg/cmd/debug.go
@@ -18,7 +18,6 @@ limitations under the License.
package cmd
import (
- "encoding/json"
"fmt"
"os"
"os/signal"
@@ -32,6 +31,7 @@ import (
"github.com/spf13/cobra"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/utils/pointer"
)
func newCmdDebug(rootCmdOptions *RootCmdOptions) (*cobra.Command, *debugCmdOptions) {
@@ -133,30 +133,18 @@ func (o *debugCmdOptions) run(cmd *cobra.Command, args []string) error {
// nolint: unparam
func (o *debugCmdOptions) toggleDebug(c camelv1.IntegrationsGetter, it *v1.Integration, active bool) (*v1.Integration, error) {
- if it.Spec.Traits == nil {
- it.Spec.Traits = make(map[string]v1.TraitSpec)
- }
- traitSpec := it.Spec.Traits["jvm"]
- jvmConfig := make(map[string]interface{})
- if len(traitSpec.Configuration.RawMessage) > 0 {
- if err := json.Unmarshal(traitSpec.Configuration.RawMessage, &jvmConfig); err != nil {
- return it, err
- }
+ if it.Spec.Traits.JVM == nil {
+ it.Spec.Traits.JVM = &v1.JVMTrait{}
}
+ jvmTrait := it.Spec.Traits.JVM
+
if active {
- jvmConfig["debug"] = true
- jvmConfig["debugSuspend"] = o.Suspend
+ jvmTrait.Debug = pointer.Bool(true)
+ jvmTrait.DebugSuspend = pointer.Bool(o.Suspend)
} else {
- delete(jvmConfig, "debug")
- delete(jvmConfig, "debugSuspend")
- }
-
- jvmConfigBytes, err := json.Marshal(jvmConfig)
- if err != nil {
- return it, err
+ jvmTrait.Debug = nil
+ jvmTrait.DebugSuspend = nil
}
- traitSpec.Configuration.RawMessage = jvmConfigBytes
- it.Spec.Traits["jvm"] = traitSpec
return c.Integrations(it.Namespace).Update(o.Context, it, metav1.UpdateOptions{})
}
diff --git a/pkg/cmd/describe.go b/pkg/cmd/describe.go
index 5471c091c..44e119f8e 100644
--- a/pkg/cmd/describe.go
+++ b/pkg/cmd/describe.go
@@ -18,7 +18,6 @@ limitations under the License.
package cmd
import (
- "encoding/json"
"strings"
"time"
@@ -26,7 +25,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ "github.com/apache/camel-k/pkg/trait"
"github.com/apache/camel-k/pkg/util/indentedwriter"
)
@@ -51,23 +50,19 @@ func describeObjectMeta(w *indentedwriter.Writer, om metav1.ObjectMeta) {
w.Writef(0, "Creation Timestamp:\t%s\n", om.CreationTimestamp.Format(time.RFC1123Z))
}
-func describeTraits(w *indentedwriter.Writer, traits map[string]v1.TraitSpec) error {
- if len(traits) > 0 {
+func describeTraits(w *indentedwriter.Writer, traits interface{}) error {
+ traitsMap, err := trait.ToMap(traits)
+ if err != nil {
+ return err
+ }
+
+ if len(traitsMap) > 0 {
w.Writef(0, "Traits:\n")
- for trait := range traits {
- w.Writef(1, "%s:\n", strings.Title(trait))
+ for id, trait := range traitsMap {
+ w.Writef(1, "%s:\n", strings.Title(id))
// TODO: print the whole TraitSpec as Yaml
- data, err := json.Marshal(traits[trait])
- if err != nil {
- return err
- }
- config := make(map[string]interface{})
- err = json.Unmarshal(data, &config)
- if err != nil {
- return err
- }
- for k, v := range config {
+ for k, v := range trait {
w.Writef(2, "%s:\t%v\n", strings.Title(k), v)
}
}
diff --git a/pkg/cmd/kit_create.go b/pkg/cmd/kit_create.go
index 512c17dc4..0979cf18e 100644
--- a/pkg/cmd/kit_create.go
+++ b/pkg/cmd/kit_create.go
@@ -157,7 +157,7 @@ func (command *kitCreateCommandOptions) run(cmd *cobra.Command, args []string) e
if err := command.parseAndConvertToTrait(command.Secrets, "mount.config"); err != nil {
return err
}
- if err := command.configureTraits(kit, command.Traits, catalog); err != nil {
+ if err := configureTraits(command.Traits, &kit.Spec.Traits); err != nil {
return err
}
existed := false
@@ -188,16 +188,6 @@ func (command *kitCreateCommandOptions) run(cmd *cobra.Command, args []string) e
return nil
}
-func (*kitCreateCommandOptions) configureTraits(kit *v1.IntegrationKit, options []string, catalog trait.Finder) error {
- traits, err := configureTraits(options, catalog)
- if err != nil {
- return err
- }
-
- kit.Spec.Traits = traits
-
- return nil
-}
func (command *kitCreateCommandOptions) parseAndConvertToTrait(params []string, traitParam string) error {
for _, param := range params {
command.Traits = append(command.Traits, convertToTrait(param, traitParam))
diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go
index ae9e3384c..e78f484ab 100644
--- a/pkg/cmd/run.go
+++ b/pkg/cmd/run.go
@@ -669,11 +669,9 @@ func (o *runCmdOptions) createOrUpdateIntegration(cmd *cobra.Command, c client.C
o.Traits = append(o.Traits, fmt.Sprintf("service-binding.services=%s", item))
}
if len(o.Traits) > 0 {
- traits, err := configureTraits(o.Traits, catalog)
- if err != nil {
+ if err := configureTraits(o.Traits, &integration.Spec.Traits); err != nil {
return nil, err
}
- integration.Spec.Traits = traits
}
if o.OutputFormat != "" {
diff --git a/pkg/cmd/run_test.go b/pkg/cmd/run_test.go
index 5e386c62e..f5c1dd350 100644
--- a/pkg/cmd/run_test.go
+++ b/pkg/cmd/run_test.go
@@ -360,21 +360,26 @@ func TestConfigureTraits(t *testing.T) {
if err != nil {
t.Error(err)
}
- client, err := runCmdOptions.GetCmdClient()
- if err != nil {
- t.Error(err)
- }
- catalog := trait.NewCatalog(client)
- traits, err := configureTraits(runCmdOptions.Traits, catalog)
+ traits := v1.Traits{}
+ err = configureTraits(runCmdOptions.Traits, &traits)
assert.Nil(t, err)
- assert.Len(t, traits, 5)
- assertTraitConfiguration(t, traits, "affinity", `{"podAffinity":false}`)
- assertTraitConfiguration(t, traits, "container", `{"probesEnabled":false}`)
- assertTraitConfiguration(t, traits, "environment", `{"containerMeta":false}`)
- assertTraitConfiguration(t, traits, "jvm", `{"printCommand":false}`)
- assertTraitConfiguration(t, traits, "prometheus", `{"podMonitor":false}`)
+ traitsMap, err := trait.ToMap(traits)
+ assert.Nil(t, err)
+ assert.Len(t, traitsMap, 5)
+ assertTraitConfiguration(t, traits.Affinity, &v1.AffinityTrait{PodAffinity: pointer.Bool(false)})
+ assertTraitConfiguration(t, traits.Container, &v1.ContainerTrait{DeprecatedProbesEnabled: pointer.Bool(false)})
+ assertTraitConfiguration(t, traits.Environment, &v1.EnvironmentTrait{ContainerMeta: pointer.Bool(false)})
+ assertTraitConfiguration(t, traits.JVM, &v1.JVMTrait{PrintCommand: pointer.Bool(false)})
+ assertTraitConfiguration(t, traits.Prometheus, &v1.PrometheusTrait{PodMonitor: pointer.Bool(false)})
+}
+
+func assertTraitConfiguration(t *testing.T, trait interface{}, expected interface{}) {
+ t.Helper()
+
+ assert.NotNil(t, trait)
+ assert.Equal(t, expected, trait)
}
type customTrait struct {
@@ -404,35 +409,6 @@ func (finder customTraitFinder) GetTrait(id string) trait.Trait {
return nil
}
-func TestTraitsNestedConfig(t *testing.T) {
- runCmdOptions, rootCmd, _ := initializeRunCmdOptions(t)
- _, err := test.ExecuteCommand(rootCmd, "run",
- "--trait", "custom.simple-map.a=b",
- "--trait", "custom.simple-map.y=z",
- "--trait", "custom.double-map.m.n=q",
- "--trait", "custom.double-map.m.o=w",
- "--trait", "custom.slice-of-map[0].f=g",
- "--trait", "custom.slice-of-map[3].f=h",
- "--trait", "custom.slice-of-map[2].f=i",
- "example.js")
- // We will have an error because those traits are not existing
- // however we want to test how those properties are mapped in the configuration
- assert.NotNil(t, err)
- catalog := &customTraitFinder{}
- traits, err := configureTraits(runCmdOptions.Traits, catalog)
-
- assert.Nil(t, err)
- assert.Len(t, traits, 1)
- assertTraitConfiguration(t, traits, "custom", `{"simpleMap":{"a":"b","y":"z"},"doubleMap":{"m":{"n":"q","o":"w"}},"sliceOfMap":[{"f":"g"},null,{"f":"i"},{"f":"h"}]}`)
-}
-
-func assertTraitConfiguration(t *testing.T, traits map[string]v1.TraitSpec, trait string, expected string) {
- t.Helper()
-
- assert.Contains(t, traits, trait)
- assert.Equal(t, expected, string(traits[trait].Configuration.RawMessage))
-}
-
func TestRunUseFlowsFlag(t *testing.T) {
runCmdOptions, rootCmd, _ := initializeRunCmdOptions(t)
_, err := test.ExecuteCommand(rootCmd, cmdRun, "--use-flows=false", integrationSource)
@@ -617,6 +593,7 @@ spec:
extends RouteBuilder {\n @Override\n public void configure() throws Exception
{\n\t from(\"timer:tick\")\n .log(\"Hello Camel K!\");\n }\n}\n"
name: %s
+ traits: {}
status: {}
`, fileName, fileName), output)
}
@@ -650,13 +627,11 @@ spec:
name: %s
traits:
mount:
- configuration:
- configs:
- - configmap:my-cm
+ configs:
+ - configmap:my-cm
service-binding:
- configuration:
- services:
- - my-service-binding
+ services:
+ - my-service-binding
status: {}
`, fileName, fileName), output)
}
diff --git a/pkg/cmd/trait_support.go b/pkg/cmd/trait_support.go
index 63fa23b9c..4d134a3a5 100644
--- a/pkg/cmd/trait_support.go
+++ b/pkg/cmd/trait_support.go
@@ -18,13 +18,10 @@ limitations under the License.
package cmd
import (
- "encoding/json"
"errors"
"fmt"
- "reflect"
"strings"
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
"github.com/apache/camel-k/pkg/trait"
"github.com/apache/camel-k/pkg/util"
"github.com/mitchellh/mapstructure"
@@ -46,32 +43,32 @@ func validateTraits(catalog *trait.Catalog, traits []string) error {
return nil
}
-func configureTraits(options []string, catalog trait.Finder) (map[string]v1.TraitSpec, error) {
- traits := make(map[string]map[string]interface{})
+func configureTraits(options []string, traits interface{}) error {
+ config := make(map[string]map[string]interface{})
for _, option := range options {
parts := traitConfigRegexp.FindStringSubmatch(option)
if len(parts) < 4 {
- return nil, errors.New("unrecognized config format (expected \"<trait>.<prop>=<value>\"): " + option)
+ return errors.New("unrecognized config format (expected \"<trait>.<prop>=<value>\"): " + option)
}
id := parts[1]
fullProp := parts[2][1:]
value := parts[3]
- if _, ok := traits[id]; !ok {
- traits[id] = make(map[string]interface{})
+ if _, ok := config[id]; !ok {
+ config[id] = make(map[string]interface{})
}
propParts := util.ConfigTreePropertySplit(fullProp)
- var current = traits[id]
+ var current = config[id]
if len(propParts) > 1 {
c, err := util.NavigateConfigTree(current, propParts[0:len(propParts)-1])
if err != nil {
- return nil, err
+ return err
}
if cc, ok := c.(map[string]interface{}); ok {
current = cc
} else {
- return nil, errors.New("trait configuration cannot end with a slice")
+ return errors.New("trait configuration cannot end with a slice")
}
}
@@ -91,41 +88,13 @@ func configureTraits(options []string, catalog trait.Finder) (map[string]v1.Trai
}
}
- specs := make(map[string]v1.TraitSpec)
- for id, config := range traits {
- t := catalog.GetTrait(id)
- if t != nil {
- // let's take a clone to prevent default values set at runtime from being serialized
- zero := reflect.New(reflect.TypeOf(t)).Interface()
- err := configureTrait(config, zero)
- if err != nil {
- return nil, err
- }
- data, err := json.Marshal(zero)
- if err != nil {
- return nil, err
- }
- var spec v1.TraitSpec
- err = json.Unmarshal(data, &spec.Configuration)
- if err != nil {
- return nil, err
- }
- specs[id] = spec
- }
- }
-
- return specs, nil
-}
-
-func configureTrait(config map[string]interface{}, trait interface{}) error {
md := mapstructure.Metadata{}
-
decoder, err := mapstructure.NewDecoder(
&mapstructure.DecoderConfig{
Metadata: &md,
WeaklyTypedInput: true,
TagName: "property",
- Result: &trait,
+ Result: &traits,
},
)
if err != nil {
diff --git a/pkg/controller/integration/kits.go b/pkg/controller/integration/kits.go
index 283104065..5e8c97f4a 100644
--- a/pkg/controller/integration/kits.go
+++ b/pkg/controller/integration/kits.go
@@ -19,7 +19,6 @@ package integration
import (
"context"
- "encoding/json"
"reflect"
"k8s.io/apimachinery/pkg/api/errors"
@@ -87,26 +86,10 @@ func integrationMatches(integration *v1.Integration, kit *v1.IntegrationKit) (bo
ilog := log.ForIntegration(integration)
ilog.Debug("Matching integration", "integration", integration.Name, "integration-kit", kit.Name, "namespace", integration.Namespace)
- if kit.Status.Phase == v1.IntegrationKitPhaseError {
- ilog.Debug("Integration kit has a phase of Error", "integration-kit", kit.Name, "namespace", integration.Namespace)
- return false, nil
- }
- if kit.Status.Version != integration.Status.Version {
- ilog.Debug("Integration and integration-kit versions do not match", "integration", integration.Name, "integration-kit", kit.Name, "namespace", integration.Namespace)
- return false, nil
- }
- if kit.Status.RuntimeProvider != integration.Status.RuntimeProvider {
- ilog.Debug("Integration and integration-kit runtime providers do not match", "integration", integration.Name, "integration-kit", kit.Name, "namespace", integration.Namespace)
- return false, nil
- }
- if kit.Status.RuntimeVersion != integration.Status.RuntimeVersion {
- ilog.Debug("Integration and integration-kit runtime versions do not match", "integration", integration.Name, "integration-kit", kit.Name, "namespace", integration.Namespace)
- return false, nil
- }
- if len(integration.Status.Dependencies) != len(kit.Spec.Dependencies) {
- ilog.Debug("Integration and integration-kit have different number of dependencies", "integration", integration.Name, "integration-kit", kit.Name, "namespace", integration.Namespace)
+ if !statusMatches(integration, kit, &ilog) {
return false, nil
}
+
// When a platform kit is created it inherits the traits from the integrations and as
// some traits may influence the build thus the artifacts present on the container image,
// we need to take traits into account when looking up for compatible kits.
@@ -130,6 +113,30 @@ func integrationMatches(integration *v1.Integration, kit *v1.IntegrationKit) (bo
return true, nil
}
+func statusMatches(integration *v1.Integration, kit *v1.IntegrationKit, ilog *log.Logger) bool {
+ if kit.Status.Phase == v1.IntegrationKitPhaseError {
+ ilog.Debug("Integration kit has a phase of Error", "integration-kit", kit.Name, "namespace", integration.Namespace)
+ return false
+ }
+ if kit.Status.Version != integration.Status.Version {
+ ilog.Debug("Integration and integration-kit versions do not match", "integration", integration.Name, "integration-kit", kit.Name, "namespace", integration.Namespace)
+ return false
+ }
+ if kit.Status.RuntimeProvider != integration.Status.RuntimeProvider {
+ ilog.Debug("Integration and integration-kit runtime providers do not match", "integration", integration.Name, "integration-kit", kit.Name, "namespace", integration.Namespace)
+ return false
+ }
+ if kit.Status.RuntimeVersion != integration.Status.RuntimeVersion {
+ ilog.Debug("Integration and integration-kit runtime versions do not match", "integration", integration.Name, "integration-kit", kit.Name, "namespace", integration.Namespace)
+ return false
+ }
+ if len(integration.Status.Dependencies) != len(kit.Spec.Dependencies) {
+ ilog.Debug("Integration and integration-kit have different number of dependencies", "integration", integration.Name, "integration-kit", kit.Name, "namespace", integration.Namespace)
+ }
+
+ return true
+}
+
// kitMatches returns whether the two v1.IntegrationKit match.
func kitMatches(kit1 *v1.IntegrationKit, kit2 *v1.IntegrationKit) (bool, error) {
version := kit1.Status.Version
@@ -149,132 +156,66 @@ func kitMatches(kit1 *v1.IntegrationKit, kit2 *v1.IntegrationKit) (bool, error)
if !util.StringSliceContains(kit1.Spec.Dependencies, kit2.Spec.Dependencies) {
return false, nil
}
+
return true, nil
}
-func hasMatchingTraits(traits1 map[string]v1.TraitSpec, traits2 map[string]v1.TraitSpec) (bool, error) {
+func hasMatchingTraits(traits interface{}, kitTraits interface{}) (bool, error) {
+ traitsMap, err := trait.ToMap(traits)
+ if err != nil {
+ return false, err
+ }
+ kitTraitsMap, err := trait.ToMap(kitTraits)
+ if err != nil {
+ return false, err
+ }
catalog := trait.NewCatalog(nil)
+
for _, t := range catalog.AllTraits() {
- if t != nil && !t.InfluencesKit() {
+ if t == nil || !t.InfluencesKit() {
// We don't store the trait configuration if the trait cannot influence the kit behavior
continue
}
id := string(t.ID())
- t1, ok1 := traits1[id]
- t2, ok2 := traits2[id]
+ it, ok1 := traitsMap[id]
+ kt, ok2 := kitTraitsMap[id]
if !ok1 && !ok2 {
continue
}
+ if !ok1 || !ok2 {
+ return false, nil
+ }
if ct, ok := t.(trait.ComparableTrait); ok {
- if comparable, err := hasComparableTrait(ct, &t1, &t2); err != nil {
+ // if it's match trait use its matches method to determine the match
+ if match, err := matchesComparableTrait(ct, it, kt); !match || err != nil {
return false, err
- } else if comparable {
- continue
}
- } else if ok1 && ok2 {
- if match, err := hasMatchingTrait(&t1, &t2); err != nil {
- return false, err
- } else if match {
- continue
+ } else {
+ if !matchesTrait(it, kt) {
+ return false, nil
}
}
- return false, nil
}
return true, nil
}
-func hasComparableTrait(t trait.ComparableTrait, ts1 *v1.TraitSpec, ts2 *v1.TraitSpec) (bool, error) {
- t1 := reflect.New(reflect.TypeOf(t).Elem()).Interface()
- if ts1.Configuration.RawMessage != nil {
- data, err := json.Marshal(ts1.Configuration)
- if err != nil {
- return false, err
- }
- err = json.Unmarshal(data, &t1)
- if err != nil {
- return false, err
- }
- }
-
- t2 := reflect.New(reflect.TypeOf(t).Elem()).Interface()
- if ts2.Configuration.RawMessage != nil {
- data, err := json.Marshal(ts2.Configuration)
- if err != nil {
- return false, err
- }
- err = json.Unmarshal(data, &t2)
- if err != nil {
- return false, err
- }
- }
-
- return t2.(trait.ComparableTrait).Matches(t1.(trait.Trait)), nil
-}
-
-func hasMatchingTrait(ts1 *v1.TraitSpec, ts2 *v1.TraitSpec) (bool, error) {
- data, err := json.Marshal(ts1.Configuration)
- if err != nil {
- return false, err
- }
- t1 := make(map[string]interface{})
- err = json.Unmarshal(data, &t1)
- if err != nil {
+func matchesComparableTrait(ct trait.ComparableTrait, it map[string]interface{}, kt map[string]interface{}) (bool, error) {
+ t1 := reflect.New(reflect.TypeOf(ct).Elem()).Interface()
+ if err := trait.ToTrait(it, &t1); err != nil {
return false, err
}
- data, err = json.Marshal(ts2.Configuration)
- if err != nil {
- return false, err
- }
- t2 := make(map[string]interface{})
- err = json.Unmarshal(data, &t2)
- if err != nil {
- return false, err
- }
- for ck, cv := range t2 {
- iv, ok := t1[ck]
- if !ok {
- // skip it because trait configured on kit has a value that is not defined
- // in integration trait
- return false, nil
- }
- if !equal(iv, cv) {
- // skip it because trait configured on kit has a value that differs from
- // the one configured on integration
- return false, nil
- }
- }
- return true, nil
-}
-
-// We need to try to perform a slice equality in order to prevent a runtime panic.
-func equal(a, b interface{}) bool {
- aSlice, aOk := a.([]interface{})
- bSlice, bOk := b.([]interface{})
-
- if aOk && bOk {
- // Both are slices
- return sliceEqual(aSlice, bSlice)
- }
- if aOk || bOk {
- // One of the 2 is a slice
- return false
+ t2 := reflect.New(reflect.TypeOf(ct).Elem()).Interface()
+ if err := trait.ToTrait(kt, &t2); err != nil {
+ return false, err
}
- // None is a slice
- return a == b
+ return t2.(trait.ComparableTrait).Matches(t1.(trait.Trait)), nil
}
-func sliceEqual(a, b []interface{}) bool {
- if len(a) != len(b) {
- return false
- }
- for i, v := range a {
- if v != b[i] {
- return false
- }
- }
- return true
+func matchesTrait(it map[string]interface{}, kt map[string]interface{}) bool {
+ // perform exact match on the two trait maps
+ return reflect.DeepEqual(it, kt)
}
diff --git a/pkg/controller/integration/build_kit_test.go b/pkg/controller/integration/kits_test.go
similarity index 87%
rename from pkg/controller/integration/build_kit_test.go
rename to pkg/controller/integration/kits_test.go
index 8c9f7491d..86ed58de4 100644
--- a/pkg/controller/integration/build_kit_test.go
+++ b/pkg/controller/integration/kits_test.go
@@ -24,6 +24,7 @@ import (
"github.com/stretchr/testify/assert"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
"github.com/apache/camel-k/pkg/util/log"
@@ -151,10 +152,12 @@ func TestLookupKitForIntegration_DiscardKitsWithIncompatibleTraits(t *testing.T)
"camel-core",
"camel-irc",
},
- Traits: map[string]v1.TraitSpec{
- "builder": test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": "false",
- }),
+ Traits: v1.IntegrationKitTraits{
+ Builder: &v1.BuilderTrait{
+ Trait: v1.Trait{
+ Enabled: pointer.Bool(false),
+ },
+ },
},
},
Status: v1.IntegrationKitStatus{
@@ -180,13 +183,15 @@ func TestLookupKitForIntegration_DiscardKitsWithIncompatibleTraits(t *testing.T)
"camel-core",
"camel-irc",
},
- Traits: map[string]v1.TraitSpec{
- "builder": test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": "true",
- "properties": []string{
+ Traits: v1.IntegrationKitTraits{
+ Builder: &v1.BuilderTrait{
+ Trait: v1.Trait{
+ Enabled: pointer.Bool(true),
+ },
+ Properties: []string{
"build-key1=build-value1",
},
- }),
+ },
},
},
Status: v1.IntegrationKitStatus{
@@ -211,13 +216,15 @@ func TestLookupKitForIntegration_DiscardKitsWithIncompatibleTraits(t *testing.T)
Name: "my-integration",
},
Spec: v1.IntegrationSpec{
- Traits: map[string]v1.TraitSpec{
- "builder": test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": "true",
- "properties": []string{
+ Traits: v1.Traits{
+ Builder: &v1.BuilderTrait{
+ Trait: v1.Trait{
+ Enabled: pointer.Bool(true),
+ },
+ Properties: []string{
"build-key1=build-value1",
},
- }),
+ },
},
},
Status: v1.IntegrationStatus{
@@ -245,10 +252,12 @@ func TestHasMatchingTraits_KitNoTraitShouldNotBePicked(t *testing.T) {
Name: "my-integration",
},
Spec: v1.IntegrationSpec{
- Traits: map[string]v1.TraitSpec{
- "builder": test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": "true",
- }),
+ Traits: v1.Traits{
+ Builder: &v1.BuilderTrait{
+ Trait: v1.Trait{
+ Enabled: pointer.Bool(true),
+ },
+ },
},
},
}
@@ -262,9 +271,6 @@ func TestHasMatchingTraits_KitNoTraitShouldNotBePicked(t *testing.T) {
Namespace: "ns",
Name: "my-kit",
},
- Spec: v1.IntegrationKitSpec{
- Traits: map[string]v1.TraitSpec{},
- },
}
a := buildKitAction{}
@@ -286,13 +292,15 @@ func TestHasMatchingTraits_KitSameTraitShouldBePicked(t *testing.T) {
Name: "my-integration",
},
Spec: v1.IntegrationSpec{
- Traits: map[string]v1.TraitSpec{
- "builder": test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": "true",
- "properties": []string{
+ Traits: v1.Traits{
+ Builder: &v1.BuilderTrait{
+ Trait: v1.Trait{
+ Enabled: pointer.Bool(true),
+ },
+ Properties: []string{
"build-key1=build-value1",
},
- }),
+ },
},
},
}
@@ -307,13 +315,15 @@ func TestHasMatchingTraits_KitSameTraitShouldBePicked(t *testing.T) {
Name: "my-kit",
},
Spec: v1.IntegrationKitSpec{
- Traits: map[string]v1.TraitSpec{
- "builder": test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": "true",
- "properties": []string{
+ Traits: v1.IntegrationKitTraits{
+ Builder: &v1.BuilderTrait{
+ Trait: v1.Trait{
+ Enabled: pointer.Bool(true),
+ },
+ Properties: []string{
"build-key1=build-value1",
},
- }),
+ },
},
},
}
diff --git a/pkg/controller/kameletbinding/integration.go b/pkg/controller/kameletbinding/integration.go
index ef8b0fc7d..cde6da195 100644
--- a/pkg/controller/kameletbinding/integration.go
+++ b/pkg/controller/kameletbinding/integration.go
@@ -213,12 +213,7 @@ func configureBinding(integration *v1.Integration, bindings ...*bindings.Binding
if b == nil {
continue
}
- if integration.Spec.Traits == nil {
- integration.Spec.Traits = make(map[string]v1.TraitSpec)
- }
- for k, v := range b.Traits {
- integration.Spec.Traits[k] = v
- }
+ integration.Spec.Traits = b.Traits
for k, v := range b.ApplicationProperties {
entry, err := property.EncodePropertyFileEntry(k, v)
if err != nil {
diff --git a/pkg/trait/affinity.go b/pkg/trait/affinity.go
index 87a1b622f..6d6859425 100644
--- a/pkg/trait/affinity.go
+++ b/pkg/trait/affinity.go
@@ -30,33 +30,18 @@ import (
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
)
-// Allows constraining which nodes the integration pod(s) are eligible to be scheduled on, based on labels on the node,
-// or with inter-pod affinity and anti-affinity, based on labels on pods that are already running on the nodes.
-//
-// It's disabled by default.
-//
-// +camel-k:trait=affinity.
type affinityTrait struct {
- BaseTrait `property:",squash"`
- // Always co-locates multiple replicas of the integration in the same node (default *false*).
- PodAffinity *bool `property:"pod-affinity" json:"podAffinity,omitempty"`
- // Never co-locates multiple replicas of the integration in the same node (default *false*).
- PodAntiAffinity *bool `property:"pod-anti-affinity" json:"podAntiAffinity,omitempty"`
- // Defines a set of nodes the integration pod(s) are eligible to be scheduled on, based on labels on the node.
- NodeAffinityLabels []string `property:"node-affinity-labels" json:"nodeAffinityLabels,omitempty"`
- // Defines a set of pods (namely those matching the label selector, relative to the given namespace) that the
- // integration pod(s) should be co-located with.
- PodAffinityLabels []string `property:"pod-affinity-labels" json:"podAffinityLabels,omitempty"`
- // Defines a set of pods (namely those matching the label selector, relative to the given namespace) that the
- // integration pod(s) should not be co-located with.
- PodAntiAffinityLabels []string `property:"pod-anti-affinity-labels" json:"podAntiAffinityLabels,omitempty"`
+ BaseTrait
+ v1.AffinityTrait `property:",squash"`
}
func newAffinityTrait() Trait {
return &affinityTrait{
- BaseTrait: NewBaseTrait("affinity", 1500),
- PodAffinity: pointer.Bool(false),
- PodAntiAffinity: pointer.Bool(false),
+ BaseTrait: NewBaseTrait("affinity", 1500),
+ AffinityTrait: v1.AffinityTrait{
+ PodAffinity: pointer.Bool(false),
+ PodAntiAffinity: pointer.Bool(false),
+ },
}
}
diff --git a/pkg/trait/builder.go b/pkg/trait/builder.go
index 97940469b..15eda75ca 100644
--- a/pkg/trait/builder.go
+++ b/pkg/trait/builder.go
@@ -30,16 +30,9 @@ import (
"github.com/apache/camel-k/pkg/util/property"
)
-// The builder trait is internally used to determine the best strategy to
-// build and configure IntegrationKits.
-//
-// +camel-k:trait=builder.
type builderTrait struct {
- BaseTrait `property:",squash"`
- // Enable verbose logging on build components that support it (e.g. Kaniko build pod).
- Verbose *bool `property:"verbose" json:"verbose,omitempty"`
- // A list of properties to be provided to the build task
- Properties []string `property:"properties" json:"properties,omitempty"`
+ BaseTrait
+ v1.BuilderTrait `property:",squash"`
}
func newBuilderTrait() Trait {
diff --git a/pkg/trait/camel.go b/pkg/trait/camel.go
index f6346fb06..e5cf98652 100644
--- a/pkg/trait/camel.go
+++ b/pkg/trait/camel.go
@@ -35,15 +35,9 @@ import (
"github.com/apache/camel-k/pkg/util/property"
)
-// The Camel trait can be used to configure versions of Apache Camel K runtime and related libraries, it cannot be disabled.
-//
-// +camel-k:trait=camel.
type camelTrait struct {
- BaseTrait `property:",squash"`
- // The camel-k-runtime version to use for the integration. It overrides the default version set in the Integration Platform.
- RuntimeVersion string `property:"runtime-version" json:"runtimeVersion,omitempty"`
- // A list of properties to be provided to the Integration runtime
- Properties []string `property:"properties" json:"properties,omitempty"`
+ BaseTrait
+ v1.CamelTrait `property:",squash"`
}
func newCamelTrait() Trait {
diff --git a/pkg/trait/camel_test.go b/pkg/trait/camel_test.go
index 58d8a4bfb..20e555975 100644
--- a/pkg/trait/camel_test.go
+++ b/pkg/trait/camel_test.go
@@ -94,7 +94,7 @@ func createNominalCamelTest() (*camelTrait, *Environment) {
Namespace: "namespace",
},
Spec: v1.IntegrationSpec{
- Traits: make(map[string]v1.TraitSpec),
+ Traits: v1.Traits{},
},
Status: v1.IntegrationStatus{
RuntimeVersion: "0.0.1",
diff --git a/pkg/trait/container.go b/pkg/trait/container.go
index 3b3ca484c..2f0011f36 100644
--- a/pkg/trait/container.go
+++ b/pkg/trait/container.go
@@ -46,98 +46,23 @@ const (
containerTraitID = "container"
)
-// The Container trait can be used to configure properties of the container where the integration will run.
-//
-// It also provides configuration for Services associated to the container.
-//
-// +camel-k:trait=container
-// nolint: tagliatelle
type containerTrait struct {
- BaseTrait `property:",squash"`
-
- Auto *bool `property:"auto" json:"auto,omitempty"`
-
- // The minimum amount of CPU required.
- RequestCPU string `property:"request-cpu" json:"requestCPU,omitempty"`
- // The minimum amount of memory required.
- RequestMemory string `property:"request-memory" json:"requestMemory,omitempty"`
- // The maximum amount of CPU required.
- LimitCPU string `property:"limit-cpu" json:"limitCPU,omitempty"`
- // The maximum amount of memory required.
- LimitMemory string `property:"limit-memory" json:"limitMemory,omitempty"`
-
- // Can be used to enable/disable exposure via kubernetes Service.
- Expose *bool `property:"expose" json:"expose,omitempty"`
- // To configure a different port exposed by the container (default `8080`).
- Port int `property:"port" json:"port,omitempty"`
- // To configure a different port name for the port exposed by the container. It defaults to `http` only when the `expose` parameter is true.
- PortName string `property:"port-name" json:"portName,omitempty"`
- // To configure under which service port the container port is to be exposed (default `80`).
- ServicePort int `property:"service-port" json:"servicePort,omitempty"`
- // To configure under which service port name the container port is to be exposed (default `http`).
- ServicePortName string `property:"service-port-name" json:"servicePortName,omitempty"`
- // The main container name. It's named `integration` by default.
- Name string `property:"name" json:"name,omitempty"`
- // The main container image
- Image string `property:"image" json:"image,omitempty"`
- // The pull policy: Always|Never|IfNotPresent
- ImagePullPolicy corev1.PullPolicy `property:"image-pull-policy" json:"imagePullPolicy,omitempty"`
-
- // DeprecatedProbesEnabled enable/disable probes on the container (default `false`)
- // Deprecated: replaced by the health trait.
- DeprecatedProbesEnabled *bool `property:"probes-enabled" json:"probesEnabled,omitempty"`
- // Scheme to use when connecting. Defaults to HTTP. Applies to the liveness probe.
- // Deprecated: replaced by the health trait.
- DeprecatedLivenessScheme string `property:"liveness-scheme" json:"livenessScheme,omitempty"`
- // Number of seconds after the container has started before liveness probes are initiated.
- // Deprecated: replaced by the health trait.
- DeprecatedLivenessInitialDelay int32 `property:"liveness-initial-delay" json:"livenessInitialDelay,omitempty"`
- // Number of seconds after which the probe times out. Applies to the liveness probe.
- // Deprecated: replaced by the health trait.
- DeprecatedLivenessTimeout int32 `property:"liveness-timeout" json:"livenessTimeout,omitempty"`
- // How often to perform the probe. Applies to the liveness probe.
- // Deprecated: replaced by the health trait.
- DeprecatedLivenessPeriod int32 `property:"liveness-period" json:"livenessPeriod,omitempty"`
- // Minimum consecutive successes for the probe to be considered successful after having failed.
- // Applies to the liveness probe.
- // Deprecated: replaced by the health trait.
- DeprecatedLivenessSuccessThreshold int32 `property:"liveness-success-threshold" json:"livenessSuccessThreshold,omitempty"`
- // Minimum consecutive failures for the probe to be considered failed after having succeeded.
- // Applies to the liveness probe.
- // Deprecated: replaced by the health trait.
- DeprecatedLivenessFailureThreshold int32 `property:"liveness-failure-threshold" json:"livenessFailureThreshold,omitempty"`
- // Scheme to use when connecting. Defaults to HTTP. Applies to the readiness probe.
- // Deprecated: replaced by the health trait.
- DeprecatedReadinessScheme string `property:"readiness-scheme" json:"readinessScheme,omitempty"`
- // Number of seconds after the container has started before readiness probes are initiated.
- // Deprecated: replaced by the health trait.
- DeprecatedReadinessInitialDelay int32 `property:"readiness-initial-delay" json:"readinessInitialDelay,omitempty"`
- // Number of seconds after which the probe times out. Applies to the readiness probe.
- // Deprecated: replaced by the health trait.
- DeprecatedReadinessTimeout int32 `property:"readiness-timeout" json:"readinessTimeout,omitempty"`
- // How often to perform the probe. Applies to the readiness probe.
- // Deprecated: replaced by the health trait.
- DeprecatedReadinessPeriod int32 `property:"readiness-period" json:"readinessPeriod,omitempty"`
- // Minimum consecutive successes for the probe to be considered successful after having failed.
- // Applies to the readiness probe.
- // Deprecated: replaced by the health trait.
- DeprecatedReadinessSuccessThreshold int32 `property:"readiness-success-threshold" json:"readinessSuccessThreshold,omitempty"`
- // Minimum consecutive failures for the probe to be considered failed after having succeeded.
- // Applies to the readiness probe.
- // Deprecated: replaced by the health trait.
- DeprecatedReadinessFailureThreshold int32 `property:"readiness-failure-threshold" json:"readinessFailureThreshold,omitempty"`
+ BaseTrait
+ v1.ContainerTrait `property:",squash"`
}
func newContainerTrait() Trait {
return &containerTrait{
- BaseTrait: NewBaseTrait(containerTraitID, 1600),
- Port: defaultContainerPort,
- ServicePort: defaultServicePort,
- ServicePortName: defaultContainerPortName,
- Name: defaultContainerName,
- DeprecatedProbesEnabled: pointer.Bool(false),
- DeprecatedLivenessScheme: string(corev1.URISchemeHTTP),
- DeprecatedReadinessScheme: string(corev1.URISchemeHTTP),
+ BaseTrait: NewBaseTrait(containerTraitID, 1600),
+ ContainerTrait: v1.ContainerTrait{
+ Port: defaultContainerPort,
+ ServicePort: defaultServicePort,
+ ServicePortName: defaultContainerPortName,
+ Name: defaultContainerName,
+ DeprecatedProbesEnabled: pointer.Bool(false),
+ DeprecatedLivenessScheme: string(corev1.URISchemeHTTP),
+ DeprecatedReadinessScheme: string(corev1.URISchemeHTTP),
+ },
}
}
diff --git a/pkg/trait/container_probes_test.go b/pkg/trait/container_probes_test.go
index 0d4ccbdab..acad3aeba 100644
--- a/pkg/trait/container_probes_test.go
+++ b/pkg/trait/container_probes_test.go
@@ -23,11 +23,11 @@ import (
"github.com/stretchr/testify/assert"
corev1 "k8s.io/api/core/v1"
+ "k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/kubernetes"
- "github.com/apache/camel-k/pkg/util/test"
)
func newTestProbesEnv(t *testing.T, integration *v1.Integration) Environment {
@@ -52,10 +52,10 @@ func newTestProbesEnv(t *testing.T, integration *v1.Integration) Environment {
func TestProbesDependencies(t *testing.T) {
integration := &v1.Integration{
Spec: v1.IntegrationSpec{
- Traits: map[string]v1.TraitSpec{
- "container": test.TraitSpecFromMap(t, map[string]interface{}{
- "probesEnabled": true,
- }),
+ Traits: v1.Traits{
+ Container: &v1.ContainerTrait{
+ DeprecatedProbesEnabled: pointer.Bool(true),
+ },
},
},
}
@@ -72,12 +72,12 @@ func TestProbesDependencies(t *testing.T) {
func TestProbesOnDeployment(t *testing.T) {
integration := &v1.Integration{
Spec: v1.IntegrationSpec{
- Traits: map[string]v1.TraitSpec{
- "container": test.TraitSpecFromMap(t, map[string]interface{}{
- "probesEnabled": true,
- "expose": true,
- "LivenessTimeout": 1234,
- }),
+ Traits: v1.Traits{
+ Container: &v1.ContainerTrait{
+ DeprecatedProbesEnabled: pointer.Bool(true),
+ Expose: pointer.Bool(true),
+ DeprecatedLivenessTimeout: 1234,
+ },
},
},
}
@@ -104,14 +104,14 @@ func TestProbesOnDeployment(t *testing.T) {
func TestProbesOnDeploymentWithCustomScheme(t *testing.T) {
integration := &v1.Integration{
Spec: v1.IntegrationSpec{
- Traits: map[string]v1.TraitSpec{
- "container": test.TraitSpecFromMap(t, map[string]interface{}{
- "probesEnabled": true,
- "expose": true,
- "livenessTimeout": 1234,
- "livenessScheme": "HTTPS",
- "readinessScheme": "HTTPS",
- }),
+ Traits: v1.Traits{
+ Container: &v1.ContainerTrait{
+ DeprecatedProbesEnabled: pointer.Bool(true),
+ Expose: pointer.Bool(true),
+ DeprecatedLivenessTimeout: 1234,
+ DeprecatedLivenessScheme: "HTTPS",
+ DeprecatedReadinessScheme: "HTTPS",
+ },
},
},
}
@@ -139,15 +139,17 @@ func TestProbesOnKnativeService(t *testing.T) {
integration := &v1.Integration{
Spec: v1.IntegrationSpec{
Profile: v1.TraitProfileKnative,
- Traits: map[string]v1.TraitSpec{
- "knative-service": test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": true,
- }),
- "container": test.TraitSpecFromMap(t, map[string]interface{}{
- "probesEnabled": true,
- "expose": true,
- "livenessTimeout": 1234,
- }),
+ Traits: v1.Traits{
+ KnativeService: &v1.KnativeServiceTrait{
+ Trait: v1.Trait{
+ Enabled: pointer.Bool(true),
+ },
+ },
+ Container: &v1.ContainerTrait{
+ DeprecatedProbesEnabled: pointer.Bool(true),
+ Expose: pointer.Bool(true),
+ DeprecatedLivenessTimeout: 1234,
+ },
},
},
}
diff --git a/pkg/trait/container_test.go b/pkg/trait/container_test.go
index 494dd5b20..07db63f3e 100644
--- a/pkg/trait/container_test.go
+++ b/pkg/trait/container_test.go
@@ -110,10 +110,10 @@ func TestContainerWithCustomName(t *testing.T) {
},
Spec: v1.IntegrationSpec{
Profile: v1.TraitProfileKubernetes,
- Traits: map[string]v1.TraitSpec{
- "container": test.TraitSpecFromMap(t, map[string]interface{}{
- "name": "my-container-name",
- }),
+ Traits: v1.Traits{
+ Container: &v1.ContainerTrait{
+ Name: "my-container-name",
+ },
},
},
},
@@ -149,8 +149,8 @@ func TestContainerWithCustomName(t *testing.T) {
assert.NotNil(t, d)
assert.Len(t, d.Spec.Template.Spec.Containers, 1)
- trait := test.TraitSpecToMap(t, environment.Integration.Spec.Traits["container"])
- assert.Equal(t, trait["name"], d.Spec.Template.Spec.Containers[0].Name)
+ trait := environment.Integration.Spec.Traits.Container
+ assert.Equal(t, trait.Name, d.Spec.Template.Spec.Containers[0].Name)
}
func TestContainerWithCustomImage(t *testing.T) {
@@ -176,10 +176,10 @@ func TestContainerWithCustomImage(t *testing.T) {
},
Spec: v1.IntegrationSpec{
Profile: v1.TraitProfileKubernetes,
- Traits: map[string]v1.TraitSpec{
- "container": test.TraitSpecFromMap(t, map[string]interface{}{
- "image": "foo/bar:1.0.0",
- }),
+ Traits: v1.Traits{
+ Container: &v1.ContainerTrait{
+ Image: "foo/bar:1.0.0",
+ },
},
},
},
@@ -220,8 +220,8 @@ func TestContainerWithCustomImage(t *testing.T) {
assert.Nil(t, err)
assert.Equal(t, environment.Integration.ObjectMeta.UID, ikt.ObjectMeta.OwnerReferences[0].UID)
- trait := test.TraitSpecToMap(t, environment.Integration.Spec.Traits["container"])
- assert.Equal(t, trait["image"], ikt.Spec.Image)
+ trait := environment.Integration.Spec.Traits.Container
+ assert.Equal(t, trait.Image, ikt.Spec.Image)
}
func TestContainerWithCustomImageAndIntegrationKit(t *testing.T) {
@@ -247,10 +247,10 @@ func TestContainerWithCustomImageAndIntegrationKit(t *testing.T) {
},
Spec: v1.IntegrationSpec{
Profile: v1.TraitProfileKubernetes,
- Traits: map[string]v1.TraitSpec{
- "container": test.TraitSpecFromMap(t, map[string]interface{}{
- "image": "foo/bar:1.0.0",
- }),
+ Traits: v1.Traits{
+ Container: &v1.ContainerTrait{
+ Image: "foo/bar:1.0.0",
+ },
},
IntegrationKit: &corev1.ObjectReference{
Name: "bad-" + ServiceTestName,
@@ -293,10 +293,10 @@ func TestContainerWithImagePullPolicy(t *testing.T) {
Integration: &v1.Integration{
Spec: v1.IntegrationSpec{
Profile: v1.TraitProfileKubernetes,
- Traits: map[string]v1.TraitSpec{
- "container": test.TraitSpecFromMap(t, map[string]interface{}{
- "imagePullPolicy": "Always",
- }),
+ Traits: v1.Traits{
+ Container: &v1.ContainerTrait{
+ ImagePullPolicy: "Always",
+ },
},
},
},
diff --git a/pkg/trait/cron.go b/pkg/trait/cron.go
index 0c078442c..f6b33b250 100644
--- a/pkg/trait/cron.go
+++ b/pkg/trait/cron.go
@@ -36,57 +36,9 @@ import (
"github.com/apache/camel-k/pkg/util/uri"
)
-// The Cron trait can be used to customize the behaviour of periodic timer/cron based integrations.
-//
-// While normally an integration requires a pod to be always up and running, some periodic tasks, such as batch jobs,
-// require to be activated at specific hours of the day or with a periodic delay of minutes.
-// For such tasks, the cron trait can materialize the integration as a Kubernetes CronJob instead of a standard deployment,
-// in order to save resources when the integration does not need to be executed.
-//
-// Integrations that start from the following components are evaluated by the cron trait: `timer`, `cron`, `quartz`.
-//
-// The rules for using a Kubernetes CronJob are the following:
-// - `timer`: when periods can be written as cron expressions. E.g. `timer:tick?period=60000`.
-// - `cron`, `quartz`: when the cron expression does not contain seconds (or the "seconds" part is set to 0). E.g.
-// `cron:tab?schedule=0/2${plus}*{plus}*{plus}*{plus}?` or `quartz:trigger?cron=0{plus}0/2{plus}*{plus}*{plus}*{plus}?`.
-//
-// +camel-k:trait=cron.
type cronTrait struct {
- BaseTrait `property:",squash"`
- // The CronJob schedule for the whole integration. If multiple routes are declared, they must have the same schedule for this
- // mechanism to work correctly.
- Schedule string `property:"schedule" json:"schedule,omitempty"`
- // A comma separated list of the Camel components that need to be customized in order for them to work when the schedule is triggered externally by Kubernetes.
- // A specific customizer is activated for each specified component. E.g. for the `timer` component, the `cron-timer` customizer is
- // activated (it's present in the `org.apache.camel.k:camel-k-cron` library).
- //
- // Supported components are currently: `cron`, `timer` and `quartz`.
- Components string `property:"components" json:"components,omitempty"`
- // Use the default Camel implementation of the `cron` endpoint (`quartz`) instead of trying to materialize the integration
- // as Kubernetes CronJob.
- Fallback *bool `property:"fallback" json:"fallback,omitempty"`
- // Specifies how to treat concurrent executions of a Job.
- // Valid values are:
- // - "Allow": allows CronJobs to run concurrently;
- // - "Forbid" (default): forbids concurrent runs, skipping next run if previous run hasn't finished yet;
- // - "Replace": cancels currently running job and replaces it with a new one
- ConcurrencyPolicy string `property:"concurrency-policy" json:"concurrencyPolicy,omitempty"`
- // Automatically deploy the integration as CronJob when all routes are
- // either starting from a periodic consumer (only `cron`, `timer` and `quartz` are supported) or a passive consumer (e.g. `direct` is a passive consumer).
- //
- // It's required that all periodic consumers have the same period and it can be expressed as cron schedule (e.g. `1m` can be expressed as `0/1 * * * *`,
- // while `35m` or `50s` cannot).
- Auto *bool `property:"auto" json:"auto,omitempty"`
- // Optional deadline in seconds for starting the job if it misses scheduled
- // time for any reason. Missed jobs executions will be counted as failed ones.
- StartingDeadlineSeconds *int64 `property:"starting-deadline-seconds" json:"startingDeadlineSeconds,omitempty"`
- // Specifies the duration in seconds, relative to the start time, that the job
- // may be continuously active before it is considered to be failed.
- // It defaults to 60s.
- ActiveDeadlineSeconds *int64 `property:"active-deadline-seconds" json:"activeDeadlineSeconds,omitempty"`
- // Specifies the number of retries before marking the job failed.
- // It defaults to 2.
- BackoffLimit *int32 `property:"backoff-limit" json:"backoffLimit,omitempty"`
+ BaseTrait
+ v1.CronTrait `property:",squash"`
}
var _ ControllerStrategySelector = &cronTrait{}
diff --git a/pkg/trait/cron_test.go b/pkg/trait/cron_test.go
index 0f2612473..2d0240f17 100644
--- a/pkg/trait/cron_test.go
+++ b/pkg/trait/cron_test.go
@@ -27,12 +27,12 @@ import (
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
"github.com/apache/camel-k/pkg/util"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/kubernetes"
- "github.com/apache/camel-k/pkg/util/test"
)
func TestCronFromURI(t *testing.T) {
@@ -249,7 +249,7 @@ func TestCronDeps(t *testing.T) {
},
},
Resources: []v1.ResourceSpec{},
- Traits: map[string]v1.TraitSpec{},
+ Traits: v1.Traits{},
},
},
IntegrationKit: &v1.IntegrationKit{
@@ -319,10 +319,10 @@ func TestCronDepsFallback(t *testing.T) {
},
},
Resources: []v1.ResourceSpec{},
- Traits: map[string]v1.TraitSpec{
- "cron": test.TraitSpecFromMap(t, map[string]interface{}{
- "fallback": true,
- }),
+ Traits: v1.Traits{
+ Cron: &v1.CronTrait{
+ Fallback: pointer.Bool(true),
+ },
},
},
},
@@ -394,10 +394,10 @@ func TestCronWithActiveDeadline(t *testing.T) {
},
},
Resources: []v1.ResourceSpec{},
- Traits: map[string]v1.TraitSpec{
- "cron": test.TraitSpecFromMap(t, map[string]interface{}{
- "activeDeadlineSeconds": 120,
- }),
+ Traits: v1.Traits{
+ Cron: &v1.CronTrait{
+ ActiveDeadlineSeconds: pointer.Int64(120),
+ },
},
},
},
@@ -467,10 +467,10 @@ func TestCronWithBackoffLimit(t *testing.T) {
},
},
Resources: []v1.ResourceSpec{},
- Traits: map[string]v1.TraitSpec{
- "cron": test.TraitSpecFromMap(t, map[string]interface{}{
- "backoffLimit": 5,
- }),
+ Traits: v1.Traits{
+ Cron: &v1.CronTrait{
+ BackoffLimit: pointer.Int32(5),
+ },
},
},
},
diff --git a/pkg/trait/dependencies.go b/pkg/trait/dependencies.go
index b8cf3e4d4..59ed4bd22 100644
--- a/pkg/trait/dependencies.go
+++ b/pkg/trait/dependencies.go
@@ -28,12 +28,9 @@ import (
"github.com/apache/camel-k/pkg/util/kubernetes"
)
-// The Dependencies trait is internally used to automatically add runtime dependencies based on the
-// integration that the user wants to run.
-//
-// +camel-k:trait=dependencies.
type dependenciesTrait struct {
- BaseTrait `property:",squash"`
+ BaseTrait
+ v1.DependenciesTrait `property:",squash"`
}
func newDependenciesTrait() Trait {
diff --git a/pkg/trait/deployer.go b/pkg/trait/deployer.go
index ca40062d7..b46e3324a 100644
--- a/pkg/trait/deployer.go
+++ b/pkg/trait/deployer.go
@@ -31,20 +31,13 @@ import (
ctrl "sigs.k8s.io/controller-runtime/pkg/client"
+ v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
"github.com/apache/camel-k/pkg/util/patch"
)
-// The deployer trait is responsible for deploying the resources owned by the integration, and can be used
-// to explicitly select the underlying controller that will manage the integration pods.
-//
-// +camel-k:trait=deployer.
type deployerTrait struct {
- BaseTrait `property:",squash"`
- // Allows to explicitly select the desired deployment kind between `deployment`, `cron-job` or `knative-service` when creating the resources for running the integration.
- Kind string `property:"kind" json:"kind,omitempty"`
- // Use server-side apply to update the owned resources (default `true`).
- // Note that it automatically falls back to client-side patching, if SSA is not available, e.g., on old Kubernetes clusters.
- UseSSA *bool `property:"use-ssa" json:"useSSA,omitempty"`
+ BaseTrait
+ v1.DeployerTrait `property:",squash"`
}
var _ ControllerStrategySelector = &deployerTrait{}
diff --git a/pkg/trait/deployment.go b/pkg/trait/deployment.go
index d0a060921..c9fafe2e3 100644
--- a/pkg/trait/deployment.go
+++ b/pkg/trait/deployment.go
@@ -29,15 +29,9 @@ import (
"github.com/apache/camel-k/pkg/util/label"
)
-// The Deployment trait is responsible for generating the Kubernetes deployment that will make sure
-// the integration will run in the cluster.
-//
-// +camel-k:trait=deployment.
type deploymentTrait struct {
- BaseTrait `property:",squash"`
- // The maximum time in seconds for the deployment to make progress before it
- // is considered to be failed. It defaults to 60s.
- ProgressDeadlineSeconds *int32 `property:"progress-deadline-seconds" json:"progressDeadlineSeconds,omitempty"`
+ BaseTrait
+ v1.DeploymentTrait `property:",squash"`
}
var _ ControllerStrategySelector = &deploymentTrait{}
diff --git a/pkg/trait/deployment_test.go b/pkg/trait/deployment_test.go
index 6dc2dbd57..015cbf7de 100644
--- a/pkg/trait/deployment_test.go
+++ b/pkg/trait/deployment_test.go
@@ -187,7 +187,7 @@ func createNominalDeploymentTest() (*deploymentTrait, *Environment) {
},
Spec: v1.IntegrationSpec{
Replicas: &replicas,
- Traits: make(map[string]v1.TraitSpec),
+ Traits: v1.Traits{},
},
Status: v1.IntegrationStatus{
Phase: v1.IntegrationPhaseDeploying,
diff --git a/pkg/trait/environment.go b/pkg/trait/environment.go
index ba8688a32..735e9e1ea 100644
--- a/pkg/trait/environment.go
+++ b/pkg/trait/environment.go
@@ -22,26 +22,16 @@ import (
"k8s.io/utils/pointer"
+ v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/defaults"
"github.com/apache/camel-k/pkg/util/envvar"
"github.com/apache/camel-k/pkg/util/property"
)
-// The environment trait is used internally to inject standard environment variables in the integration container,
-// such as `NAMESPACE`, `POD_NAME` and others.
-//
-// +camel-k:trait=environment.
type environmentTrait struct {
- BaseTrait `property:",squash"`
- // Enables injection of `NAMESPACE` and `POD_NAME` environment variables (default `true`)
- ContainerMeta *bool `property:"container-meta" json:"containerMeta,omitempty"`
- // Propagates the `HTTP_PROXY`, `HTTPS_PROXY` and `NO_PROXY` environment variables (default `true`)
- HTTPProxy *bool `property:"http-proxy" json:"httpProxy,omitempty"`
- // A list of environment variables to be added to the integration container.
- // The syntax is KEY=VALUE, e.g., `MY_VAR="my value"`.
- // These take precedence over the previously defined environment variables.
- Vars []string `property:"vars" json:"vars,omitempty"`
+ BaseTrait
+ v1.EnvironmentTrait `property:",squash"`
}
const (
@@ -63,8 +53,10 @@ const (
func newEnvironmentTrait() Trait {
return &environmentTrait{
- BaseTrait: NewBaseTrait("environment", 800),
- ContainerMeta: pointer.Bool(true),
+ BaseTrait: NewBaseTrait("environment", 800),
+ EnvironmentTrait: v1.EnvironmentTrait{
+ ContainerMeta: pointer.Bool(true),
+ },
}
}
diff --git a/pkg/trait/environment_test.go b/pkg/trait/environment_test.go
index df74cbae1..9cf25059d 100644
--- a/pkg/trait/environment_test.go
+++ b/pkg/trait/environment_test.go
@@ -25,11 +25,11 @@ import (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/kubernetes"
- "github.com/apache/camel-k/pkg/util/test"
)
func TestDefaultEnvironment(t *testing.T) {
@@ -81,10 +81,10 @@ func TestEnabledContainerMetaDataEnvVars(t *testing.T) {
assert.Nil(t, err)
env := mockEnvironment(c)
- env.Integration.Spec.Traits = map[string]v1.TraitSpec{
- "environment": test.TraitSpecFromMap(t, map[string]interface{}{
- "containerMeta": true,
- }),
+ env.Integration.Spec.Traits = v1.Traits{
+ Environment: &v1.EnvironmentTrait{
+ ContainerMeta: pointer.Bool(true),
+ },
}
env.Platform.ResyncStatusFullConfig()
@@ -120,10 +120,10 @@ func TestDisabledContainerMetaDataEnvVars(t *testing.T) {
assert.Nil(t, err)
env := mockEnvironment(c)
- env.Integration.Spec.Traits = map[string]v1.TraitSpec{
- "environment": test.TraitSpecFromMap(t, map[string]interface{}{
- "containerMeta": false,
- }),
+ env.Integration.Spec.Traits = v1.Traits{
+ Environment: &v1.EnvironmentTrait{
+ ContainerMeta: pointer.Bool(false),
+ },
}
env.Platform.ResyncStatusFullConfig()
@@ -160,10 +160,10 @@ func TestCustomEnvVars(t *testing.T) {
assert.Nil(t, err)
env := mockEnvironment(c)
- env.Integration.Spec.Traits = map[string]v1.TraitSpec{
- "environment": test.TraitSpecFromMap(t, map[string]interface{}{
- "vars": []string{"key1=val1", "key2 = val2"},
- }),
+ env.Integration.Spec.Traits = v1.Traits{
+ Environment: &v1.EnvironmentTrait{
+ Vars: []string{"key1=val1", "key2 = val2"},
+ },
}
env.Platform.ResyncStatusFullConfig()
diff --git a/pkg/trait/error_handler.go b/pkg/trait/error_handler.go
index faa26a662..b15c052cb 100644
--- a/pkg/trait/error_handler.go
+++ b/pkg/trait/error_handler.go
@@ -30,13 +30,9 @@ import (
"github.com/apache/camel-k/pkg/util"
)
-// The error-handler is a platform trait used to inject Error Handler source into the integration runtime.
-//
-// +camel-k:trait=error-handler.
type errorHandlerTrait struct {
- BaseTrait `property:",squash"`
- // The error handler ref name provided or found in application properties
- ErrorHandlerRef string `property:"ref" json:"ref,omitempty"`
+ BaseTrait
+ v1.ErrorHandlerTrait `property:",squash"`
}
func newErrorHandlerTrait() Trait {
diff --git a/pkg/trait/gc.go b/pkg/trait/gc.go
index cd8fc1bda..bcbd3b9c6 100644
--- a/pkg/trait/gc.go
+++ b/pkg/trait/gc.go
@@ -57,43 +57,31 @@ var (
diskCachedDiscovery discovery.CachedDiscoveryInterface
)
-type discoveryCacheType string
-
-const (
- disabledDiscoveryCache discoveryCacheType = "disabled"
- diskDiscoveryCache discoveryCacheType = "disk"
- memoryDiscoveryCache discoveryCacheType = "memory"
-)
-
-// The GC Trait garbage-collects all resources that are no longer necessary upon integration updates.
-//
-// +camel-k:trait=gc.
-type garbageCollectorTrait struct {
- BaseTrait `property:",squash"`
- // Discovery client cache to be used, either `disabled`, `disk` or `memory` (default `memory`)
- DiscoveryCache *discoveryCacheType `property:"discovery-cache" json:"discoveryCache,omitempty"`
+type gcTrait struct {
+ BaseTrait
+ v1.GCTrait `property:",squash"`
}
-func newGarbageCollectorTrait() Trait {
- return &garbageCollectorTrait{
+func newGCTrait() Trait {
+ return &gcTrait{
BaseTrait: NewBaseTrait("gc", 1200),
}
}
-func (t *garbageCollectorTrait) Configure(e *Environment) (bool, error) {
+func (t *gcTrait) Configure(e *Environment) (bool, error) {
if !pointer.BoolDeref(t.Enabled, true) {
return false, nil
}
if t.DiscoveryCache == nil {
- s := memoryDiscoveryCache
+ s := v1.MemoryDiscoveryCache
t.DiscoveryCache = &s
}
return e.IntegrationInPhase(v1.IntegrationPhaseInitialization) || e.IntegrationInRunningPhases(), nil
}
-func (t *garbageCollectorTrait) Apply(e *Environment) error {
+func (t *gcTrait) Apply(e *Environment) error {
if e.IntegrationInRunningPhases() && e.Integration.GetGeneration() > 1 {
// Register a post action that deletes the existing resources that are labelled
// with the previous integration generation(s).
@@ -122,7 +110,7 @@ func (t *garbageCollectorTrait) Apply(e *Environment) error {
return nil
}
-func (t *garbageCollectorTrait) garbageCollectResources(e *Environment) error {
+func (t *gcTrait) garbageCollectResources(e *Environment) error {
deletableGVKs, err := t.getDeletableTypes(e)
if err != nil {
return errors.Wrap(err, "cannot discover GVK types")
@@ -140,7 +128,7 @@ func (t *garbageCollectorTrait) garbageCollectResources(e *Environment) error {
return t.deleteEachOf(e.Ctx, deletableGVKs, e, selector)
}
-func (t *garbageCollectorTrait) deleteEachOf(ctx context.Context, deletableGVKs map[schema.GroupVersionKind]struct{}, e *Environment, selector labels.Selector) error {
+func (t *gcTrait) deleteEachOf(ctx context.Context, deletableGVKs map[schema.GroupVersionKind]struct{}, e *Environment, selector labels.Selector) error {
for GVK := range deletableGVKs {
resources := unstructured.UnstructuredList{
Object: map[string]interface{}{
@@ -179,7 +167,7 @@ func (t *garbageCollectorTrait) deleteEachOf(ctx context.Context, deletableGVKs
return nil
}
-func (t *garbageCollectorTrait) canBeDeleted(e *Environment, u unstructured.Unstructured) bool {
+func (t *gcTrait) canBeDeleted(e *Environment, u unstructured.Unstructured) bool {
// Only delete direct children of the integration, otherwise we can affect the behavior of external controllers (i.e. Knative)
for _, o := range u.GetOwnerReferences() {
if o.Kind == v1.IntegrationKind && strings.HasPrefix(o.APIVersion, v1.SchemeGroupVersion.Group) && o.Name == e.Integration.Name {
@@ -189,7 +177,7 @@ func (t *garbageCollectorTrait) canBeDeleted(e *Environment, u unstructured.Unst
return false
}
-func (t *garbageCollectorTrait) getDeletableTypes(e *Environment) (map[schema.GroupVersionKind]struct{}, error) {
+func (t *gcTrait) getDeletableTypes(e *Environment) (map[schema.GroupVersionKind]struct{}, error) {
lock.Lock()
defer lock.Unlock()
@@ -254,9 +242,9 @@ func (t *garbageCollectorTrait) getDeletableTypes(e *Environment) (map[schema.Gr
return collectableGVKs, nil
}
-func (t *garbageCollectorTrait) discoveryClient() (discovery.DiscoveryInterface, error) {
+func (t *gcTrait) discoveryClient() (discovery.DiscoveryInterface, error) {
switch *t.DiscoveryCache {
- case diskDiscoveryCache:
+ case v1.DiskDiscoveryCache:
if diskCachedDiscovery != nil {
return diskCachedDiscovery, nil
}
@@ -267,14 +255,14 @@ func (t *garbageCollectorTrait) discoveryClient() (discovery.DiscoveryInterface,
diskCachedDiscovery, err = disk.NewCachedDiscoveryClientForConfig(config, diskCacheDir, httpCacheDir, 10*time.Minute)
return diskCachedDiscovery, err
- case memoryDiscoveryCache:
+ case v1.MemoryDiscoveryCache:
if memoryCachedDiscovery != nil {
return memoryCachedDiscovery, nil
}
memoryCachedDiscovery = memory.NewMemCacheClient(t.Client.Discovery())
return memoryCachedDiscovery, nil
- case disabledDiscoveryCache, "":
+ case v1.DisabledDiscoveryCache, "":
return t.Client.Discovery(), nil
default:
diff --git a/pkg/trait/gc_test.go b/pkg/trait/gc_test.go
index 10dd4462c..e16823a6f 100644
--- a/pkg/trait/gc_test.go
+++ b/pkg/trait/gc_test.go
@@ -27,16 +27,16 @@ import (
"k8s.io/utils/pointer"
)
-func TestConfigureGarbageCollectorTraitDoesSucceed(t *testing.T) {
- gcTrait, environment := createNominalGarbageCollectorTest()
+func TestConfigureGCTraitDoesSucceed(t *testing.T) {
+ gcTrait, environment := createNominalGCTest()
configured, err := gcTrait.Configure(environment)
assert.True(t, configured)
assert.Nil(t, err)
}
-func TestConfigureDisabledGarbageCollectorTraitDoesNotSucceed(t *testing.T) {
- gcTrait, environment := createNominalGarbageCollectorTest()
+func TestConfigureDisabledGCTraitDoesNotSucceed(t *testing.T) {
+ gcTrait, environment := createNominalGCTest()
gcTrait.Enabled = pointer.Bool(false)
configured, err := gcTrait.Configure(environment)
@@ -46,7 +46,7 @@ func TestConfigureDisabledGarbageCollectorTraitDoesNotSucceed(t *testing.T) {
}
func TestApplyGarbageCollectorTraitFirstGenerationDoesSucceed(t *testing.T) {
- gcTrait, environment := createNominalGarbageCollectorTest()
+ gcTrait, environment := createNominalGCTest()
err := gcTrait.Apply(environment)
@@ -56,7 +56,7 @@ func TestApplyGarbageCollectorTraitFirstGenerationDoesSucceed(t *testing.T) {
}
func TestApplyGarbageCollectorTraitNextGenerationDoesSucceed(t *testing.T) {
- gcTrait, environment := createNominalGarbageCollectorTest()
+ gcTrait, environment := createNominalGCTest()
environment.Integration.Generation = 2
err := gcTrait.Apply(environment)
@@ -66,8 +66,8 @@ func TestApplyGarbageCollectorTraitNextGenerationDoesSucceed(t *testing.T) {
assert.Len(t, environment.PostActions, 1)
}
-func TestApplyGarbageCollectorTraitDuringInitializationPhaseSkipPostActions(t *testing.T) {
- gcTrait, environment := createNominalGarbageCollectorTest()
+func TestApplyGCTraitDuringInitializationPhaseSkipPostActions(t *testing.T) {
+ gcTrait, environment := createNominalGCTest()
environment.Integration.Status.Phase = v1.IntegrationPhaseInitialization
err := gcTrait.Apply(environment)
@@ -77,8 +77,8 @@ func TestApplyGarbageCollectorTraitDuringInitializationPhaseSkipPostActions(t *t
assert.Len(t, environment.PostActions, 0)
}
-func createNominalGarbageCollectorTest() (*garbageCollectorTrait, *Environment) {
- trait, _ := newGarbageCollectorTrait().(*garbageCollectorTrait)
+func createNominalGCTest() (*gcTrait, *Environment) {
+ trait, _ := newGCTrait().(*gcTrait)
trait.Enabled = pointer.Bool(true)
environment := &Environment{
diff --git a/pkg/trait/health.go b/pkg/trait/health.go
index 0dd2f26fa..274defcb3 100644
--- a/pkg/trait/health.go
+++ b/pkg/trait/health.go
@@ -34,50 +34,18 @@ const (
defaultReadinessProbePath = "/q/health/ready"
)
-// The health trait is responsible for configuring the health probes on the integration container.
-//
-// It's disabled by default.
-//
-// +camel-k:trait=health.
type healthTrait struct {
- BaseTrait `property:",squash"`
-
- // Configures the liveness probe for the integration container (default `false`).
- LivenessProbeEnabled *bool `property:"liveness-probe-enabled" json:"livenessProbeEnabled,omitempty"`
- // Scheme to use when connecting to the liveness probe (default `HTTP`).
- LivenessScheme string `property:"liveness-scheme" json:"livenessScheme,omitempty"`
- // Number of seconds after the container has started before the liveness probe is initiated.
- LivenessInitialDelay int32 `property:"liveness-initial-delay" json:"livenessInitialDelay,omitempty"`
- // Number of seconds after which the liveness probe times out.
- LivenessTimeout int32 `property:"liveness-timeout" json:"livenessTimeout,omitempty"`
- // How often to perform the liveness probe.
- LivenessPeriod int32 `property:"liveness-period" json:"livenessPeriod,omitempty"`
- // Minimum consecutive successes for the liveness probe to be considered successful after having failed.
- LivenessSuccessThreshold int32 `property:"liveness-success-threshold" json:"livenessSuccessThreshold,omitempty"`
- // Minimum consecutive failures for the liveness probe to be considered failed after having succeeded.
- LivenessFailureThreshold int32 `property:"liveness-failure-threshold" json:"livenessFailureThreshold,omitempty"`
-
- // Configures the readiness probe for the integration container (default `true`).
- ReadinessProbeEnabled *bool `property:"readiness-probe-enabled" json:"readinessProbeEnabled,omitempty"`
- // Scheme to use when connecting to the readiness probe (default `HTTP`).
- ReadinessScheme string `property:"readiness-scheme" json:"readinessScheme,omitempty"`
- // Number of seconds after the container has started before the readiness probe is initiated.
- ReadinessInitialDelay int32 `property:"readiness-initial-delay" json:"readinessInitialDelay,omitempty"`
- // Number of seconds after which the readiness probe times out.
- ReadinessTimeout int32 `property:"readiness-timeout" json:"readinessTimeout,omitempty"`
- // How often to perform the readiness probe.
- ReadinessPeriod int32 `property:"readiness-period" json:"readinessPeriod,omitempty"`
- // Minimum consecutive successes for the readiness probe to be considered successful after having failed.
- ReadinessSuccessThreshold int32 `property:"readiness-success-threshold" json:"readinessSuccessThreshold,omitempty"`
- // Minimum consecutive failures for the readiness probe to be considered failed after having succeeded.
- ReadinessFailureThreshold int32 `property:"readiness-failure-threshold" json:"readinessFailureThreshold,omitempty"`
+ BaseTrait
+ v1.HealthTrait `property:",squash"`
}
func newHealthTrait() Trait {
return &healthTrait{
- BaseTrait: NewBaseTrait("health", 1700),
- LivenessScheme: string(corev1.URISchemeHTTP),
- ReadinessScheme: string(corev1.URISchemeHTTP),
+ BaseTrait: NewBaseTrait("health", 1700),
+ HealthTrait: v1.HealthTrait{
+ LivenessScheme: string(corev1.URISchemeHTTP),
+ ReadinessScheme: string(corev1.URISchemeHTTP),
+ },
}
}
diff --git a/pkg/trait/ingress.go b/pkg/trait/ingress.go
index 66dbcf802..31a0dd030 100644
--- a/pkg/trait/ingress.go
+++ b/pkg/trait/ingress.go
@@ -29,24 +29,17 @@ import (
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
)
-// The Ingress trait can be used to expose the service associated with the integration
-// to the outside world with a Kubernetes Ingress.
-//
-// It's enabled by default whenever a Service is added to the integration (through the `service` trait).
-//
-// +camel-k:trait=ingress.
type ingressTrait struct {
- BaseTrait `property:",squash"`
- // **Required**. To configure the host exposed by the ingress.
- Host string `property:"host" json:"host,omitempty"`
- // To automatically add an ingress whenever the integration uses a HTTP endpoint consumer.
- Auto *bool `property:"auto" json:"auto,omitempty"`
+ BaseTrait
+ v1.IngressTrait `property:",squash"`
}
func newIngressTrait() Trait {
return &ingressTrait{
BaseTrait: NewBaseTrait("ingress", 2400),
- Host: "",
+ IngressTrait: v1.IngressTrait{
+ Host: "",
+ },
}
}
diff --git a/pkg/trait/init.go b/pkg/trait/init.go
index 7076c6a15..b8005da52 100644
--- a/pkg/trait/init.go
+++ b/pkg/trait/init.go
@@ -32,7 +32,8 @@ import (
const flowsInternalSourceName = "camel-k-embedded-flow.yaml"
type initTrait struct {
- BaseTrait `property:",squash"`
+ BaseTrait
+ v1.Trait
}
func NewInitTrait() Trait {
diff --git a/pkg/trait/istio.go b/pkg/trait/istio.go
index 1ad3daacb..12013a532 100644
--- a/pkg/trait/istio.go
+++ b/pkg/trait/istio.go
@@ -20,22 +20,16 @@ package trait
import (
"strconv"
+ v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
appsv1 "k8s.io/api/apps/v1"
"k8s.io/utils/pointer"
servingv1 "knative.dev/serving/pkg/apis/serving/v1"
)
-// The Istio trait allows configuring properties related to the Istio service mesh,
-// such as sidecar injection and outbound IP ranges.
-//
-// +camel-k:trait=istio.
type istioTrait struct {
- BaseTrait `property:",squash"`
- // Configures a (comma-separated) list of CIDR subnets that should not be intercepted by the Istio proxy (`10.0.0.0/8,172.16.0.0/12,192.168.0.0/16` by default).
- Allow string `property:"allow" json:"allow,omitempty"`
- // Forces the value for labels `sidecar.istio.io/inject`. By default the label is set to `true` on deployment and not set on Knative Service.
- Inject *bool `property:"inject" json:"inject,omitempty"`
+ BaseTrait
+ v1.IstioTrait `property:",squash"`
}
const (
@@ -46,7 +40,9 @@ const (
func newIstioTrait() Trait {
return &istioTrait{
BaseTrait: NewBaseTrait("istio", 2300),
- Allow: "10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
+ IstioTrait: v1.IstioTrait{
+ Allow: "10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
+ },
}
}
diff --git a/pkg/trait/istio_test.go b/pkg/trait/istio_test.go
index c322fc064..b829d6d32 100644
--- a/pkg/trait/istio_test.go
+++ b/pkg/trait/istio_test.go
@@ -25,13 +25,13 @@ import (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/utils/pointer"
serving "knative.dev/serving/pkg/apis/serving/v1"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/kubernetes"
- "github.com/apache/camel-k/pkg/util/test"
)
func NewIstioTestEnv(t *testing.T, d *appsv1.Deployment, s *serving.Service, enabled bool) Environment {
@@ -48,7 +48,7 @@ func NewIstioTestEnv(t *testing.T, d *appsv1.Deployment, s *serving.Service, ena
Phase: v1.IntegrationPhaseDeploying,
},
Spec: v1.IntegrationSpec{
- Traits: make(map[string]v1.TraitSpec),
+ Traits: v1.Traits{},
},
},
Platform: &v1.IntegrationPlatform{
@@ -66,9 +66,11 @@ func NewIstioTestEnv(t *testing.T, d *appsv1.Deployment, s *serving.Service, ena
env.Platform.ResyncStatusFullConfig()
if enabled {
- env.Integration.Spec.Traits["istio"] = test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": true,
- })
+ env.Integration.Spec.Traits.Istio = &v1.IstioTrait{
+ Trait: v1.Trait{
+ Enabled: pointer.Bool(true),
+ },
+ }
}
return env
@@ -111,10 +113,8 @@ func TestIstioForcedInjectTrue(t *testing.T) {
}
env := NewIstioTestEnv(t, &d, &s, true)
- env.Integration.Spec.Traits["istio"] = test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": true,
- "inject": true,
- })
+ env.Integration.Spec.Traits.Istio.Enabled = pointer.Bool(true)
+ env.Integration.Spec.Traits.Istio.Inject = pointer.Bool(true)
err := env.Catalog.apply(&env)
assert.Nil(t, err)
@@ -138,10 +138,8 @@ func TestIstioForcedInjectFalse(t *testing.T) {
}
env := NewIstioTestEnv(t, &d, &s, true)
- env.Integration.Spec.Traits["istio"] = test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": true,
- "inject": false,
- })
+ env.Integration.Spec.Traits.Istio.Enabled = pointer.Bool(true)
+ env.Integration.Spec.Traits.Istio.Inject = pointer.Bool(false)
err := env.Catalog.apply(&env)
assert.Nil(t, err)
diff --git a/pkg/trait/jolokia.go b/pkg/trait/jolokia.go
index ca2725430..eae076c1a 100644
--- a/pkg/trait/jolokia.go
+++ b/pkg/trait/jolokia.go
@@ -29,50 +29,17 @@ import (
"github.com/apache/camel-k/pkg/util"
)
-// The Jolokia trait activates and configures the Jolokia Java agent.
-//
-// See https://jolokia.org/reference/html/agents.html
-//
-// +camel-k:trait=jolokia
-// nolint: tagliatelle
type jolokiaTrait struct {
- BaseTrait `property:",squash"`
- // The PEM encoded CA certification file path, used to verify client certificates,
- // applicable when `protocol` is `https` and `use-ssl-client-authentication` is `true`
- // (default `/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt` for OpenShift).
- CaCert *string `property:"ca-cert" json:"CACert,omitempty"`
- // The principal(s) which must be given in a client certificate to allow access to the Jolokia endpoint,
- // applicable when `protocol` is `https` and `use-ssl-client-authentication` is `true`
- // (default `clientPrincipal=cn=system:master-proxy`, `cn=hawtio-online.hawtio.svc` and `cn=fuse-console.fuse.svc` for OpenShift).
- ClientPrincipal []string `property:"client-principal" json:"clientPrincipal,omitempty"`
- // Listen for multicast requests (default `false`)
- DiscoveryEnabled *bool `property:"discovery-enabled" json:"discoveryEnabled,omitempty"`
- // Mandate the client certificate contains a client flag in the extended key usage section,
- // applicable when `protocol` is `https` and `use-ssl-client-authentication` is `true`
- // (default `true` for OpenShift).
- ExtendedClientCheck *bool `property:"extended-client-check" json:"extendedClientCheck,omitempty"`
- // The Host address to which the Jolokia agent should bind to. If `"\*"` or `"0.0.0.0"` is given,
- // the servers binds to every network interface (default `"*"`).
- Host *string `property:"host" json:"host,omitempty"`
- // The password used for authentication, applicable when the `user` option is set.
- Password *string `property:"password" json:"password,omitempty"`
- // The Jolokia endpoint port (default `8778`).
- Port int `property:"port" json:"port,omitempty"`
- // The protocol to use, either `http` or `https` (default `https` for OpenShift)
- Protocol *string `property:"protocol" json:"protocol,omitempty"`
- // The user to be used for authentication
- User *string `property:"user" json:"user,omitempty"`
- // Whether client certificates should be used for authentication (default `true` for OpenShift).
- UseSslClientAuthentication *bool `property:"use-ssl-client-authentication" json:"useSSLClientAuthentication,omitempty"`
- // A list of additional Jolokia options as defined
- // in https://jolokia.org/reference/html/agents.html#agent-jvm-config[JVM agent configuration options]
- Options []string `property:"options" json:"options,omitempty"`
+ BaseTrait
+ v1.JolokiaTrait `property:",squash"`
}
func newJolokiaTrait() Trait {
return &jolokiaTrait{
BaseTrait: NewBaseTrait("jolokia", 1800),
- Port: 8778,
+ JolokiaTrait: v1.JolokiaTrait{
+ Port: 8778,
+ },
}
}
diff --git a/pkg/trait/jvm.go b/pkg/trait/jvm.go
index 58fda571b..0cca3267a 100644
--- a/pkg/trait/jvm.go
+++ b/pkg/trait/jvm.go
@@ -43,30 +43,18 @@ import (
"github.com/apache/camel-k/pkg/util/envvar"
)
-// The JVM trait is used to configure the JVM that runs the integration.
-//
-// +camel-k:trait=jvm.
type jvmTrait struct {
- BaseTrait `property:",squash"`
- // Activates remote debugging, so that a debugger can be attached to the JVM, e.g., using port-forwarding
- Debug *bool `property:"debug" json:"debug,omitempty"`
- // Suspends the target JVM immediately before the main class is loaded
- DebugSuspend *bool `property:"debug-suspend" json:"debugSuspend,omitempty"`
- // Prints the command used the start the JVM in the container logs (default `true`)
- PrintCommand *bool `property:"print-command" json:"printCommand,omitempty"`
- // Transport address at which to listen for the newly launched JVM (default `*:5005`)
- DebugAddress string `property:"debug-address" json:"debugAddress,omitempty"`
- // A list of JVM options
- Options []string `property:"options" json:"options,omitempty"`
- // Additional JVM classpath (use `Linux` classpath separator)
- Classpath string `property:"classpath" json:"classpath,omitempty"`
+ BaseTrait
+ v1.JVMTrait `property:",squash"`
}
func newJvmTrait() Trait {
return &jvmTrait{
- BaseTrait: NewBaseTrait("jvm", 2000),
- DebugAddress: "*:5005",
- PrintCommand: pointer.Bool(true),
+ BaseTrait: NewBaseTrait("jvm", 2000),
+ JVMTrait: v1.JVMTrait{
+ DebugAddress: "*:5005",
+ PrintCommand: pointer.Bool(true),
+ },
}
}
diff --git a/pkg/trait/kamelets.go b/pkg/trait/kamelets.go
index 9109235d8..821b08761 100644
--- a/pkg/trait/kamelets.go
+++ b/pkg/trait/kamelets.go
@@ -39,15 +39,9 @@ import (
"github.com/apache/camel-k/pkg/util/kamelets"
)
-// The kamelets trait is a platform trait used to inject Kamelets into the integration runtime.
-//
-// +camel-k:trait=kamelets.
type kameletsTrait struct {
- BaseTrait `property:",squash"`
- // Automatically inject all referenced Kamelets and their default configuration (enabled by default)
- Auto *bool `property:"auto"`
- // Comma separated list of Kamelet names to load into the current integration
- List string `property:"list"`
+ BaseTrait
+ v1.KameletsTrait `property:",squash"`
}
type configurationKey struct {
diff --git a/pkg/trait/knative.go b/pkg/trait/knative.go
index 1ec29109f..34fcd8375 100644
--- a/pkg/trait/knative.go
+++ b/pkg/trait/knative.go
@@ -45,46 +45,9 @@ import (
"github.com/apache/camel-k/pkg/util/kubernetes"
)
-// The Knative trait automatically discovers addresses of Knative resources and inject them into the
-// running integration.
-//
-// The full Knative configuration is injected in the CAMEL_KNATIVE_CONFIGURATION in JSON format.
-// The Camel Knative component will then use the full configuration to configure the routes.
-//
-// The trait is enabled by default when the Knative profile is active.
-//
-// +camel-k:trait=knative.
type knativeTrait struct {
- BaseTrait `property:",squash"`
- // Can be used to inject a Knative complete configuration in JSON format.
- Configuration string `property:"configuration" json:"configuration,omitempty"`
- // List of channels used as source of integration routes.
- // Can contain simple channel names or full Camel URIs.
- ChannelSources []string `property:"channel-sources" json:"channelSources,omitempty"`
- // List of channels used as destination of integration routes.
- // Can contain simple channel names or full Camel URIs.
- ChannelSinks []string `property:"channel-sinks" json:"channelSinks,omitempty"`
- // List of channels used as source of integration routes.
- EndpointSources []string `property:"endpoint-sources" json:"endpointSources,omitempty"`
- // List of endpoints used as destination of integration routes.
- // Can contain simple endpoint names or full Camel URIs.
- EndpointSinks []string `property:"endpoint-sinks" json:"endpointSinks,omitempty"`
- // List of event types that the integration will be subscribed to.
- // Can contain simple event types or full Camel URIs (to use a specific broker different from "default").
- EventSources []string `property:"event-sources" json:"eventSources,omitempty"`
- // List of event types that the integration will produce.
- // Can contain simple event types or full Camel URIs (to use a specific broker).
- EventSinks []string `property:"event-sinks" json:"eventSinks,omitempty"`
- // Enables filtering on events based on the header "ce-knativehistory". Since this header has been removed in newer versions of
- // Knative, filtering is disabled by default.
- FilterSourceChannels *bool `property:"filter-source-channels" json:"filterSourceChannels,omitempty"`
- // Allows binding the integration to a sink via a Knative SinkBinding resource.
- // This can be used when the integration targets a single sink.
- // It's enabled by default when the integration targets a single sink
- // (except when the integration is owned by a Knative source).
- SinkBinding *bool `property:"sink-binding" json:"sinkBinding,omitempty"`
- // Enable automatic discovery of all trait properties.
- Auto *bool `property:"auto" json:"auto,omitempty"`
+ BaseTrait
+ v1.KnativeTrait `property:",squash"`
}
const (
diff --git a/pkg/trait/knative_service.go b/pkg/trait/knative_service.go
index 8a7b106c9..351c92044 100644
--- a/pkg/trait/knative_service.go
+++ b/pkg/trait/knative_service.go
@@ -46,46 +46,9 @@ const (
knativeServingRolloutDurationAnnotation = "serving.knative.dev/rolloutDuration"
)
-// The Knative Service trait allows configuring options when running the Integration as a Knative service, instead of
-// a standard Kubernetes Deployment.
-//
-// Running an Integration as a Knative Service enables auto-scaling (and scaling-to-zero), but those features
-// are only relevant when the Camel route(s) use(s) an HTTP endpoint consumer.
-//
-// +camel-k:trait=knative-service.
type knativeServiceTrait struct {
- BaseTrait `property:",squash"`
- // Configures the Knative autoscaling class property (e.g. to set `hpa.autoscaling.knative.dev` or `kpa.autoscaling.knative.dev` autoscaling).
- //
- // Refer to the Knative documentation for more information.
- Class string `property:"autoscaling-class" json:"class,omitempty"`
- // Configures the Knative autoscaling metric property (e.g. to set `concurrency` based or `cpu` based autoscaling).
- //
- // Refer to the Knative documentation for more information.
- Metric string `property:"autoscaling-metric" json:"autoscalingMetric,omitempty"`
- // Sets the allowed concurrency level or CPU percentage (depending on the autoscaling metric) for each Pod.
- //
- // Refer to the Knative documentation for more information.
- Target *int `property:"autoscaling-target" json:"autoscalingTarget,omitempty"`
- // The minimum number of Pods that should be running at any time for the integration. It's **zero** by default, meaning that
- // the integration is scaled down to zero when not used for a configured amount of time.
- //
- // Refer to the Knative documentation for more information.
- MinScale *int `property:"min-scale" json:"minScale,omitempty"`
- // An upper bound for the number of Pods that can be running in parallel for the integration.
- // Knative has its own cap value that depends on the installation.
- //
- // Refer to the Knative documentation for more information.
- MaxScale *int `property:"max-scale" json:"maxScale,omitempty"`
- // Enables to gradually shift traffic to the latest Revision and sets the rollout duration.
- // It's disabled by default and must be expressed as a Golang `time.Duration` string representation,
- // rounded to a second precision.
- RolloutDuration string `property:"rollout-duration" json:"rolloutDuration,omitempty"`
- // Automatically deploy the integration as Knative service when all conditions hold:
- //
- // * Integration is using the Knative profile
- // * All routes are either starting from a HTTP based consumer or a passive consumer (e.g. `direct` is a passive consumer)
- Auto *bool `property:"auto" json:"auto,omitempty"`
+ BaseTrait
+ v1.KnativeServiceTrait `property:",squash"`
}
var _ ControllerStrategySelector = &knativeServiceTrait{}
diff --git a/pkg/trait/knative_service_test.go b/pkg/trait/knative_service_test.go
index 47531649b..e3c91637b 100644
--- a/pkg/trait/knative_service_test.go
+++ b/pkg/trait/knative_service_test.go
@@ -24,6 +24,7 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/utils/pointer"
serving "knative.dev/serving/pkg/apis/serving/v1"
@@ -87,10 +88,12 @@ func TestKnativeService(t *testing.T) {
{Type: "secret", Value: "my-secret"},
{Type: "property", Value: "my-property=my-property-value"},
},
- Traits: map[string]v1.TraitSpec{
- "knative-service": test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": true,
- }),
+ Traits: v1.Traits{
+ KnativeService: &v1.KnativeServiceTrait{
+ Trait: v1.Trait{
+ Enabled: pointer.Bool(true),
+ },
+ },
},
},
},
@@ -201,17 +204,19 @@ func TestKnativeServiceWithCustomContainerName(t *testing.T) {
Spec: v1.IntegrationSpec{
Profile: v1.TraitProfileKnative,
- Traits: map[string]v1.TraitSpec{
- "deployer": test.TraitSpecFromMap(t, map[string]interface{}{
- "kind": "knative-service",
- }),
- "knative-service": test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": true,
- "auto": false,
- }),
- "container": test.TraitSpecFromMap(t, map[string]interface{}{
- "name": "my-container-name",
- }),
+ Traits: v1.Traits{
+ Deployer: &v1.DeployerTrait{
+ Kind: "knative-service",
+ },
+ KnativeService: &v1.KnativeServiceTrait{
+ Trait: v1.Trait{
+ Enabled: pointer.Bool(true),
+ },
+ Auto: pointer.Bool(false),
+ },
+ Container: &v1.ContainerTrait{
+ Name: "my-container-name",
+ },
},
},
},
@@ -248,10 +253,10 @@ func TestKnativeServiceWithCustomContainerName(t *testing.T) {
assert.NotNil(t, s)
- trait := test.TraitSpecToMap(t, environment.Integration.Spec.Traits["container"])
+ trait := environment.Integration.Spec.Traits.Container
assert.Equal(
t,
- trait["name"],
+ trait.Name,
s.Spec.ConfigurationSpec.Template.Spec.Containers[0].Name,
)
}
@@ -359,10 +364,10 @@ func TestKnativeServiceWithRollout(t *testing.T) {
Language: v1.LanguageXML,
},
},
- Traits: map[string]v1.TraitSpec{
- "knative-service": test.TraitSpecFromMap(t, map[string]interface{}{
- "rolloutDuration": "60s",
- }),
+ Traits: v1.Traits{
+ KnativeService: &v1.KnativeServiceTrait{
+ RolloutDuration: "60s",
+ },
},
},
},
diff --git a/pkg/trait/knative_test.go b/pkg/trait/knative_test.go
index ac63b66b5..12bc8d4b0 100644
--- a/pkg/trait/knative_test.go
+++ b/pkg/trait/knative_test.go
@@ -24,6 +24,7 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/utils/pointer"
eventingduckv1 "knative.dev/eventing/pkg/apis/duck/v1"
eventing "knative.dev/eventing/pkg/apis/eventing/v1"
@@ -62,17 +63,19 @@ func TestKnativeEnvConfigurationFromTrait(t *testing.T) {
Profile: v1.TraitProfileKnative,
Sources: []v1.SourceSpec{},
Resources: []v1.ResourceSpec{},
- Traits: map[string]v1.TraitSpec{
- "knative": test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": true,
- "auto": false,
- "channelSources": []string{"channel-source-1"},
- "channelSinks": []string{"channel-sink-1"},
- "endpointSources": []string{"endpoint-source-1"},
- "endpointSinks": []string{"endpoint-sink-1", "endpoint-sink-2"},
- "eventSources": []string{"knative:event"},
- "eventSinks": []string{"knative:event"},
- }),
+ Traits: v1.Traits{
+ Knative: &v1.KnativeTrait{
+ Trait: v1.Trait{
+ Enabled: pointer.Bool(true),
+ },
+ Auto: pointer.Bool(false),
+ ChannelSources: []string{"channel-source-1"},
+ ChannelSinks: []string{"channel-sink-1"},
+ EndpointSources: []string{"endpoint-source-1"},
+ EndpointSinks: []string{"endpoint-sink-1", "endpoint-sink-2"},
+ EventSources: []string{"knative:event"},
+ EventSinks: []string{"knative:event"},
+ },
},
},
},
@@ -188,10 +191,12 @@ func TestKnativeEnvConfigurationFromSource(t *testing.T) {
},
},
Resources: []v1.ResourceSpec{},
- Traits: map[string]v1.TraitSpec{
- "knative": test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": true,
- }),
+ Traits: v1.Traits{
+ Knative: &v1.KnativeTrait{
+ Trait: v1.Trait{
+ Enabled: pointer.Bool(true),
+ },
+ },
},
},
},
@@ -373,10 +378,12 @@ func NewFakeEnvironment(t *testing.T, source v1.SourceSpec) Environment {
source,
},
Resources: []v1.ResourceSpec{},
- Traits: map[string]v1.TraitSpec{
- "knative": test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": true,
- }),
+ Traits: v1.Traits{
+ Knative: &v1.KnativeTrait{
+ Trait: v1.Trait{
+ Enabled: pointer.Bool(true),
+ },
+ },
},
},
},
diff --git a/pkg/trait/logging.go b/pkg/trait/logging.go
index 5b3237123..bb13043b1 100644
--- a/pkg/trait/logging.go
+++ b/pkg/trait/logging.go
@@ -20,6 +20,7 @@ package trait
import (
"k8s.io/utils/pointer"
+ v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
"github.com/apache/camel-k/pkg/util/envvar"
)
@@ -32,28 +33,17 @@ const (
defaultLogLevel = "INFO"
)
-// The Logging trait is used to configure Integration runtime logging options (such as color and format).
-// The logging backend is provided by Quarkus, whose configuration is documented at https://quarkus.io/guides/logging.
-//
-// +camel-k:trait=logging.
type loggingTrait struct {
- BaseTrait `property:",squash"`
- // Colorize the log output
- Color *bool `property:"color" json:"color,omitempty"`
- // Logs message format
- Format string `property:"format" json:"format,omitempty"`
- // Adjust the logging level (defaults to INFO)
- Level string `property:"level" json:"level,omitempty"`
- // Output the logs in JSON
- JSON *bool `property:"json" json:"json,omitempty"`
- // Enable "pretty printing" of the JSON logs
- JSONPrettyPrint *bool `property:"json-pretty-print" json:"jsonPrettyPrint,omitempty"`
+ BaseTrait
+ v1.LoggingTrait `property:",squash"`
}
func newLoggingTraitTrait() Trait {
return &loggingTrait{
BaseTrait: NewBaseTrait("logging", 800),
- Level: defaultLogLevel,
+ LoggingTrait: v1.LoggingTrait{
+ Level: defaultLogLevel,
+ },
}
}
diff --git a/pkg/trait/logging_test.go b/pkg/trait/logging_test.go
index 9c142e3c9..519932c91 100644
--- a/pkg/trait/logging_test.go
+++ b/pkg/trait/logging_test.go
@@ -25,11 +25,11 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/kubernetes"
- "github.com/apache/camel-k/pkg/util/test"
)
func createLoggingTestEnv(t *testing.T, color bool, json bool, jsonPrettyPrint bool, logLevel string, logFormat string) *Environment {
@@ -54,14 +54,14 @@ func createLoggingTestEnv(t *testing.T, color bool, json bool, jsonPrettyPrint b
},
Spec: v1.IntegrationSpec{
Profile: v1.TraitProfileOpenShift,
- Traits: map[string]v1.TraitSpec{
- "logging": test.TraitSpecFromMap(t, map[string]interface{}{
- "color": color,
- "format": logFormat,
- "json": json,
- "json-pretty-print": jsonPrettyPrint,
- "level": logLevel,
- }),
+ Traits: v1.Traits{
+ Logging: &v1.LoggingTrait{
+ Color: pointer.Bool(color),
+ Format: logFormat,
+ JSON: pointer.Bool(json),
+ JSONPrettyPrint: pointer.Bool(jsonPrettyPrint),
+ Level: logLevel,
+ },
},
},
},
diff --git a/pkg/trait/mount.go b/pkg/trait/mount.go
index 039e3ccc3..fb81840c7 100644
--- a/pkg/trait/mount.go
+++ b/pkg/trait/mount.go
@@ -35,24 +35,9 @@ import (
utilResource "github.com/apache/camel-k/pkg/util/resource"
)
-// The Mount trait can be used to configure volumes mounted on the Integration Pods.
-//
-// +camel-k:trait=mount
-// nolint: tagliatelle
type mountTrait struct {
- BaseTrait `property:",squash"`
- // A list of configuration pointing to configmap/secret.
- // The configuration are expected to be UTF-8 resources as they are processed by runtime Camel Context and tried to be parsed as property files.
- // They are also made available on the classpath in order to ease their usage directly from the Route.
- // Syntax: [configmap|secret]:name[/key], where name represents the resource name and key optionally represents the resource key to be filtered
- Configs []string `property:"configs" json:"configs,omitempty"`
- // A list of resources (text or binary content) pointing to configmap/secret.
- // The resources are expected to be any resource type (text or binary content).
- // The destination path can be either a default location or any path specified by the user.
- // Syntax: [configmap|secret]:name[/key][@path], where name represents the resource name, key optionally represents the resource key to be filtered and path represents the destination path
- Resources []string `property:"resources" json:"resources,omitempty"`
- // A list of Persistent Volume Claims to be mounted. Syntax: [pvcname:/container/path]
- Volumes []string `property:"volumes" json:"volumes,omitempty"`
+ BaseTrait
+ v1.MountTrait `property:",squash"`
}
func newMountTrait() Trait {
diff --git a/pkg/trait/mount_test.go b/pkg/trait/mount_test.go
index 922124448..34a6e4924 100644
--- a/pkg/trait/mount_test.go
+++ b/pkg/trait/mount_test.go
@@ -38,7 +38,7 @@ func TestMountVolumesEmpty(t *testing.T) {
traitCatalog := NewCatalog(nil)
environment := getNominalEnv(t, traitCatalog)
- environment.Integration.Spec.Traits = map[string]v1.TraitSpec{}
+ environment.Integration.Spec.Traits = v1.Traits{} // empty traits
environment.Platform.ResyncStatusFullConfig()
err := traitCatalog.apply(environment)
@@ -153,12 +153,12 @@ func getNominalEnv(t *testing.T, traitCatalog *Catalog) *Environment {
Language: v1.LanguageJavaScript,
},
},
- Traits: map[string]v1.TraitSpec{
- "mount": test.TraitSpecFromMap(t, map[string]interface{}{
- "configs": []string{"configmap:my-cm"},
- "resources": []string{"secret:my-secret"},
- "volumes": []string{"my-pvc:/over/the/rainbow"},
- }),
+ Traits: v1.Traits{
+ Mount: &v1.MountTrait{
+ Configs: []string{"configmap:my-cm"},
+ Resources: []string{"secret:my-secret"},
+ Volumes: []string{"my-pvc:/over/the/rainbow"},
+ },
},
},
},
diff --git a/pkg/trait/openapi.go b/pkg/trait/openapi.go
index d1392bc30..1d48367d0 100644
--- a/pkg/trait/openapi.go
+++ b/pkg/trait/openapi.go
@@ -47,13 +47,9 @@ import (
"github.com/apache/camel-k/pkg/util/maven"
)
-// The OpenAPI DSL trait is internally used to allow creating integrations from a OpenAPI specs.
-//
-// +camel-k:trait=openapi.
type openAPITrait struct {
- BaseTrait `property:",squash"`
- // The configmaps holding the spec of the OpenAPI
- Configmaps []string `property:"configmaps" json:"configmaps,omitempty"`
+ BaseTrait
+ v1.OpenAPITrait `property:",squash"`
}
func newOpenAPITrait() Trait {
diff --git a/pkg/trait/owner.go b/pkg/trait/owner.go
index 5bff48922..0ac1f0259 100644
--- a/pkg/trait/owner.go
+++ b/pkg/trait/owner.go
@@ -27,16 +27,9 @@ import (
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
)
-// The Owner trait ensures that all created resources belong to the integration being created
-// and transfers annotations and labels on the integration onto these owned resources.
-//
-// +camel-k:trait=owner.
type ownerTrait struct {
- BaseTrait `property:",squash"`
- // The set of annotations to be transferred
- TargetAnnotations []string `property:"target-annotations" json:"targetAnnotations,omitempty"`
- // The set of labels to be transferred
- TargetLabels []string `property:"target-labels" json:"targetLabels,omitempty"`
+ BaseTrait
+ v1.OwnerTrait `property:",squash"`
}
func newOwnerTrait() Trait {
diff --git a/pkg/trait/owner_test.go b/pkg/trait/owner_test.go
index 2bf1a328f..96aaa8491 100644
--- a/pkg/trait/owner_test.go
+++ b/pkg/trait/owner_test.go
@@ -26,7 +26,6 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
- "github.com/apache/camel-k/pkg/util/test"
)
func TestOwner(t *testing.T) {
@@ -44,11 +43,11 @@ func SetUpOwnerEnvironment(t *testing.T) *Environment {
t.Helper()
env := createTestEnv(t, v1.IntegrationPlatformClusterOpenShift, "camel:core")
- env.Integration.Spec.Traits = map[string]v1.TraitSpec{
- "owner": test.TraitSpecFromMap(t, map[string]interface{}{
- "targetLabels": []string{"com.mycompany/mylabel1"},
- "targetAnnotations": []string{"com.mycompany/myannotation2"},
- }),
+ env.Integration.Spec.Traits = v1.Traits{
+ Owner: &v1.OwnerTrait{
+ TargetLabels: []string{"com.mycompany/mylabel1"},
+ TargetAnnotations: []string{"com.mycompany/myannotation2"},
+ },
}
env.Integration.SetLabels(map[string]string{
diff --git a/pkg/trait/pdb.go b/pkg/trait/pdb.go
index 92fcbf9b9..cb57e4a99 100644
--- a/pkg/trait/pdb.go
+++ b/pkg/trait/pdb.go
@@ -28,19 +28,9 @@ import (
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
)
-// The PDB trait allows to configure the PodDisruptionBudget resource for the Integration pods.
-//
-// +camel-k:trait=pdb.
type pdbTrait struct {
- BaseTrait `property:",squash"`
- // The number of pods for the Integration that must still be available after an eviction.
- // It can be either an absolute number or a percentage.
- // Only one of `min-available` and `max-unavailable` can be specified.
- MinAvailable string `property:"min-available" json:"minAvailable,omitempty"`
- // The number of pods for the Integration that can be unavailable after an eviction.
- // It can be either an absolute number or a percentage (default `1` if `min-available` is also not set).
- // Only one of `max-unavailable` and `min-available` can be specified.
- MaxUnavailable string `property:"max-unavailable" json:"maxUnavailable,omitempty"`
+ BaseTrait
+ v1.PDBTrait `property:",squash"`
}
func newPdbTrait() Trait {
diff --git a/pkg/trait/platform.go b/pkg/trait/platform.go
index c80c99c2f..6c1cebabe 100644
--- a/pkg/trait/platform.go
+++ b/pkg/trait/platform.go
@@ -26,21 +26,9 @@ import (
"github.com/apache/camel-k/pkg/util/openshift"
)
-// The platform trait is a base trait that is used to assign an integration platform to an integration.
-//
-// In case the platform is missing, the trait is allowed to create a default platform.
-// This feature is especially useful in contexts where there's no need to provide a custom configuration for the platform
-// (e.g. on OpenShift the default settings work, since there's an embedded container image registry).
-//
-// +camel-k:trait=platform.
type platformTrait struct {
- BaseTrait `property:",squash"`
- // To create a default (empty) platform when the platform is missing.
- CreateDefault *bool `property:"create-default" json:"createDefault,omitempty"`
- // Indicates if the platform should be created globally in the case of global operator (default true).
- Global *bool `property:"global" json:"global,omitempty"`
- // To automatically detect from the environment if a default platform can be created (it will be created on OpenShift only).
- Auto *bool `property:"auto" json:"auto,omitempty"`
+ BaseTrait
+ v1.PlatformTrait `property:",squash"`
}
func newPlatformTrait() Trait {
diff --git a/pkg/trait/pod.go b/pkg/trait/pod.go
index c6415189e..6bdc6763f 100644
--- a/pkg/trait/pod.go
+++ b/pkg/trait/pod.go
@@ -32,16 +32,9 @@ import (
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
)
-// The pod trait allows the customization of the Integration pods.
-// It applies the `PodSpecTemplate` struct contained in the Integration `.spec.podTemplate` field,
-// into the Integration deployment Pods template, using strategic merge patch.
-//
-// This can be used to customize the container where Camel routes execute,
-// by using the `integration` container name.
-//
-// +camel-k:trait=pod.
type podTrait struct {
- BaseTrait `property:",squash"`
+ BaseTrait
+ v1.PodTrait `property:",squash"`
}
func newPodTrait() Trait {
diff --git a/pkg/trait/prometheus.go b/pkg/trait/prometheus.go
index 9dd90cf36..9997bac76 100644
--- a/pkg/trait/prometheus.go
+++ b/pkg/trait/prometheus.go
@@ -30,30 +30,17 @@ import (
"github.com/apache/camel-k/pkg/util"
)
-// The Prometheus trait configures a Prometheus-compatible endpoint. It also creates a `PodMonitor` resource,
-// so that the endpoint can be scraped automatically, when using the Prometheus operator.
-//
-// The metrics are exposed using MicroProfile Metrics.
-//
-// WARNING: The creation of the `PodMonitor` resource requires the https://github.com/coreos/prometheus-operator[Prometheus Operator]
-// custom resource definition to be installed.
-// You can set `pod-monitor` to `false` for the Prometheus trait to work without the Prometheus Operator.
-//
-// The Prometheus trait is disabled by default.
-//
-// +camel-k:trait=prometheus.
type prometheusTrait struct {
- BaseTrait `property:",squash"`
- // Whether a `PodMonitor` resource is created (default `true`).
- PodMonitor *bool `property:"pod-monitor" json:"podMonitor,omitempty"`
- // The `PodMonitor` resource labels, applicable when `pod-monitor` is `true`.
- PodMonitorLabels []string `property:"pod-monitor-labels" json:"podMonitorLabels,omitempty"`
+ BaseTrait
+ v1.PrometheusTrait `property:",squash"`
}
func newPrometheusTrait() Trait {
return &prometheusTrait{
- BaseTrait: NewBaseTrait("prometheus", 1900),
- PodMonitor: pointer.Bool(true),
+ BaseTrait: NewBaseTrait("prometheus", 1900),
+ PrometheusTrait: v1.PrometheusTrait{
+ PodMonitor: pointer.Bool(true),
+ },
}
}
diff --git a/pkg/trait/pull_secret.go b/pkg/trait/pull_secret.go
index 05469f913..ab758bb4f 100644
--- a/pkg/trait/pull_secret.go
+++ b/pkg/trait/pull_secret.go
@@ -29,31 +29,15 @@ import (
ctrl "sigs.k8s.io/controller-runtime/pkg/client"
+ v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
"github.com/apache/camel-k/pkg/platform"
"github.com/apache/camel-k/pkg/util/kubernetes"
"github.com/apache/camel-k/pkg/util/openshift"
)
-// The Pull Secret trait sets a pull secret on the pod,
-// to allow Kubernetes to retrieve the container image from an external registry.
-//
-// The pull secret can be specified manually or, in case you've configured authentication for an external container registry
-// on the `IntegrationPlatform`, the same secret is used to pull images.
-//
-// It's enabled by default whenever you configure authentication for an external container registry,
-// so it assumes that external registries are private.
-//
-// If your registry does not need authentication for pulling images, you can disable this trait.
-//
-// +camel-k:trait=pull-secret.
type pullSecretTrait struct {
- BaseTrait `property:",squash"`
- // The pull secret name to set on the Pod. If left empty this is automatically taken from the `IntegrationPlatform` registry configuration.
- SecretName string `property:"secret-name" json:"secretName,omitempty"`
- // When using a global operator with a shared platform, this enables delegation of the `system:image-puller` cluster role on the operator namespace to the integration service account.
- ImagePullerDelegation *bool `property:"image-puller-delegation" json:"imagePullerDelegation,omitempty"`
- // Automatically configures the platform registry secret on the pod if it is of type `kubernetes.io/dockerconfigjson`.
- Auto *bool `property:"auto" json:"auto,omitempty"`
+ BaseTrait
+ v1.PullSecretTrait `property:",squash"`
}
func newPullSecretTrait() Trait {
diff --git a/pkg/trait/quarkus.go b/pkg/trait/quarkus.go
index 5abe7f7d5..9890f124c 100644
--- a/pkg/trait/quarkus.go
+++ b/pkg/trait/quarkus.go
@@ -18,7 +18,6 @@ limitations under the License.
package trait
import (
- "encoding/json"
"fmt"
"sort"
@@ -33,40 +32,18 @@ import (
"github.com/apache/camel-k/pkg/util/kubernetes"
)
-type quarkusPackageType string
-
const (
quarkusTraitID = "quarkus"
-
- fastJarPackageType quarkusPackageType = "fast-jar"
- nativePackageType quarkusPackageType = "native"
)
-var kitPriority = map[quarkusPackageType]string{
- fastJarPackageType: "1000",
- nativePackageType: "2000",
+var kitPriority = map[v1.QuarkusPackageType]string{
+ v1.FastJarPackageType: "1000",
+ v1.NativePackageType: "2000",
}
-// The Quarkus trait configures the Quarkus runtime.
-//
-// It's enabled by default.
-//
-// NOTE: Compiling to a native executable, i.e. when using `package-type=native`, is only supported
-// for kamelets, as well as YAML and XML integrations.
-// It also requires at least 4GiB of memory, so the Pod running the native build, that is either
-// the operator Pod, or the build Pod (depending on the build strategy configured for the platform),
-// must have enough memory available.
-//
-// +camel-k:trait=quarkus.
type quarkusTrait struct {
- BaseTrait `property:",squash"`
- // The Quarkus package types, either `fast-jar` or `native` (default `fast-jar`).
- // In case both `fast-jar` and `native` are specified, two `IntegrationKit` resources are created,
- // with the `native` kit having precedence over the `fast-jar` one once ready.
- // The order influences the resolution of the current kit for the integration.
- // The kit corresponding to the first package type will be assigned to the
- // integration in case no existing kit that matches the integration exists.
- PackageTypes []quarkusPackageType `property:"package-type" json:"packageTypes,omitempty"`
+ BaseTrait
+ v1.QuarkusTrait `property:",squash"`
}
func newQuarkusTrait() Trait {
@@ -97,13 +74,13 @@ func (t *quarkusTrait) Matches(trait Trait) bool {
return false
}
- if len(t.PackageTypes) == 0 && len(qt.PackageTypes) != 0 && !containsPackageType(qt.PackageTypes, fastJarPackageType) {
+ if len(t.PackageTypes) == 0 && len(qt.PackageTypes) != 0 && !containsPackageType(qt.PackageTypes, v1.FastJarPackageType) {
return false
}
types:
for _, pt := range t.PackageTypes {
- if pt == fastJarPackageType && len(qt.PackageTypes) == 0 {
+ if pt == v1.FastJarPackageType && len(qt.PackageTypes) == 0 {
continue
}
if containsPackageType(qt.PackageTypes, pt) {
@@ -128,7 +105,7 @@ func (t *quarkusTrait) Configure(e *Environment) (bool, error) {
func (t *quarkusTrait) Apply(e *Environment) error {
if e.IntegrationInPhase(v1.IntegrationPhaseBuildingKit) {
- if containsPackageType(t.PackageTypes, nativePackageType) {
+ if containsPackageType(t.PackageTypes, v1.NativePackageType) {
// Native compilation is only supported for a subset of languages,
// so let's check for compatibility, and fail-fast the Integration,
// to save compute resources and user time.
@@ -151,7 +128,7 @@ func (t *quarkusTrait) Apply(e *Environment) error {
switch len(t.PackageTypes) {
case 0:
- kit := t.newIntegrationKit(e, fastJarPackageType)
+ kit := t.newIntegrationKit(e, v1.FastJarPackageType)
e.IntegrationKits = append(e.IntegrationKits, *kit)
case 1:
@@ -161,25 +138,10 @@ func (t *quarkusTrait) Apply(e *Environment) error {
default:
for _, packageType := range t.PackageTypes {
kit := t.newIntegrationKit(e, packageType)
- data, err := json.Marshal(kit.Spec.Traits[quarkusTraitID].Configuration)
- if err != nil {
- return err
- }
- trait := quarkusTrait{}
- err = json.Unmarshal(data, &trait)
- if err != nil {
- return err
- }
- trait.PackageTypes = []quarkusPackageType{packageType}
- data, err = json.Marshal(trait)
- if err != nil {
- return err
- }
- kit.Spec.Traits[quarkusTraitID] = v1.TraitSpec{
- Configuration: v1.TraitConfiguration{
- RawMessage: data,
- },
+ if kit.Spec.Traits.Quarkus == nil {
+ kit.Spec.Traits.Quarkus = &v1.QuarkusTrait{}
}
+ kit.Spec.Traits.Quarkus.PackageTypes = []v1.QuarkusPackageType{packageType}
e.IntegrationKits = append(e.IntegrationKits, *kit)
}
}
@@ -212,14 +174,14 @@ func (t *quarkusTrait) Apply(e *Environment) error {
}
if native {
- build.Maven.Properties["quarkus.package.type"] = string(nativePackageType)
+ build.Maven.Properties["quarkus.package.type"] = string(v1.NativePackageType)
steps = append(steps, builder.Image.NativeImageContext)
// Spectrum does not rely on Dockerfile to assemble the image
if e.Platform.Status.Build.PublishStrategy != v1.IntegrationPlatformBuildPublishStrategySpectrum {
steps = append(steps, builder.Image.ExecutableDockerfile)
}
} else {
- build.Maven.Properties["quarkus.package.type"] = string(fastJarPackageType)
+ build.Maven.Properties["quarkus.package.type"] = string(v1.FastJarPackageType)
steps = append(steps, builder.Quarkus.ComputeQuarkusDependencies, builder.Image.IncrementalImageContext)
// Spectrum does not rely on Dockerfile to assemble the image
if e.Platform.Status.Build.PublishStrategy != v1.IntegrationPlatformBuildPublishStrategySpectrum {
@@ -249,7 +211,7 @@ func (t *quarkusTrait) Apply(e *Environment) error {
return nil
}
-func (t *quarkusTrait) newIntegrationKit(e *Environment, packageType quarkusPackageType) *v1.IntegrationKit {
+func (t *quarkusTrait) newIntegrationKit(e *Environment, packageType v1.QuarkusPackageType) *v1.IntegrationKit {
integration := e.Integration
kit := v1.NewIntegrationKit(integration.GetIntegrationKitNamespace(e.Platform), fmt.Sprintf("kit-%s", xid.New()))
@@ -276,35 +238,24 @@ func (t *quarkusTrait) newIntegrationKit(e *Environment, packageType quarkusPack
kit.Annotations[v1.OperatorIDAnnotation] = operatorID
}
- traits := t.getKitTraits(e)
-
kit.Spec = v1.IntegrationKitSpec{
Dependencies: e.Integration.Status.Dependencies,
Repositories: e.Integration.Spec.Repositories,
- Traits: traits,
+ Traits: v1.IntegrationKitTraits{
+ Builder: e.Integration.Spec.Traits.Builder,
+ Quarkus: e.Integration.Spec.Traits.Quarkus,
+ },
}
return kit
}
-func (t *quarkusTrait) getKitTraits(e *Environment) map[string]v1.TraitSpec {
- traits := make(map[string]v1.TraitSpec)
- for name, spec := range e.Integration.Spec.Traits {
- t := e.Catalog.GetTrait(name)
- if t != nil && !t.InfluencesKit() {
- continue
- }
- traits[name] = spec
- }
- return traits
-}
-
func (t *quarkusTrait) isNativeKit(e *Environment) (bool, error) {
switch types := t.PackageTypes; len(types) {
case 0:
return false, nil
case 1:
- return types[0] == nativePackageType, nil
+ return types[0] == v1.NativePackageType, nil
default:
return false, fmt.Errorf("kit %q has more than one package type", e.IntegrationKit.Name)
}
@@ -324,7 +275,7 @@ func getBuilderTask(tasks []v1.Task) *v1.BuilderTask {
return nil
}
-func containsPackageType(types []quarkusPackageType, t quarkusPackageType) bool {
+func containsPackageType(types []v1.QuarkusPackageType, t v1.QuarkusPackageType) bool {
for _, ti := range types {
if t == ti {
return true
diff --git a/pkg/trait/registry.go b/pkg/trait/registry.go
index fdc2ac79f..368410675 100644
--- a/pkg/trait/registry.go
+++ b/pkg/trait/registry.go
@@ -36,12 +36,9 @@ import (
ctrl "sigs.k8s.io/controller-runtime/pkg/client"
)
-// The Registry trait sets up Maven to use the Image registry
-// as a Maven repository.
-//
-// +camel-k:trait=registry.
type registryTrait struct {
- BaseTrait `property:",squash"`
+ BaseTrait
+ v1.RegistryTrait
}
func newRegistryTrait() Trait {
diff --git a/pkg/trait/route.go b/pkg/trait/route.go
index 4575cd88b..652f6bee5 100644
--- a/pkg/trait/route.go
+++ b/pkg/trait/route.go
@@ -33,68 +33,10 @@ import (
"github.com/apache/camel-k/pkg/util/kubernetes"
)
-// The Route trait can be used to configure the creation of OpenShift routes for the integration.
-//
-// The certificate and key contents may be sourced either from the local filesystem or in a Openshift `secret` object.
-// The user may use the parameters ending in `-secret` (example: `tls-certificate-secret`) to reference a certificate stored in a `secret`.
-// Parameters ending in `-secret` have higher priorities and in case the same route parameter is set, for example: `tls-key-secret` and `tls-key`,
-// then `tls-key-secret` is used.
-// The recommended approach to set the key and certificates is to use `secrets` to store their contents and use the
-// following parameters to reference them: `tls-certificate-secret`, `tls-key-secret`, `tls-ca-certificate-secret`, `tls-destination-ca-certificate-secret`
-// See the examples section at the end of this page to see the setup options.
-//
-// +camel-k:trait=route
-// nolint: tagliatelle
type routeTrait struct {
- BaseTrait `property:",squash"`
- // To configure the host exposed by the route.
- Host string `property:"host" json:"host,omitempty"`
- // The TLS termination type, like `edge`, `passthrough` or `reencrypt`.
- //
- // Refer to the OpenShift route documentation for additional information.
- TLSTermination string `property:"tls-termination" json:"tlsTermination,omitempty"`
- // The TLS certificate contents.
- //
- // Refer to the OpenShift route documentation for additional information.
- TLSCertificate string `property:"tls-certificate" json:"tlsCertificate,omitempty"`
- // The secret name and key reference to the TLS certificate. The format is "secret-name[/key-name]", the value represents the secret name, if there is only one key in the secret it will be read, otherwise you can set a key name separated with a "/".
- //
- // Refer to the OpenShift route documentation for additional information.
- TLSCertificateSecret string `property:"tls-certificate-secret" json:"tlsCertificateSecret,omitempty"`
- // The TLS certificate key contents.
- //
- // Refer to the OpenShift route documentation for additional information.
- TLSKey string `property:"tls-key" json:"tlsKey,omitempty"`
- // The secret name and key reference to the TLS certificate key. The format is "secret-name[/key-name]", the value represents the secret name, if there is only one key in the secret it will be read, otherwise you can set a key name separated with a "/".
- //
- // Refer to the OpenShift route documentation for additional information.
- TLSKeySecret string `property:"tls-key-secret" json:"tlsKeySecret,omitempty"`
- // The TLS CA certificate contents.
- //
- // Refer to the OpenShift route documentation for additional information.
- TLSCACertificate string `property:"tls-ca-certificate" json:"tlsCACertificate,omitempty"`
- // The secret name and key reference to the TLS CA certificate. The format is "secret-name[/key-name]", the value represents the secret name, if there is only one key in the secret it will be read, otherwise you can set a key name separated with a "/".
- //
- // Refer to the OpenShift route documentation for additional information.
- TLSCACertificateSecret string `property:"tls-ca-certificate-secret" json:"tlsCACertificateSecret,omitempty"`
- // The destination CA certificate provides the contents of the ca certificate of the final destination. When using reencrypt
- // termination this file should be provided in order to have routers use it for health checks on the secure connection.
- // If this field is not specified, the router may provide its own destination CA and perform hostname validation using
- // the short service name (service.namespace.svc), which allows infrastructure generated certificates to automatically
- // verify.
- //
- // Refer to the OpenShift route documentation for additional information.
- TLSDestinationCACertificate string `property:"tls-destination-ca-certificate" json:"tlsDestinationCACertificate,omitempty"`
- // The secret name and key reference to the destination CA certificate. The format is "secret-name[/key-name]", the value represents the secret name, if there is only one key in the secret it will be read, otherwise you can set a key name separated with a "/".
- //
- // Refer to the OpenShift route documentation for additional information.
- TLSDestinationCACertificateSecret string `property:"tls-destination-ca-certificate-secret" json:"tlsDestinationCACertificateSecret,omitempty"`
- // To configure how to deal with insecure traffic, e.g. `Allow`, `Disable` or `Redirect` traffic.
- //
- // Refer to the OpenShift route documentation for additional information.
- TLSInsecureEdgeTerminationPolicy string `property:"tls-insecure-edge-termination-policy" json:"tlsInsecureEdgeTerminationPolicy,omitempty"`
-
- service *corev1.Service
+ BaseTrait
+ v1.RouteTrait `property:",squash"`
+ service *corev1.Service
}
func newRouteTrait() Trait {
diff --git a/pkg/trait/route_test.go b/pkg/trait/route_test.go
index 96c67a4c4..241210177 100644
--- a/pkg/trait/route_test.go
+++ b/pkg/trait/route_test.go
@@ -27,6 +27,7 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
"github.com/apache/camel-k/pkg/util/camel"
@@ -217,10 +218,12 @@ func TestRoute_Default(t *testing.T) {
func TestRoute_Disabled(t *testing.T) {
name := xid.New().String()
environment := createTestRouteEnvironment(t, name)
- environment.Integration.Spec.Traits = map[string]v1.TraitSpec{
- "route": test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": false,
- }),
+ environment.Integration.Spec.Traits = v1.Traits{
+ Route: &v1.RouteTrait{
+ Trait: v1.Trait{
+ Enabled: pointer.Bool(false),
+ },
+ },
}
traitsCatalog := environment.Catalog
@@ -256,10 +259,10 @@ func TestRoute_Host(t *testing.T) {
environment := createTestRouteEnvironment(t, name)
traitsCatalog := environment.Catalog
- environment.Integration.Spec.Traits = map[string]v1.TraitSpec{
- "route": test.TraitSpecFromMap(t, map[string]interface{}{
- "host": host,
- }),
+ environment.Integration.Spec.Traits = v1.Traits{
+ Route: &v1.RouteTrait{
+ Host: host,
+ },
}
err := traitsCatalog.apply(environment)
@@ -282,15 +285,15 @@ func TestRoute_TLS_From_Secret_reencrypt(t *testing.T) {
environment := createTestRouteEnvironment(t, name)
traitsCatalog := environment.Catalog
- environment.Integration.Spec.Traits = map[string]v1.TraitSpec{
- "route": test.TraitSpecFromMap(t, map[string]interface{}{
- "tlsTermination": string(routev1.TLSTerminationReencrypt),
- "host": host,
- "tlsKeySecret": tlsKeySecretName,
- "tlsCertificateSecret": tlsMultipleSecretsName + "/" + tlsMultipleSecretsCert1Key,
- "tlsCACertificateSecret": tlsMultipleSecretsName + "/" + tlsMultipleSecretsCert2Key,
- "tlsDestinationCACertificateSecret": tlsMultipleSecretsName + "/" + tlsMultipleSecretsCert3Key,
- }),
+ environment.Integration.Spec.Traits = v1.Traits{
+ Route: &v1.RouteTrait{
+ TLSTermination: string(routev1.TLSTerminationReencrypt),
+ Host: host,
+ TLSKeySecret: tlsKeySecretName,
+ TLSCertificateSecret: tlsMultipleSecretsName + "/" + tlsMultipleSecretsCert1Key,
+ TLSCACertificateSecret: tlsMultipleSecretsName + "/" + tlsMultipleSecretsCert2Key,
+ TLSDestinationCACertificateSecret: tlsMultipleSecretsName + "/" + tlsMultipleSecretsCert3Key,
+ },
}
err := traitsCatalog.apply(environment)
@@ -317,15 +320,15 @@ func TestRoute_TLS_wrong_secret(t *testing.T) {
environment := createTestRouteEnvironment(t, name)
traitsCatalog := environment.Catalog
- environment.Integration.Spec.Traits = map[string]v1.TraitSpec{
- "route": test.TraitSpecFromMap(t, map[string]interface{}{
- "tlsTermination": string(routev1.TLSTerminationReencrypt),
- "host": host,
- "tlsKeySecret": "foo",
- "tlsCertificateSecret": "bar",
- "tlsCACertificateSecret": "test",
- "tlsDestinationCACertificateSecret": "404",
- }),
+ environment.Integration.Spec.Traits = v1.Traits{
+ Route: &v1.RouteTrait{
+ TLSTermination: string(routev1.TLSTerminationReencrypt),
+ Host: host,
+ TLSKeySecret: "foo",
+ TLSCertificateSecret: "bar",
+ TLSCACertificateSecret: "test",
+ TLSDestinationCACertificateSecret: "404",
+ },
}
err := traitsCatalog.apply(environment)
@@ -346,14 +349,14 @@ func TestRoute_TLS_secret_wrong_key(t *testing.T) {
environment := createTestRouteEnvironment(t, name)
traitsCatalog := environment.Catalog
- environment.Integration.Spec.Traits = map[string]v1.TraitSpec{
- "route": test.TraitSpecFromMap(t, map[string]interface{}{
- "tlsTermination": string(routev1.TLSTerminationReencrypt),
- "host": host,
- "tlsKeySecret": tlsKeySecretName,
- "tlsCertificateSecret": tlsMultipleSecretsName + "/" + tlsMultipleSecretsCert1Key,
- "tlsCACertificateSecret": tlsMultipleSecretsName + "/foo",
- }),
+ environment.Integration.Spec.Traits = v1.Traits{
+ Route: &v1.RouteTrait{
+ TLSTermination: string(routev1.TLSTerminationReencrypt),
+ Host: host,
+ TLSKeySecret: tlsKeySecretName,
+ TLSCertificateSecret: tlsMultipleSecretsName + "/" + tlsMultipleSecretsCert1Key,
+ TLSCACertificateSecret: tlsMultipleSecretsName + "/foo",
+ },
}
err := traitsCatalog.apply(environment)
@@ -374,14 +377,14 @@ func TestRoute_TLS_secret_missing_key(t *testing.T) {
environment := createTestRouteEnvironment(t, name)
traitsCatalog := environment.Catalog
- environment.Integration.Spec.Traits = map[string]v1.TraitSpec{
- "route": test.TraitSpecFromMap(t, map[string]interface{}{
- "tlsTermination": string(routev1.TLSTerminationReencrypt),
- "host": host,
- "tlsKeySecret": tlsKeySecretName,
- "tlsCertificateSecret": tlsMultipleSecretsName + "/" + tlsMultipleSecretsCert1Key,
- "tlsCACertificateSecret": tlsMultipleSecretsName,
- }),
+ environment.Integration.Spec.Traits = v1.Traits{
+ Route: &v1.RouteTrait{
+ TLSTermination: string(routev1.TLSTerminationReencrypt),
+ Host: host,
+ TLSKeySecret: tlsKeySecretName,
+ TLSCertificateSecret: tlsMultipleSecretsName + "/" + tlsMultipleSecretsCert1Key,
+ TLSCACertificateSecret: tlsMultipleSecretsName,
+ },
}
err := traitsCatalog.apply(environment)
@@ -402,15 +405,15 @@ func TestRoute_TLS_reencrypt(t *testing.T) {
environment := createTestRouteEnvironment(t, name)
traitsCatalog := environment.Catalog
- environment.Integration.Spec.Traits = map[string]v1.TraitSpec{
- "route": test.TraitSpecFromMap(t, map[string]interface{}{
- "tlsTermination": string(routev1.TLSTerminationReencrypt),
- "host": host,
- "tlsKey": key,
- "tlsCertificate": cert,
- "tlsCACertificate": caCert,
- "tlsDestinationCACertificate": destinationCaCert,
- }),
+ environment.Integration.Spec.Traits = v1.Traits{
+ Route: &v1.RouteTrait{
+ TLSTermination: string(routev1.TLSTerminationReencrypt),
+ Host: host,
+ TLSKey: key,
+ TLSCertificate: cert,
+ TLSCACertificate: caCert,
+ TLSDestinationCACertificate: destinationCaCert,
+ },
}
err := traitsCatalog.apply(environment)
@@ -437,14 +440,14 @@ func TestRoute_TLS_edge(t *testing.T) {
environment := createTestRouteEnvironment(t, name)
traitsCatalog := environment.Catalog
- environment.Integration.Spec.Traits = map[string]v1.TraitSpec{
- "route": test.TraitSpecFromMap(t, map[string]interface{}{
- "tlsTermination": string(routev1.TLSTerminationEdge),
- "host": host,
- "tlsKey": key,
- "tlsCertificate": cert,
- "tlsCACertificate": caCert,
- }),
+ environment.Integration.Spec.Traits = v1.Traits{
+ Route: &v1.RouteTrait{
+ TLSTermination: string(routev1.TLSTerminationEdge),
+ Host: host,
+ TLSKey: key,
+ TLSCertificate: cert,
+ TLSCACertificate: caCert,
+ },
}
err := traitsCatalog.apply(environment)
@@ -471,12 +474,12 @@ func TestRoute_TLS_passthrough(t *testing.T) {
environment := createTestRouteEnvironment(t, name)
traitsCatalog := environment.Catalog
- environment.Integration.Spec.Traits = map[string]v1.TraitSpec{
- "route": test.TraitSpecFromMap(t, map[string]interface{}{
- "tlsTermination": string(routev1.TLSTerminationPassthrough),
- "host": host,
- "tlsInsecureEdgeTerminationPolicy": routev1.InsecureEdgeTerminationPolicyAllow,
- }),
+ environment.Integration.Spec.Traits = v1.Traits{
+ Route: &v1.RouteTrait{
+ TLSTermination: string(routev1.TLSTerminationPassthrough),
+ Host: host,
+ TLSInsecureEdgeTerminationPolicy: string(routev1.InsecureEdgeTerminationPolicyAllow),
+ },
}
err := traitsCatalog.apply(environment)
@@ -501,10 +504,10 @@ func TestRoute_TLS_passthrough(t *testing.T) {
func TestRoute_WithCustomServicePort(t *testing.T) {
name := xid.New().String()
environment := createTestRouteEnvironment(t, name)
- environment.Integration.Spec.Traits = map[string]v1.TraitSpec{
- containerTraitID: test.TraitSpecFromMap(t, map[string]interface{}{
- "servicePortName": "my-port",
- }),
+ environment.Integration.Spec.Traits = v1.Traits{
+ Container: &v1.ContainerTrait{
+ ServicePortName: "my-port",
+ },
}
traitsCatalog := environment.Catalog
@@ -522,10 +525,10 @@ func TestRoute_WithCustomServicePort(t *testing.T) {
assert.NotNil(t, route)
assert.NotNil(t, route.Spec.Port)
- trait := test.TraitSpecToMap(t, environment.Integration.Spec.Traits[containerTraitID])
+ trait := environment.Integration.Spec.Traits.Container
assert.Equal(
t,
- trait["servicePortName"],
+ trait.ServicePortName,
route.Spec.Port.TargetPort.StrVal,
)
}
diff --git a/pkg/trait/service.go b/pkg/trait/service.go
index 5c47a5fe0..5a2e3de47 100644
--- a/pkg/trait/service.go
+++ b/pkg/trait/service.go
@@ -27,18 +27,9 @@ import (
"github.com/apache/camel-k/pkg/util/kubernetes"
)
-// The Service trait exposes the integration with a Service resource so that it can be accessed by other applications
-// (or integrations) in the same namespace.
-//
-// It's enabled by default if the integration depends on a Camel component that can expose a HTTP endpoint.
-//
-// +camel-k:trait=service.
type serviceTrait struct {
- BaseTrait `property:",squash"`
- // To automatically detect from the code if a Service needs to be created.
- Auto *bool `property:"auto" json:"auto,omitempty"`
- // Enable Service to be exposed as NodePort (default `false`).
- NodePort *bool `property:"node-port" json:"nodePort,omitempty"`
+ BaseTrait
+ v1.ServiceTrait `property:",squash"`
}
const serviceTraitID = "service"
diff --git a/pkg/trait/service_binding.go b/pkg/trait/service_binding.go
index de6f607fa..f57ab57a4 100644
--- a/pkg/trait/service_binding.go
+++ b/pkg/trait/service_binding.go
@@ -36,14 +36,9 @@ import (
"github.com/apache/camel-k/pkg/util/reference"
)
-// The Service Binding trait allows users to connect to Services in Kubernetes:
-// https://github.com/k8s-service-bindings/spec#service-binding
-// As the specification is still evolving this is subject to change
-// +camel-k:trait=service-binding.
type serviceBindingTrait struct {
- BaseTrait `property:",squash"`
- // List of Services in the form [[apigroup/]version:]kind:[namespace/]name
- Services []string `property:"services" json:"services,omitempty"`
+ BaseTrait
+ v1.ServiceBindingTrait `property:",squash"`
}
func newServiceBindingTrait() Trait {
diff --git a/pkg/trait/service_test.go b/pkg/trait/service_test.go
index f97d6bc2c..7e9d59283 100644
--- a/pkg/trait/service_test.go
+++ b/pkg/trait/service_test.go
@@ -25,12 +25,12 @@ import (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/gzip"
"github.com/apache/camel-k/pkg/util/kubernetes"
- "github.com/apache/camel-k/pkg/util/test"
)
const (
@@ -70,11 +70,13 @@ func TestServiceWithDefaults(t *testing.T) {
Language: v1.LanguageJavaScript,
},
},
- Traits: map[string]v1.TraitSpec{
- "service": test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": true,
- "auto": false,
- }),
+ Traits: v1.Traits{
+ Service: &v1.ServiceTrait{
+ Trait: v1.Trait{
+ Enabled: pointer.Bool(true),
+ },
+ Auto: pointer.Bool(false),
+ },
},
},
},
@@ -161,19 +163,23 @@ func TestService(t *testing.T) {
Language: v1.LanguageJavaScript,
},
},
- Traits: map[string]v1.TraitSpec{
- "service": test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": true,
- }),
- "container": test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": true,
- "auto": false,
- "expose": true,
- "port": 8081,
- "portName": "http-8081",
- "servicePort": 81,
- "servicePortName": "http-81",
- }),
+ Traits: v1.Traits{
+ Service: &v1.ServiceTrait{
+ Trait: v1.Trait{
+ Enabled: pointer.Bool(true),
+ },
+ },
+ Container: &v1.ContainerTrait{
+ Trait: v1.Trait{
+ Enabled: pointer.Bool(true),
+ },
+ Auto: pointer.Bool(false),
+ Expose: pointer.Bool(true),
+ Port: 8081,
+ PortName: "http-8081",
+ ServicePort: 81,
+ ServicePortName: "http-81",
+ },
},
},
},
@@ -245,14 +251,16 @@ func TestServiceWithCustomContainerName(t *testing.T) {
},
Spec: v1.IntegrationSpec{
Profile: v1.TraitProfileKubernetes,
- Traits: map[string]v1.TraitSpec{
- "service": test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": true,
- "auto": false,
- }),
- "container": test.TraitSpecFromMap(t, map[string]interface{}{
- "name": "my-container-name",
- }),
+ Traits: v1.Traits{
+ Service: &v1.ServiceTrait{
+ Trait: v1.Trait{
+ Enabled: pointer.Bool(true),
+ },
+ Auto: pointer.Bool(false),
+ },
+ Container: &v1.ContainerTrait{
+ Name: "my-container-name",
+ },
},
},
},
@@ -289,10 +297,10 @@ func TestServiceWithCustomContainerName(t *testing.T) {
assert.Len(t, d.Spec.Template.Spec.Containers, 1)
- trait := test.TraitSpecToMap(t, environment.Integration.Spec.Traits["container"])
+ trait := environment.Integration.Spec.Traits.Container
assert.Equal(
t,
- trait["name"],
+ trait.Name,
d.Spec.Template.Spec.Containers[0].Name,
)
}
@@ -329,12 +337,14 @@ func TestServiceWithNodePort(t *testing.T) {
Language: v1.LanguageJavaScript,
},
},
- Traits: map[string]v1.TraitSpec{
- "service": test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": true,
- "auto": false,
- "nodePort": true,
- }),
+ Traits: v1.Traits{
+ Service: &v1.ServiceTrait{
+ Trait: v1.Trait{
+ Enabled: pointer.Bool(true),
+ },
+ Auto: pointer.Bool(false),
+ NodePort: pointer.Bool(true),
+ },
},
},
},
diff --git a/pkg/trait/toleration.go b/pkg/trait/toleration.go
index 925d53d78..83483830c 100644
--- a/pkg/trait/toleration.go
+++ b/pkg/trait/toleration.go
@@ -23,27 +23,13 @@ import (
corev1 "k8s.io/api/core/v1"
"k8s.io/utils/pointer"
+ v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
"github.com/apache/camel-k/pkg/util/kubernetes"
)
-// This trait sets Tolerations over Integration pods. Tolerations allow (but do not require) the pods to schedule onto nodes with matching taints.
-// See https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ for more details.
-//
-// The toleration should be expressed in a similar manner that of taints, i.e., `Key[=Value]:Effect[:Seconds]`, where values in square brackets are optional.
-//
-// For examples:
-//
-// - `node-role.kubernetes.io/master:NoSchedule`
-// - `node.kubernetes.io/network-unavailable:NoExecute:3000`
-// - `disktype=ssd:PreferNoSchedule`
-//
-// It's disabled by default.
-//
-// +camel-k:trait=toleration.
type tolerationTrait struct {
- BaseTrait `property:",squash"`
- // The list of taints to tolerate, in the form `Key[=Value]:Effect[:Seconds]`
- Taints []string `property:"taints" json:"taints,omitempty"`
+ BaseTrait
+ v1.TolerationTrait `property:",squash"`
}
func newTolerationTrait() Trait {
diff --git a/pkg/trait/trait_configure.go b/pkg/trait/trait_configure.go
index 1bba95bd0..223d6926f 100644
--- a/pkg/trait/trait_configure.go
+++ b/pkg/trait/trait_configure.go
@@ -32,30 +32,24 @@ import (
func (c *Catalog) configure(env *Environment) error {
if env.Platform != nil {
- if env.Platform.Status.Traits != nil {
- if err := c.configureTraits(env.Platform.Status.Traits); err != nil {
- return err
- }
+ if err := c.configureTraits(env.Platform.Status.Traits); err != nil {
+ return err
}
if err := c.configureTraitsFromAnnotations(env.Platform.Annotations); err != nil {
return err
}
}
if env.IntegrationKit != nil {
- if env.IntegrationKit.Spec.Traits != nil {
- if err := c.configureTraits(env.IntegrationKit.Spec.Traits); err != nil {
- return err
- }
+ if err := c.configureTraits(env.IntegrationKit.Spec.Traits); err != nil {
+ return err
}
if err := c.configureTraitsFromAnnotations(env.IntegrationKit.Annotations); err != nil {
return err
}
}
if env.Integration != nil {
- if env.Integration.Spec.Traits != nil {
- if err := c.configureTraits(env.Integration.Spec.Traits); err != nil {
- return err
- }
+ if err := c.configureTraits(env.Integration.Spec.Traits); err != nil {
+ return err
}
if err := c.configureTraitsFromAnnotations(env.Integration.Annotations); err != nil {
return err
@@ -65,11 +59,14 @@ func (c *Catalog) configure(env *Environment) error {
return nil
}
-func (c *Catalog) configureTraits(traits map[string]v1.TraitSpec) error {
- for id, traitSpec := range traits {
- catTrait := c.GetTrait(id)
- if catTrait != nil {
- trait := traitSpec
+func (c *Catalog) configureTraits(traits interface{}) error {
+ traitsMap, err := ToMap(traits)
+ if err != nil {
+ return err
+ }
+
+ for id, trait := range traitsMap {
+ if catTrait := c.GetTrait(id); catTrait != nil {
if err := decodeTraitSpec(&trait, catTrait); err != nil {
return err
}
@@ -79,8 +76,8 @@ func (c *Catalog) configureTraits(traits map[string]v1.TraitSpec) error {
return nil
}
-func decodeTraitSpec(in *v1.TraitSpec, target interface{}) error {
- data, err := json.Marshal(&in.Configuration)
+func decodeTraitSpec(in interface{}, target interface{}) error {
+ data, err := json.Marshal(&in)
if err != nil {
return err
}
diff --git a/pkg/trait/trait_configure_test.go b/pkg/trait/trait_configure_test.go
index e92c4985f..0cfe1b853 100644
--- a/pkg/trait/trait_configure_test.go
+++ b/pkg/trait/trait_configure_test.go
@@ -23,9 +23,9 @@ import (
"github.com/stretchr/testify/assert"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
- "github.com/apache/camel-k/pkg/util/test"
)
func TestTraitConfigurationFromAnnotations(t *testing.T) {
@@ -39,11 +39,11 @@ func TestTraitConfigurationFromAnnotations(t *testing.T) {
},
Spec: v1.IntegrationSpec{
Profile: v1.TraitProfileKubernetes,
- Traits: map[string]v1.TraitSpec{
- "cron": test.TraitSpecFromMap(t, map[string]interface{}{
- "fallback": true,
- "concurrencyPolicy": "mypolicy",
- }),
+ Traits: v1.Traits{
+ Cron: &v1.CronTrait{
+ Fallback: pointer.Bool(true),
+ ConcurrencyPolicy: "mypolicy",
+ },
},
},
},
@@ -82,42 +82,44 @@ func TestTraitConfigurationOverrideRulesFromAnnotations(t *testing.T) {
},
},
Spec: v1.IntegrationPlatformSpec{
- Traits: map[string]v1.TraitSpec{
- "cron": test.TraitSpecFromMap(t, map[string]interface{}{
- "components": "cmp1",
- "schedule": "schedule1",
- }),
+ Traits: v1.Traits{
+ Cron: &v1.CronTrait{
+ Components: "cmp1",
+ Schedule: "schedule1",
+ ConcurrencyPolicy: "policy1",
+ },
},
},
},
IntegrationKit: &v1.IntegrationKit{
ObjectMeta: metav1.ObjectMeta{
Annotations: map[string]string{
- "trait.camel.apache.org/cron.components": "cmp4",
+ "trait.camel.apache.org/cron.components": "cmp3",
"trait.camel.apache.org/cron.concurrency-policy": "policy2",
+ "trait.camel.apache.org/builder.verbose": "true",
},
},
Spec: v1.IntegrationKitSpec{
- Traits: map[string]v1.TraitSpec{
- "cron": test.TraitSpecFromMap(t, map[string]interface{}{
- "components": "cmp3",
- "concurrencyPolicy": "policy1",
- }),
+ Traits: v1.IntegrationKitTraits{
+ Builder: &v1.BuilderTrait{
+ Verbose: pointer.Bool(false),
+ },
},
},
},
Integration: &v1.Integration{
ObjectMeta: metav1.ObjectMeta{
Annotations: map[string]string{
+ "trait.camel.apache.org/cron.components": "cmp4",
"trait.camel.apache.org/cron.concurrency-policy": "policy4",
},
},
Spec: v1.IntegrationSpec{
Profile: v1.TraitProfileKubernetes,
- Traits: map[string]v1.TraitSpec{
- "cron": test.TraitSpecFromMap(t, map[string]interface{}{
- "concurrencyPolicy": "policy3",
- }),
+ Traits: v1.Traits{
+ Cron: &v1.CronTrait{
+ ConcurrencyPolicy: "policy3",
+ },
},
},
},
@@ -127,6 +129,7 @@ func TestTraitConfigurationOverrideRulesFromAnnotations(t *testing.T) {
assert.Equal(t, "schedule2", c.GetTrait("cron").(*cronTrait).Schedule)
assert.Equal(t, "cmp4", c.GetTrait("cron").(*cronTrait).Components)
assert.Equal(t, "policy4", c.GetTrait("cron").(*cronTrait).ConcurrencyPolicy)
+ assert.Equal(t, pointer.Bool(true), c.GetTrait("builder").(*builderTrait).Verbose)
}
func TestTraitListConfigurationFromAnnotations(t *testing.T) {
diff --git a/pkg/trait/trait_register.go b/pkg/trait/trait_register.go
index ff48f934f..ff4c0da15 100644
--- a/pkg/trait/trait_register.go
+++ b/pkg/trait/trait_register.go
@@ -30,7 +30,7 @@ func init() {
AddToTraits(newDeploymentTrait)
AddToTraits(newEnvironmentTrait)
AddToTraits(newErrorHandlerTrait)
- AddToTraits(newGarbageCollectorTrait)
+ AddToTraits(newGCTrait)
AddToTraits(newHealthTrait)
AddToTraits(NewInitTrait)
AddToTraits(newIngressTrait)
diff --git a/pkg/trait/trait_test.go b/pkg/trait/trait_test.go
index c88ee94c5..c2aeb40fc 100644
--- a/pkg/trait/trait_test.go
+++ b/pkg/trait/trait_test.go
@@ -28,11 +28,11 @@ import (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/kubernetes"
- "github.com/apache/camel-k/pkg/util/test"
)
const (
@@ -79,10 +79,6 @@ func TestOpenShiftTraitsWithWeb(t *testing.T) {
func TestOpenShiftTraitsWithWebAndConfig(t *testing.T) {
env := createTestEnv(t, v1.IntegrationPlatformClusterOpenShift, "from('netty-http:http').to('log:info')")
- env.Integration.Spec.Traits = make(map[string]v1.TraitSpec)
- env.Integration.Spec.Traits["service"] = test.TraitSpecFromMap(t, map[string]interface{}{
- "port": 7071,
- })
res := processTestEnv(t, env)
assert.NotNil(t, env.GetTrait("service"))
assert.NotNil(t, env.GetTrait("route"))
@@ -93,11 +89,11 @@ func TestOpenShiftTraitsWithWebAndConfig(t *testing.T) {
func TestOpenShiftTraitsWithWebAndDisabledTrait(t *testing.T) {
env := createTestEnv(t, v1.IntegrationPlatformClusterOpenShift, "from('netty-http:http').to('log:info')")
- env.Integration.Spec.Traits = make(map[string]v1.TraitSpec)
- env.Integration.Spec.Traits["service"] = test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": false,
- "port": 7071,
- })
+ env.Integration.Spec.Traits.Service = &v1.ServiceTrait{
+ Trait: v1.Trait{
+ Enabled: pointer.Bool(false),
+ },
+ }
res := processTestEnv(t, env)
assert.Nil(t, env.GetTrait("service"))
assert.Nil(t, env.GetTrait("route")) // No route without service
@@ -140,17 +136,16 @@ func TestKubernetesTraitsWithWeb(t *testing.T) {
}
func TestTraitDecode(t *testing.T) {
- env := createTestEnv(t, v1.IntegrationPlatformClusterOpenShift, "")
- env.Integration.Spec.Traits = make(map[string]v1.TraitSpec)
- svcTrait := test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": false,
- "port": 7071,
- "cippa": "lippa",
- })
- env.Integration.Spec.Traits["service"] = svcTrait
+ trait := v1.ContainerTrait{
+ Trait: v1.Trait{
+ Enabled: pointer.Bool(false),
+ },
+ Port: 7071,
+ Auto: pointer.Bool(true),
+ }
ctr, _ := newContainerTrait().(*containerTrait)
- err := decodeTraitSpec(&svcTrait, ctr)
+ err := decodeTraitSpec(&trait, ctr)
assert.Nil(t, err)
assert.Equal(t, 7071, ctr.Port)
@@ -161,25 +156,23 @@ func TestTraitDecode(t *testing.T) {
func TestTraitHierarchyDecode(t *testing.T) {
env := createTestEnv(t, v1.IntegrationPlatformClusterOpenShift, "")
- env.Platform.Spec.Traits = make(map[string]v1.TraitSpec)
- env.Platform.Spec.Traits["knative-service"] = test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": false,
- "minScale": 1,
- "maxScale": 10,
- "autoscalingTarget": 15,
- })
+ env.Platform.Spec.Traits.KnativeService = &v1.KnativeServiceTrait{
+ Trait: v1.Trait{
+ Enabled: pointer.Bool(false),
+ },
+ MinScale: pointer.Int(1),
+ MaxScale: pointer.Int(10),
+ Target: pointer.Int(15),
+ }
env.Platform.ResyncStatusFullConfig()
- env.IntegrationKit.Spec.Traits = make(map[string]v1.TraitSpec)
- env.IntegrationKit.Spec.Traits["knative-service"] = test.TraitSpecFromMap(t, map[string]interface{}{
- "enabled": true,
- "minScale": 5,
- })
-
- env.Integration.Spec.Traits = make(map[string]v1.TraitSpec)
- env.Integration.Spec.Traits["knative-service"] = test.TraitSpecFromMap(t, map[string]interface{}{
- "maxScale": 20,
- })
+ env.Integration.Spec.Traits.KnativeService = &v1.KnativeServiceTrait{
+ Trait: v1.Trait{
+ Enabled: pointer.Bool(true),
+ },
+ MinScale: pointer.Int(5),
+ MaxScale: pointer.Int(20),
+ }
c := NewTraitTestCatalog()
err := c.configure(env)
diff --git a/pkg/trait/trait_types.go b/pkg/trait/trait_types.go
index a53ec9841..c38780cb5 100644
--- a/pkg/trait/trait_types.go
+++ b/pkg/trait/trait_types.go
@@ -115,9 +115,7 @@ func NewBaseTrait(id string, order int) BaseTrait {
// BaseTrait is the root trait with noop implementations for hooks.
type BaseTrait struct {
- TraitID ID `json:"-"`
- // Can be used to enable or disable a trait. All traits share this common property.
- Enabled *bool `property:"enabled" json:"enabled,omitempty"`
+ TraitID ID `json:"-"`
Client client.Client `json:"-"`
ExecutionOrder int `json:"-"`
L log.Logger `json:"-"`
diff --git a/pkg/trait/util.go b/pkg/trait/util.go
index 3d52ca136..97ae4748d 100644
--- a/pkg/trait/util.go
+++ b/pkg/trait/util.go
@@ -19,6 +19,7 @@ package trait
import (
"context"
+ "encoding/json"
"fmt"
"reflect"
"regexp"
@@ -26,6 +27,7 @@ import (
"strings"
user "github.com/mitchellh/go-homedir"
+ "github.com/pkg/errors"
"github.com/scylladb/go-set/strset"
ctrl "sigs.k8s.io/controller-runtime/pkg/client"
@@ -221,3 +223,37 @@ func AddSourceDependencies(source v1.SourceSpec, catalog *camel.RuntimeCatalog)
return dependencies
}
+
+// ToMap accepts either v1.Traits or v1.IntegrationKitTraits and converts it to a map.
+func ToMap(traits interface{}) (map[string]map[string]interface{}, error) {
+ _, ok1 := traits.(v1.Traits)
+ _, ok2 := traits.(v1.IntegrationKitTraits)
+ if !ok1 && !ok2 {
+ return nil, errors.New("traits must be either v1.Traits or v1.IntegrationKitTraits")
+ }
+
+ data, err := json.Marshal(traits)
+ if err != nil {
+ return nil, err
+ }
+ traitsMap := make(map[string]map[string]interface{})
+ if err = json.Unmarshal(data, &traitsMap); err != nil {
+ return nil, err
+ }
+
+ return traitsMap, nil
+}
+
+// ToTrait unmarshals a map configuration to a target trait
+func ToTrait(trait map[string]interface{}, target interface{}) error {
+ data, err := json.Marshal(trait)
+ if err != nil {
+ return err
+ }
+ err = json.Unmarshal(data, &target)
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
diff --git a/pkg/util/bindings/api.go b/pkg/util/bindings/api.go
index ea98f8822..151125e94 100644
--- a/pkg/util/bindings/api.go
+++ b/pkg/util/bindings/api.go
@@ -40,7 +40,7 @@ type Binding struct {
// Step is to support complex mapping such as Camel's EIPs
Step map[string]interface{}
// Traits is a partial trait specification that should be merged into the integration
- Traits map[string]v1.TraitSpec
+ Traits v1.Traits
// ApplicationProperties contain properties that should be set on the integration for the binding to work
ApplicationProperties map[string]string
}
diff --git a/pkg/util/bindings/bindings_test.go b/pkg/util/bindings/bindings_test.go
index f9c101746..da1c6dd10 100644
--- a/pkg/util/bindings/bindings_test.go
+++ b/pkg/util/bindings/bindings_test.go
@@ -24,12 +24,15 @@ import (
"net/url"
"testing"
+ corev1 "k8s.io/api/core/v1"
+ "k8s.io/utils/pointer"
+
camelv1 "github.com/apache/camel-k/pkg/apis/camel/v1"
knativeapis "github.com/apache/camel-k/pkg/apis/camel/v1/knative"
"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
"github.com/apache/camel-k/pkg/util/test"
+
"github.com/stretchr/testify/assert"
- corev1 "k8s.io/api/core/v1"
)
func TestBindings(t *testing.T) {
@@ -38,7 +41,7 @@ func TestBindings(t *testing.T) {
endpoint v1alpha1.Endpoint
profile camelv1.TraitProfile
uri string
- traits map[string]camelv1.TraitSpec
+ traits camelv1.Traits
props map[string]string
}{
{
@@ -174,21 +177,23 @@ func TestBindings(t *testing.T) {
{
endpointType: v1alpha1.EndpointTypeSink,
endpoint: v1alpha1.Endpoint{
- URI: asStringPointer("https://myurl/hey"),
+ URI: pointer.String("https://myurl/hey"),
Properties: asEndpointProperties(map[string]string{
"ce.override.ce-type": "mytype",
}),
},
uri: "knative:endpoint/sink?ce.override.ce-type=mytype",
- traits: asTraitSpec("knative", map[string]interface{}{
- "sinkBinding": false,
- "configuration": asKnativeConfig("https://myurl/hey"),
- }),
+ traits: camelv1.Traits{
+ Knative: &camelv1.KnativeTrait{
+ SinkBinding: pointer.Bool(false),
+ Configuration: asKnativeConfig("https://myurl/hey"),
+ },
+ },
},
{
endpointType: v1alpha1.EndpointTypeSink,
endpoint: v1alpha1.Endpoint{
- URI: asStringPointer("https://myurl/hey"),
+ URI: pointer.String("https://myurl/hey"),
},
profile: camelv1.TraitProfileKubernetes,
uri: "https://myurl/hey",
@@ -196,14 +201,13 @@ func TestBindings(t *testing.T) {
{
endpointType: v1alpha1.EndpointTypeSink,
endpoint: v1alpha1.Endpoint{
- URI: asStringPointer("docker://xxx"),
+ URI: pointer.String("docker://xxx"),
},
uri: "docker://xxx",
},
}
- for i := range testcases {
- tc := testcases[i]
+ for i, tc := range testcases {
t.Run(fmt.Sprintf("test-%d-%s", i, tc.uri), func(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
@@ -245,24 +249,6 @@ func asEndpointProperties(props map[string]string) *v1alpha1.EndpointProperties
}
}
-func asTraitSpec(key string, data map[string]interface{}) map[string]camelv1.TraitSpec {
- res := make(map[string]camelv1.TraitSpec)
- serialized, err := json.Marshal(data)
- if err != nil {
- panic(err)
- }
- res[key] = camelv1.TraitSpec{
- Configuration: camelv1.TraitConfiguration{
- RawMessage: serialized,
- },
- }
- return res
-}
-
-func asStringPointer(str string) *string {
- return &str
-}
-
func asKnativeConfig(endpointURL string) string {
serviceURL, err := url.Parse(endpointURL)
if err != nil {
diff --git a/pkg/util/bindings/knative_uri.go b/pkg/util/bindings/knative_uri.go
index f1a12004d..5bf7ce935 100644
--- a/pkg/util/bindings/knative_uri.go
+++ b/pkg/util/bindings/knative_uri.go
@@ -18,10 +18,11 @@ limitations under the License.
package bindings
import (
- "encoding/json"
"net/url"
"strings"
+ "k8s.io/utils/pointer"
+
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
knativeapis "github.com/apache/camel-k/pkg/apis/camel/v1/knative"
"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
@@ -53,7 +54,6 @@ func (k KnativeURIBindingProvider) Translate(ctx BindingContext, endpointCtx End
return nil, nil
}
- knativeConfig := make(map[string]interface{})
originalURI, err := url.Parse(*e.URI)
if err != nil {
return nil, err
@@ -71,12 +71,6 @@ func (k KnativeURIBindingProvider) Translate(ctx BindingContext, endpointCtx End
if err != nil {
return nil, err
}
- knativeConfig["configuration"] = config
- knativeConfig["sinkBinding"] = false
- knativeConfigJSON, err := json.Marshal(knativeConfig)
- if err != nil {
- return nil, err
- }
// Rewrite URI to match the service definition
serviceURI := "knative:endpoint/sink"
@@ -88,11 +82,10 @@ func (k KnativeURIBindingProvider) Translate(ctx BindingContext, endpointCtx End
return &Binding{
URI: serviceURI,
- Traits: map[string]v1.TraitSpec{
- "knative": {
- Configuration: v1.TraitConfiguration{
- RawMessage: knativeConfigJSON,
- },
+ Traits: v1.Traits{
+ Knative: &v1.KnativeTrait{
+ Configuration: config,
+ SinkBinding: pointer.Bool(false),
},
},
}, nil
diff --git a/pkg/util/digest/digest.go b/pkg/util/digest/digest.go
index 0ab8c9e8d..cdeee2834 100644
--- a/pkg/util/digest/digest.go
+++ b/pkg/util/digest/digest.go
@@ -98,28 +98,12 @@ func ComputeForIntegration(integration *v1.Integration) (string, error) {
}
// Integration traits
- for _, name := range sortedTraitSpecMapKeys(integration.Spec.Traits) {
- if _, err := hash.Write([]byte(name + "[")); err != nil {
- return "", err
- }
- spec, err := json.Marshal(integration.Spec.Traits[name].Configuration)
- if err != nil {
- return "", err
- }
- trait := make(map[string]interface{})
- err = json.Unmarshal(spec, &trait)
- if err != nil {
- return "", err
- }
- for _, prop := range util.SortedMapKeys(trait) {
- val := trait[prop]
- if _, err := hash.Write([]byte(fmt.Sprintf("%s=%v,", prop, val))); err != nil {
- return "", err
- }
- }
- if _, err := hash.Write([]byte("]")); err != nil {
- return "", err
- }
+ traits, err := json.Marshal(integration.Spec.Traits)
+ if err != nil {
+ return "", err
+ }
+ if _, err := hash.Write(traits); err != nil {
+ return "", err
}
// Integration traits as annotations
for _, k := range sortedTraitAnnotationsKeys(integration) {
@@ -232,17 +216,6 @@ func ComputeForSource(s v1.SourceSpec) (string, error) {
return digest, nil
}
-func sortedTraitSpecMapKeys(m map[string]v1.TraitSpec) []string {
- res := make([]string, len(m))
- i := 0
- for k := range m {
- res[i] = k
- i++
- }
- sort.Strings(res)
- return res
-}
-
func sortedTraitAnnotationsKeys(it *v1.Integration) []string {
res := make([]string, 0, len(it.Annotations))
for k := range it.Annotations {
[camel-k] 05/14: feat(api): support addons in Traits schema
Posted by ts...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tsato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 69707cfb4bf27a1c124b37b4d199caf483a65d39
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Thu Jun 30 19:23:43 2022 +0900
feat(api): support addons in Traits schema
---
addons/addons_test.go | 104 ++++++++++++++++++++
addons/master/test_support.go | 21 ++++
addons/tracing/test_support.go | 21 ++++
addons/tracing/tracing_test.go | 6 +-
.../install/cli/duplicate_parameters_test.go | 2 +-
.../install/cli/files/JavaDuplicateParams.java | 14 +--
e2e/namespace/native/native_test.go | 2 +-
pkg/apis/camel/v1/common_types.go | 9 ++
pkg/apis/camel/v1/integrationkit_types.go | 3 +
pkg/apis/camel/v1/trait/zz_generated.deepcopy.go | 50 ++++++++++
pkg/apis/camel/v1/zz_generated.deepcopy.go | 100 +++++++++++++++++++
pkg/cmd/bind.go | 3 +-
pkg/cmd/kit_create.go | 2 +-
pkg/cmd/run.go | 3 +-
pkg/cmd/run_test.go | 7 +-
pkg/cmd/trait_support.go | 97 ++++++++++++++++--
pkg/controller/integration/kits.go | 20 +++-
pkg/trait/knative_test.go | 8 +-
pkg/trait/test_support.go | 14 +++
pkg/trait/trait_catalog.go | 2 +-
pkg/trait/trait_configure.go | 30 ++++--
pkg/trait/trait_configure_test.go | 46 ++++++++-
pkg/trait/trait_test.go | 2 +-
pkg/trait/util.go | 16 ++-
pkg/trait/util_test.go | 108 +++++++++++++++++++++
25 files changed, 642 insertions(+), 48 deletions(-)
diff --git a/addons/addons_test.go b/addons/addons_test.go
new file mode 100644
index 000000000..786172ee8
--- /dev/null
+++ b/addons/addons_test.go
@@ -0,0 +1,104 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package addons
+
+import (
+ "testing"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ "github.com/apache/camel-k/addons/master"
+ "github.com/apache/camel-k/addons/tracing"
+ v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ "github.com/apache/camel-k/pkg/trait"
+
+ "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
+)
+
+func TestTraitConfiguration(t *testing.T) {
+ env := trait.Environment{
+ Integration: &v1.Integration{
+ Spec: v1.IntegrationSpec{
+ Profile: v1.TraitProfileKubernetes,
+ Traits: v1.Traits{
+ Addons: map[string]v1.AddonTrait{
+ "master": trait.ToAddonTrait(t, map[string]interface{}{
+ "enabled": true,
+ "resourceName": "test-lock",
+ "labelKey": "test-label",
+ "labelValue": "test-value",
+ }),
+ "tracing": trait.ToAddonTrait(t, map[string]interface{}{
+ "enabled": true,
+ }),
+ },
+ },
+ },
+ },
+ }
+ c := trait.NewCatalog(nil)
+ require.NoError(t, c.Configure(&env))
+
+ require.NotNil(t, c.GetTrait("master"))
+ master, ok := c.GetTrait("master").(*master.TestMasterTrait)
+ require.True(t, ok)
+ assert.True(t, *master.Enabled)
+ assert.Equal(t, "test-lock", *master.ResourceName)
+ assert.Equal(t, "test-label", *master.LabelKey)
+ assert.Equal(t, "test-value", *master.LabelValue)
+
+ require.NotNil(t, c.GetTrait("tracing"))
+ tracing, ok := c.GetTrait("tracing").(*tracing.TestTracingTrait)
+ require.True(t, ok)
+ assert.True(t, *tracing.Enabled)
+}
+
+func TestTraitConfigurationFromAnnotations(t *testing.T) {
+ env := trait.Environment{
+ Integration: &v1.Integration{
+ ObjectMeta: metav1.ObjectMeta{
+ Annotations: map[string]string{
+ "trait.camel.apache.org/master.enabled": "true",
+ "trait.camel.apache.org/master.resource-name": "test-lock",
+ "trait.camel.apache.org/master.label-key": "test-label",
+ "trait.camel.apache.org/master.label-value": "test-value",
+ "trait.camel.apache.org/tracing.enabled": "true",
+ },
+ },
+ Spec: v1.IntegrationSpec{
+ Profile: v1.TraitProfileKubernetes,
+ },
+ },
+ }
+ c := trait.NewCatalog(nil)
+ require.NoError(t, c.Configure(&env))
+
+ require.NotNil(t, c.GetTrait("master"))
+ master, ok := c.GetTrait("master").(*master.TestMasterTrait)
+ require.True(t, ok)
+ assert.True(t, *master.Enabled)
+ assert.Equal(t, "test-lock", *master.ResourceName)
+ assert.Equal(t, "test-label", *master.LabelKey)
+ assert.Equal(t, "test-value", *master.LabelValue)
+
+ require.NotNil(t, c.GetTrait("tracing"))
+ tracing, ok := c.GetTrait("tracing").(*tracing.TestTracingTrait)
+ require.True(t, ok)
+ assert.True(t, *tracing.Enabled)
+}
diff --git a/addons/master/test_support.go b/addons/master/test_support.go
new file mode 100644
index 000000000..ec6b7bf3b
--- /dev/null
+++ b/addons/master/test_support.go
@@ -0,0 +1,21 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package master
+
+// Expose masterTrait type for testing.
+type TestMasterTrait = masterTrait
diff --git a/addons/tracing/test_support.go b/addons/tracing/test_support.go
new file mode 100644
index 000000000..90ba65bac
--- /dev/null
+++ b/addons/tracing/test_support.go
@@ -0,0 +1,21 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package tracing
+
+// Expose tracingTrait type for testing.
+type TestTracingTrait = tracingTrait
diff --git a/addons/tracing/tracing_test.go b/addons/tracing/tracing_test.go
index e81707261..fbbb5bd56 100644
--- a/addons/tracing/tracing_test.go
+++ b/addons/tracing/tracing_test.go
@@ -20,14 +20,14 @@ package tracing
import (
"testing"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/utils/pointer"
+
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
"github.com/apache/camel-k/pkg/trait"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/stretchr/testify/assert"
-
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- "k8s.io/utils/pointer"
)
func TestTracingTraitOnQuarkus(t *testing.T) {
diff --git a/e2e/namespace/install/cli/duplicate_parameters_test.go b/e2e/namespace/install/cli/duplicate_parameters_test.go
index dbda54936..e6c52a21c 100644
--- a/e2e/namespace/install/cli/duplicate_parameters_test.go
+++ b/e2e/namespace/install/cli/duplicate_parameters_test.go
@@ -46,6 +46,6 @@ func TestDuplicateParameters(t *testing.T) {
// the command is executed inside GetOutputString function
commOutput := GetOutputString(comm)
- outParams := `"traits":{"affinity":{"configuration":{"enabled":true}},"camel":{"configuration":{"properties":["prop1 = true","prop2 = true","foo = bar"]}},"pull-secret":{"configuration":{"enabled":true}},"tracing":{"configuration":{"enabled":true}}}`
+ outParams := `"traits":{"affinity":{"enabled":true},"camel":{"properties":["prop1 = true","prop2 = true","foo = bar"]},"pull-secret":{"enabled":true},"addons":{"tracing":{"enabled":true}}}`
Expect(commOutput).To(ContainSubstring(outParams))
}
diff --git a/e2e/namespace/install/cli/files/JavaDuplicateParams.java b/e2e/namespace/install/cli/files/JavaDuplicateParams.java
index 465e1cc1c..95b73b1ac 100644
--- a/e2e/namespace/install/cli/files/JavaDuplicateParams.java
+++ b/e2e/namespace/install/cli/files/JavaDuplicateParams.java
@@ -20,11 +20,11 @@
import org.apache.camel.builder.RouteBuilder;
public class JavaDuplicateParams extends RouteBuilder {
- @Override
- public void configure() throws Exception {
- from("timer:tick")
- .setHeader("m").constant("string!")
- .setBody().simple("Magic${header.m}")
- .log("${body}");
- }
+ @Override
+ public void configure() throws Exception {
+ from("timer:tick")
+ .setHeader("m").constant("string!")
+ .setBody().simple("Magic${header.m}")
+ .log("${body}");
+ }
}
diff --git a/e2e/namespace/native/native_test.go b/e2e/namespace/native/native_test.go
index 96c433e72..702d70617 100644
--- a/e2e/namespace/native/native_test.go
+++ b/e2e/namespace/native/native_test.go
@@ -69,7 +69,7 @@ func TestNativeIntegrations(t *testing.T) {
// Check the fast-jar Kit is ready
Eventually(Kits(ns, withFastJarLayout, KitWithPhase(v1.IntegrationKitPhaseReady)),
- TestTimeoutMedium).Should(HaveLen(1))
+ TestTimeoutVeryLong).Should(HaveLen(1))
fastJarKit := Kits(ns, withFastJarLayout, KitWithPhase(v1.IntegrationKitPhaseReady))()[0]
// Check the Integration uses the fast-jar Kit
diff --git a/pkg/apis/camel/v1/common_types.go b/pkg/apis/camel/v1/common_types.go
index 12a4122d7..f49bc83e1 100644
--- a/pkg/apis/camel/v1/common_types.go
+++ b/pkg/apis/camel/v1/common_types.go
@@ -174,6 +174,9 @@ type Traits struct {
// The configuration of Toleration trait
Toleration *trait.TolerationTrait `property:"toleration" json:"toleration,omitempty"`
+ // The extension point with addon traits
+ Addons map[string]AddonTrait `json:"addons,omitempty"`
+
// Deprecated: for backward compatibility.
Keda *TraitSpec `property:"keda" json:"keda,omitempty"`
// Deprecated: for backward compatibility.
@@ -186,6 +189,12 @@ type Traits struct {
Tracing *TraitSpec `property:"tracing" json:"tracing,omitempty"`
}
+// AddonTrait represents the configuration of an addon trait
+type AddonTrait struct {
+ // Generic raw message, typically a map containing the keys (trait parameters) and the values (either single text or array)
+ RawMessage `json:",inline"`
+}
+
// A TraitSpec contains the configuration of a trait
// Deprecated: superceded by each Trait type, left for backward compatibility.
type TraitSpec struct {
diff --git a/pkg/apis/camel/v1/integrationkit_types.go b/pkg/apis/camel/v1/integrationkit_types.go
index e31e8c6c7..56f7e829a 100644
--- a/pkg/apis/camel/v1/integrationkit_types.go
+++ b/pkg/apis/camel/v1/integrationkit_types.go
@@ -75,6 +75,9 @@ type IntegrationKitTraits struct {
// It's enabled by default.
// NOTE: Compiling to a native executable, i.e. when using `package-type=native`, is only supported for kamelets, as well as YAML and XML integrations. It also requires at least 4GiB of memory, so the Pod running the native build, that is either the operator Pod, or the build Pod (depending on the build strategy configured for the platform), must have enough memory available.
Quarkus *trait.QuarkusTrait `property:"quarkus" json:"quarkus,omitempty"`
+
+ // The collection of addon trait configurations
+ Addons map[string]AddonTrait `json:"addons,omitempty"`
}
// IntegrationKitStatus defines the observed state of IntegrationKit
diff --git a/pkg/apis/camel/v1/trait/zz_generated.deepcopy.go b/pkg/apis/camel/v1/trait/zz_generated.deepcopy.go
index f5d4d636b..002296715 100644
--- a/pkg/apis/camel/v1/trait/zz_generated.deepcopy.go
+++ b/pkg/apis/camel/v1/trait/zz_generated.deepcopy.go
@@ -1,3 +1,4 @@
+//go:build !ignore_autogenerated
// +build !ignore_autogenerated
// Code generated by controller-gen. DO NOT EDIT.
@@ -94,6 +95,26 @@ func (in *CamelTrait) DeepCopy() *CamelTrait {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Configuration) DeepCopyInto(out *Configuration) {
+ *out = *in
+ if in.RawMessage != nil {
+ in, out := &in.RawMessage, &out.RawMessage
+ *out = make(RawMessage, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Configuration.
+func (in *Configuration) DeepCopy() *Configuration {
+ if in == nil {
+ return nil
+ }
+ out := new(Configuration)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ContainerTrait) DeepCopyInto(out *ContainerTrait) {
*out = *in
@@ -186,6 +207,11 @@ func (in *DependenciesTrait) DeepCopy() *DependenciesTrait {
func (in *DeployerTrait) DeepCopyInto(out *DeployerTrait) {
*out = *in
in.Trait.DeepCopyInto(&out.Trait)
+ if in.UseSSA != nil {
+ in, out := &in.UseSSA, &out.UseSSA
+ *out = new(bool)
+ **out = **in
+ }
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeployerTrait.
@@ -820,6 +846,25 @@ func (in *QuarkusTrait) DeepCopy() *QuarkusTrait {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in RawMessage) DeepCopyInto(out *RawMessage) {
+ {
+ in := &in
+ *out = make(RawMessage, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RawMessage.
+func (in RawMessage) DeepCopy() RawMessage {
+ if in == nil {
+ return nil
+ }
+ out := new(RawMessage)
+ in.DeepCopyInto(out)
+ return *out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RegistryTrait) DeepCopyInto(out *RegistryTrait) {
*out = *in
@@ -928,6 +973,11 @@ func (in *Trait) DeepCopyInto(out *Trait) {
*out = new(bool)
**out = **in
}
+ if in.Configuration != nil {
+ in, out := &in.Configuration, &out.Configuration
+ *out = new(Configuration)
+ (*in).DeepCopyInto(*out)
+ }
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Trait.
diff --git a/pkg/apis/camel/v1/zz_generated.deepcopy.go b/pkg/apis/camel/v1/zz_generated.deepcopy.go
index c039f8e06..3a7ef475b 100644
--- a/pkg/apis/camel/v1/zz_generated.deepcopy.go
+++ b/pkg/apis/camel/v1/zz_generated.deepcopy.go
@@ -12,6 +12,26 @@ import (
"k8s.io/apimachinery/pkg/runtime"
)
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AddonTrait) DeepCopyInto(out *AddonTrait) {
+ *out = *in
+ if in.RawMessage != nil {
+ in, out := &in.RawMessage, &out.RawMessage
+ *out = make(RawMessage, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddonTrait.
+func (in *AddonTrait) DeepCopy() *AddonTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(AddonTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Artifact) DeepCopyInto(out *Artifact) {
*out = *in
@@ -813,6 +833,13 @@ func (in *IntegrationKitTraits) DeepCopyInto(out *IntegrationKitTraits) {
*out = new(trait.QuarkusTrait)
(*in).DeepCopyInto(*out)
}
+ if in.Addons != nil {
+ in, out := &in.Addons, &out.Addons
+ *out = make(map[string]AddonTrait, len(*in))
+ for key, val := range *in {
+ (*out)[key] = *val.DeepCopy()
+ }
+ }
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntegrationKitTraits.
@@ -1694,6 +1721,42 @@ func (in *Task) DeepCopy() *Task {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *TraitConfiguration) DeepCopyInto(out *TraitConfiguration) {
+ *out = *in
+ if in.RawMessage != nil {
+ in, out := &in.RawMessage, &out.RawMessage
+ *out = make(RawMessage, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TraitConfiguration.
+func (in *TraitConfiguration) DeepCopy() *TraitConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(TraitConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *TraitSpec) DeepCopyInto(out *TraitSpec) {
+ *out = *in
+ in.Configuration.DeepCopyInto(&out.Configuration)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TraitSpec.
+func (in *TraitSpec) DeepCopy() *TraitSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(TraitSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Traits) DeepCopyInto(out *Traits) {
*out = *in
@@ -1777,6 +1840,11 @@ func (in *Traits) DeepCopyInto(out *Traits) {
*out = new(trait.JVMTrait)
(*in).DeepCopyInto(*out)
}
+ if in.Kamelets != nil {
+ in, out := &in.Kamelets, &out.Kamelets
+ *out = new(trait.KameletsTrait)
+ (*in).DeepCopyInto(*out)
+ }
if in.Knative != nil {
in, out := &in.Knative, &out.Knative
*out = new(trait.KnativeTrait)
@@ -1862,6 +1930,38 @@ func (in *Traits) DeepCopyInto(out *Traits) {
*out = new(trait.TolerationTrait)
(*in).DeepCopyInto(*out)
}
+ if in.Addons != nil {
+ in, out := &in.Addons, &out.Addons
+ *out = make(map[string]AddonTrait, len(*in))
+ for key, val := range *in {
+ (*out)[key] = *val.DeepCopy()
+ }
+ }
+ if in.Keda != nil {
+ in, out := &in.Keda, &out.Keda
+ *out = new(TraitSpec)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Master != nil {
+ in, out := &in.Master, &out.Master
+ *out = new(TraitSpec)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Strimzi != nil {
+ in, out := &in.Strimzi, &out.Strimzi
+ *out = new(TraitSpec)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.ThreeScale != nil {
+ in, out := &in.ThreeScale, &out.ThreeScale
+ *out = new(TraitSpec)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Tracing != nil {
+ in, out := &in.Tracing, &out.Tracing
+ *out = new(TraitSpec)
+ (*in).DeepCopyInto(*out)
+ }
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Traits.
diff --git a/pkg/cmd/bind.go b/pkg/cmd/bind.go
index a5eac817e..2a1c4ad26 100644
--- a/pkg/cmd/bind.go
+++ b/pkg/cmd/bind.go
@@ -209,7 +209,8 @@ func (o *bindCmdOptions) run(cmd *cobra.Command, args []string) error {
if binding.Spec.Integration == nil {
binding.Spec.Integration = &v1.IntegrationSpec{}
}
- if err := configureTraits(o.Traits, &binding.Spec.Integration.Traits); err != nil {
+ catalog := trait.NewCatalog(client)
+ if err := configureTraits(o.Traits, &binding.Spec.Integration.Traits, catalog); err != nil {
return err
}
}
diff --git a/pkg/cmd/kit_create.go b/pkg/cmd/kit_create.go
index 0979cf18e..b8eca7f2d 100644
--- a/pkg/cmd/kit_create.go
+++ b/pkg/cmd/kit_create.go
@@ -157,7 +157,7 @@ func (command *kitCreateCommandOptions) run(cmd *cobra.Command, args []string) e
if err := command.parseAndConvertToTrait(command.Secrets, "mount.config"); err != nil {
return err
}
- if err := configureTraits(command.Traits, &kit.Spec.Traits); err != nil {
+ if err := configureTraits(command.Traits, &kit.Spec.Traits, catalog); err != nil {
return err
}
existed := false
diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go
index e9e603976..bb5ff353c 100644
--- a/pkg/cmd/run.go
+++ b/pkg/cmd/run.go
@@ -668,7 +668,8 @@ func (o *runCmdOptions) createOrUpdateIntegration(cmd *cobra.Command, c client.C
o.Traits = append(o.Traits, fmt.Sprintf("service-binding.services=%s", item))
}
if len(o.Traits) > 0 {
- if err := configureTraits(o.Traits, &integration.Spec.Traits); err != nil {
+ catalog := trait.NewCatalog(c)
+ if err := configureTraits(o.Traits, &integration.Spec.Traits, catalog); err != nil {
return nil, err
}
}
diff --git a/pkg/cmd/run_test.go b/pkg/cmd/run_test.go
index a3a43aa3d..d826e2338 100644
--- a/pkg/cmd/run_test.go
+++ b/pkg/cmd/run_test.go
@@ -363,9 +363,14 @@ func TestConfigureTraits(t *testing.T) {
if err != nil {
t.Error(err)
}
+ client, err := runCmdOptions.GetCmdClient()
+ if err != nil {
+ t.Error(err)
+ }
+ catalog := trait.NewCatalog(client)
traits := v1.Traits{}
- err = configureTraits(runCmdOptions.Traits, &traits)
+ err = configureTraits(runCmdOptions.Traits, &traits, catalog)
assert.Nil(t, err)
traitsMap, err := trait.ToMap(traits)
diff --git a/pkg/cmd/trait_support.go b/pkg/cmd/trait_support.go
index 4d134a3a5..e36ae09aa 100644
--- a/pkg/cmd/trait_support.go
+++ b/pkg/cmd/trait_support.go
@@ -18,10 +18,13 @@ limitations under the License.
package cmd
import (
+ "encoding/json"
"errors"
"fmt"
+ "reflect"
"strings"
+ v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
"github.com/apache/camel-k/pkg/trait"
"github.com/apache/camel-k/pkg/util"
"github.com/mitchellh/mapstructure"
@@ -43,32 +46,68 @@ func validateTraits(catalog *trait.Catalog, traits []string) error {
return nil
}
-func configureTraits(options []string, traits interface{}) error {
- config := make(map[string]map[string]interface{})
+func configureTraits(options []string, traits interface{}, catalog trait.Finder) error {
+ config, err := optionsToMap(options)
+ if err != nil {
+ return err
+ }
+
+ md := mapstructure.Metadata{}
+ decoder, err := mapstructure.NewDecoder(
+ &mapstructure.DecoderConfig{
+ Metadata: &md,
+ WeaklyTypedInput: true,
+ TagName: "property",
+ Result: &traits,
+ },
+ )
+ if err != nil {
+ return err
+ }
+
+ if err = decoder.Decode(config); err != nil {
+ return err
+ }
+
+ if len(md.Unused) == 0 {
+ // No addons found
+ return nil
+ }
+
+ addons := make(map[string]map[string]interface{})
+ for _, id := range md.Unused {
+ addons[id] = config[id]
+ }
+
+ return configureAddons(addons, traits, catalog)
+}
+
+func optionsToMap(options []string) (map[string]map[string]interface{}, error) {
+ optionMap := make(map[string]map[string]interface{})
for _, option := range options {
parts := traitConfigRegexp.FindStringSubmatch(option)
if len(parts) < 4 {
- return errors.New("unrecognized config format (expected \"<trait>.<prop>=<value>\"): " + option)
+ return nil, errors.New("unrecognized config format (expected \"<trait>.<prop>=<value>\"): " + option)
}
id := parts[1]
fullProp := parts[2][1:]
value := parts[3]
- if _, ok := config[id]; !ok {
- config[id] = make(map[string]interface{})
+ if _, ok := optionMap[id]; !ok {
+ optionMap[id] = make(map[string]interface{})
}
propParts := util.ConfigTreePropertySplit(fullProp)
- var current = config[id]
+ var current = optionMap[id]
if len(propParts) > 1 {
c, err := util.NavigateConfigTree(current, propParts[0:len(propParts)-1])
if err != nil {
- return err
+ return nil, err
}
if cc, ok := c.(map[string]interface{}); ok {
current = cc
} else {
- return errors.New("trait configuration cannot end with a slice")
+ return nil, errors.New("trait configuration cannot end with a slice")
}
}
@@ -88,18 +127,56 @@ func configureTraits(options []string, traits interface{}) error {
}
}
+ return optionMap, nil
+}
+
+func configureAddons(config map[string]map[string]interface{}, traits interface{}, catalog trait.Finder) error {
+ // Addon traits require raw message mapping
+ addons := make(map[string]v1.AddonTrait)
+ for id, props := range config {
+ t := catalog.GetTrait(id)
+ if t != nil {
+ // let's take a clone to prevent default values set at runtime from being serialized
+ zero := reflect.New(reflect.TypeOf(t)).Interface()
+ if err := configureAddon(props, zero); err != nil {
+ return err
+ }
+ data, err := json.Marshal(zero)
+ if err != nil {
+ return err
+ }
+ addon := v1.AddonTrait{}
+ if err = json.Unmarshal(data, &addon); err != nil {
+ return err
+ }
+ addons[id] = addon
+ }
+ }
+ if len(addons) > 0 {
+ if ts, ok := traits.(*v1.Traits); ok {
+ ts.Addons = addons
+ }
+ if ikts, ok := traits.(*v1.IntegrationKitTraits); ok {
+ ikts.Addons = addons
+ }
+ }
+
+ return nil
+}
+
+func configureAddon(props map[string]interface{}, trait interface{}) error {
md := mapstructure.Metadata{}
decoder, err := mapstructure.NewDecoder(
&mapstructure.DecoderConfig{
Metadata: &md,
WeaklyTypedInput: true,
TagName: "property",
- Result: &traits,
+ Result: &trait,
},
)
if err != nil {
return err
}
- return decoder.Decode(config)
+ return decoder.Decode(props)
}
diff --git a/pkg/controller/integration/kits.go b/pkg/controller/integration/kits.go
index 5e8c97f4a..2f029b037 100644
--- a/pkg/controller/integration/kits.go
+++ b/pkg/controller/integration/kits.go
@@ -177,8 +177,8 @@ func hasMatchingTraits(traits interface{}, kitTraits interface{}) (bool, error)
continue
}
id := string(t.ID())
- it, ok1 := traitsMap[id]
- kt, ok2 := kitTraitsMap[id]
+ it, ok1 := findTrait(traitsMap, id)
+ kt, ok2 := findTrait(kitTraitsMap, id)
if !ok1 && !ok2 {
continue
@@ -201,6 +201,22 @@ func hasMatchingTraits(traits interface{}, kitTraits interface{}) (bool, error)
return true, nil
}
+func findTrait(traitsMap map[string]map[string]interface{}, id string) (map[string]interface{}, bool) {
+ if trait, ok := traitsMap[id]; ok {
+ return trait, true
+ }
+
+ if addons, ok := traitsMap["addons"]; ok {
+ if addon, ok := addons[id]; ok {
+ if trait, ok := addon.(map[string]interface{}); ok {
+ return trait, true
+ }
+ }
+ }
+
+ return nil, false
+}
+
func matchesComparableTrait(ct trait.ComparableTrait, it map[string]interface{}, kt map[string]interface{}) (bool, error) {
t1 := reflect.New(reflect.TypeOf(ct).Elem()).Interface()
if err := trait.ToTrait(it, &t1); err != nil {
diff --git a/pkg/trait/knative_test.go b/pkg/trait/knative_test.go
index 590eeda63..de4c6d42d 100644
--- a/pkg/trait/knative_test.go
+++ b/pkg/trait/knative_test.go
@@ -106,7 +106,7 @@ func TestKnativeEnvConfigurationFromTrait(t *testing.T) {
tc := NewCatalog(c)
- err = tc.configure(&environment)
+ err = tc.Configure(&environment)
assert.Nil(t, err)
tr, _ := tc.GetTrait("knative").(*knativeTrait)
@@ -227,7 +227,7 @@ func TestKnativeEnvConfigurationFromSource(t *testing.T) {
tc := NewCatalog(c)
- err = tc.configure(&environment)
+ err = tc.Configure(&environment)
assert.Nil(t, err)
tr, _ := tc.GetTrait("knative").(*knativeTrait)
@@ -295,7 +295,7 @@ func TestKnativePlatformHttpConfig(t *testing.T) {
tc := NewCatalog(c)
- err = tc.configure(&environment)
+ err = tc.Configure(&environment)
assert.Nil(t, err)
err = tc.apply(&environment)
@@ -342,7 +342,7 @@ func TestKnativePlatformHttpDependencies(t *testing.T) {
tc := NewCatalog(c)
- err = tc.configure(&environment)
+ err = tc.Configure(&environment)
assert.Nil(t, err)
err = tc.apply(&environment)
diff --git a/pkg/trait/test_support.go b/pkg/trait/test_support.go
index 5dd0aafb9..8bc15b37a 100644
--- a/pkg/trait/test_support.go
+++ b/pkg/trait/test_support.go
@@ -32,6 +32,7 @@ import (
traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util/kubernetes"
+ "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
@@ -147,3 +148,16 @@ func traitToMap(t *testing.T, trait interface{}) map[string]interface{} {
return traitMap
}
+
+func ToAddonTrait(t *testing.T, config map[string]interface{}) v1.AddonTrait {
+ t.Helper()
+
+ data, err := json.Marshal(config)
+ assert.NoError(t, err)
+
+ var addon v1.AddonTrait
+ err = json.Unmarshal(data, &addon)
+ assert.NoError(t, err)
+
+ return addon
+}
diff --git a/pkg/trait/trait_catalog.go b/pkg/trait/trait_catalog.go
index 84386a2b7..f706fa959 100644
--- a/pkg/trait/trait_catalog.go
+++ b/pkg/trait/trait_catalog.go
@@ -88,7 +88,7 @@ func (c *Catalog) TraitsForProfile(profile v1.TraitProfile) []Trait {
}
func (c *Catalog) apply(environment *Environment) error {
- if err := c.configure(environment); err != nil {
+ if err := c.Configure(environment); err != nil {
return err
}
traits := c.traitsFor(environment)
diff --git a/pkg/trait/trait_configure.go b/pkg/trait/trait_configure.go
index fe0287a69..f50fc26d2 100644
--- a/pkg/trait/trait_configure.go
+++ b/pkg/trait/trait_configure.go
@@ -23,15 +23,15 @@ import (
"reflect"
"strings"
- "github.com/apache/camel-k/pkg/util"
"github.com/mitchellh/mapstructure"
"github.com/pkg/errors"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ "github.com/apache/camel-k/pkg/util"
)
-// configure reads trait configurations from environment and applies them to catalog.
-func (c *Catalog) configure(env *Environment) error {
+// Configure reads trait configurations from environment and applies them to catalog.
+func (c *Catalog) Configure(env *Environment) error {
if env.Platform != nil {
if err := c.configureTraits(env.Platform.Status.Traits); err != nil {
return err
@@ -67,9 +67,17 @@ func (c *Catalog) configureTraits(traits interface{}) error {
}
for id, trait := range traitsMap {
- t := trait // Avoid G601: Implicit memory aliasing in for loop
- if catTrait := c.GetTrait(id); catTrait != nil {
- if err := decodeTrait(t, catTrait, true); err != nil {
+ if id == "addons" {
+ continue
+ }
+ if err := c.configureTrait(id, trait); err != nil {
+ return err
+ }
+ }
+ // Addons
+ for id, trait := range traitsMap["addons"] {
+ if addons, ok := trait.(map[string]interface{}); ok {
+ if err := c.configureTrait(id, addons); err != nil {
return err
}
}
@@ -78,6 +86,16 @@ func (c *Catalog) configureTraits(traits interface{}) error {
return nil
}
+func (c *Catalog) configureTrait(id string, trait map[string]interface{}) error {
+ if catTrait := c.GetTrait(id); catTrait != nil {
+ if err := decodeTrait(trait, catTrait, true); err != nil {
+ return err
+ }
+ }
+
+ return nil
+}
+
func decodeTrait(in map[string]interface{}, target Trait, root bool) error {
// decode legacy configuration first if it exists
if root && in["configuration"] != nil {
diff --git a/pkg/trait/trait_configure_test.go b/pkg/trait/trait_configure_test.go
index 125ddd42b..2c106fa39 100644
--- a/pkg/trait/trait_configure_test.go
+++ b/pkg/trait/trait_configure_test.go
@@ -30,6 +30,42 @@ import (
traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
)
+func TestTraitConfiguration(t *testing.T) {
+ env := Environment{
+ Integration: &v1.Integration{
+ Spec: v1.IntegrationSpec{
+ Profile: v1.TraitProfileKubernetes,
+ Traits: v1.Traits{
+ Logging: &traitv1.LoggingTrait{
+ JSON: pointer.Bool(true),
+ JSONPrettyPrint: pointer.Bool(false),
+ Level: "DEBUG",
+ },
+ Service: &traitv1.ServiceTrait{
+ Trait: traitv1.Trait{
+ Enabled: pointer.Bool(true),
+ },
+ Auto: pointer.Bool(true),
+ NodePort: pointer.Bool(false),
+ },
+ },
+ },
+ },
+ }
+ c := NewCatalog(nil)
+ assert.NoError(t, c.Configure(&env))
+ logging, ok := c.GetTrait("logging").(*loggingTrait)
+ require.True(t, ok)
+ assert.True(t, *logging.JSON)
+ assert.False(t, *logging.JSONPrettyPrint)
+ assert.Equal(t, "DEBUG", logging.Level)
+ service, ok := c.GetTrait("service").(*serviceTrait)
+ require.True(t, ok)
+ assert.True(t, *service.Enabled)
+ assert.True(t, *service.Auto)
+ assert.False(t, *service.NodePort)
+}
+
func TestTraitConfigurationFromAnnotations(t *testing.T) {
env := Environment{
Integration: &v1.Integration{
@@ -51,7 +87,7 @@ func TestTraitConfigurationFromAnnotations(t *testing.T) {
},
}
c := NewCatalog(nil)
- assert.NoError(t, c.configure(&env))
+ assert.NoError(t, c.Configure(&env))
assert.True(t, *c.GetTrait("cron").(*cronTrait).Fallback)
assert.Equal(t, "annotated-policy", c.GetTrait("cron").(*cronTrait).ConcurrencyPolicy)
assert.True(t, *c.GetTrait("environment").(*environmentTrait).ContainerMeta)
@@ -71,7 +107,7 @@ func TestFailOnWrongTraitAnnotations(t *testing.T) {
},
}
c := NewCatalog(nil)
- assert.Error(t, c.configure(&env))
+ assert.Error(t, c.Configure(&env))
}
func TestTraitConfigurationOverrideRulesFromAnnotations(t *testing.T) {
@@ -127,7 +163,7 @@ func TestTraitConfigurationOverrideRulesFromAnnotations(t *testing.T) {
},
}
c := NewCatalog(nil)
- assert.NoError(t, c.configure(&env))
+ assert.NoError(t, c.Configure(&env))
assert.Equal(t, "schedule2", c.GetTrait("cron").(*cronTrait).Schedule)
assert.Equal(t, "cmp4", c.GetTrait("cron").(*cronTrait).Components)
assert.Equal(t, "policy4", c.GetTrait("cron").(*cronTrait).ConcurrencyPolicy)
@@ -149,7 +185,7 @@ func TestTraitListConfigurationFromAnnotations(t *testing.T) {
},
}
c := NewCatalog(nil)
- assert.NoError(t, c.configure(&env))
+ assert.NoError(t, c.Configure(&env))
assert.Equal(t, []string{"opt1", "opt2"}, c.GetTrait("jolokia").(*jolokiaTrait).Options)
assert.Equal(t, []string{"Binding:xxx"}, c.GetTrait("service-binding").(*serviceBindingTrait).Services)
}
@@ -168,7 +204,7 @@ func TestTraitSplitConfiguration(t *testing.T) {
},
}
c := NewCatalog(nil)
- assert.NoError(t, c.configure(&env))
+ assert.NoError(t, c.Configure(&env))
assert.Equal(t, []string{"opt1", "opt2"}, c.GetTrait("owner").(*ownerTrait).TargetLabels)
}
diff --git a/pkg/trait/trait_test.go b/pkg/trait/trait_test.go
index b55b43eba..2b9f23073 100644
--- a/pkg/trait/trait_test.go
+++ b/pkg/trait/trait_test.go
@@ -158,7 +158,7 @@ func TestTraitHierarchyDecode(t *testing.T) {
}
c := NewTraitTestCatalog()
- err := c.configure(env)
+ err := c.Configure(env)
assert.Nil(t, err)
diff --git a/pkg/trait/util.go b/pkg/trait/util.go
index 8b56e6f78..17e43a853 100644
--- a/pkg/trait/util.go
+++ b/pkg/trait/util.go
@@ -224,12 +224,22 @@ func AddSourceDependencies(source v1.SourceSpec, catalog *camel.RuntimeCatalog)
return dependencies
}
-// ToMap accepts either v1.Traits or v1.IntegrationKitTraits and converts it to a map.
-func ToMap(traits interface{}) (map[string]map[string]interface{}, error) {
+// AssertTraitsType asserts that traits is either v1.Traits or v1.IntegrationKitTraits.
+// This function is provided because Go doesn't have Either nor union types.
+func AssertTraitsType(traits interface{}) error {
_, ok1 := traits.(v1.Traits)
_, ok2 := traits.(v1.IntegrationKitTraits)
if !ok1 && !ok2 {
- return nil, errors.New("traits must be either v1.Traits or v1.IntegrationKitTraits")
+ return errors.New("traits must be either v1.Traits or v1.IntegrationKitTraits")
+ }
+
+ return nil
+}
+
+// ToMap accepts either v1.Traits or v1.IntegrationKitTraits and converts it to a map.
+func ToMap(traits interface{}) (map[string]map[string]interface{}, error) {
+ if err := AssertTraitsType(traits); err != nil {
+ return nil, err
}
data, err := json.Marshal(traits)
diff --git a/pkg/trait/util_test.go b/pkg/trait/util_test.go
new file mode 100644
index 000000000..3a56bf029
--- /dev/null
+++ b/pkg/trait/util_test.go
@@ -0,0 +1,108 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package trait
+
+import (
+ "testing"
+
+ "k8s.io/utils/pointer"
+
+ v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
+
+ "github.com/stretchr/testify/assert"
+)
+
+func TestToMap(t *testing.T) {
+ traits := v1.Traits{
+ Container: &traitv1.ContainerTrait{
+ Trait: traitv1.Trait{
+ Enabled: pointer.Bool(true),
+ },
+ Auto: pointer.Bool(false),
+ Expose: pointer.Bool(true),
+ Port: 8081,
+ PortName: "http-8081",
+ ServicePort: 81,
+ ServicePortName: "http-81",
+ },
+ Service: &traitv1.ServiceTrait{
+ Trait: traitv1.Trait{
+ Enabled: pointer.Bool(true),
+ },
+ },
+ Addons: map[string]v1.AddonTrait{
+ "tracing": ToAddonTrait(t, map[string]interface{}{
+ "enabled": true,
+ }),
+ },
+ }
+ expected := map[string]map[string]interface{}{
+ "container": {
+ "enabled": true,
+ "auto": false,
+ "expose": true,
+ "port": float64(8081),
+ "portName": "http-8081",
+ "servicePort": float64(81),
+ "servicePortName": "http-81",
+ },
+ "service": {
+ "enabled": true,
+ },
+ "addons": {
+ "tracing": map[string]interface{}{
+ "enabled": true,
+ },
+ },
+ }
+
+ traitMap, err := ToMap(traits)
+
+ assert.NoError(t, err)
+ assert.Equal(t, expected, traitMap)
+}
+
+func TestToTrait(t *testing.T) {
+ config := map[string]interface{}{
+ "enabled": true,
+ "auto": false,
+ "expose": true,
+ "port": 8081,
+ "portName": "http-8081",
+ "servicePort": 81,
+ "servicePortName": "http-81",
+ }
+ expected := traitv1.ContainerTrait{
+ Trait: traitv1.Trait{
+ Enabled: pointer.Bool(true),
+ },
+ Auto: pointer.Bool(false),
+ Expose: pointer.Bool(true),
+ Port: 8081,
+ PortName: "http-8081",
+ ServicePort: 81,
+ ServicePortName: "http-81",
+ }
+
+ trait := traitv1.ContainerTrait{}
+ err := ToTrait(config, &trait)
+
+ assert.NoError(t, err)
+ assert.Equal(t, expected, trait)
+}
[camel-k] 10/14: fix(trait): refactor and fix quarkus native build
Posted by ts...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tsato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 642127041ebd45b4bdfa5a5a1c3ed32567b6bc7c
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Sat Jul 2 22:20:38 2022 +0900
fix(trait): refactor and fix quarkus native build
---
.../bases/camel.apache.org_integrationkits.yaml | 1 +
.../camel.apache.org_integrationplatforms.yaml | 2 +
.../crd/bases/camel.apache.org_integrations.yaml | 1 +
.../bases/camel.apache.org_kameletbindings.yaml | 1 +
helm/camel-k/crds/crd-integration-kit.yaml | 1 +
helm/camel-k/crds/crd-integration-platform.yaml | 2 +
helm/camel-k/crds/crd-integration.yaml | 1 +
helm/camel-k/crds/crd-kamelet-binding.yaml | 1 +
pkg/apis/camel/v1/trait/quarkus.go | 5 +-
pkg/resources/resources.go | 16 +-
pkg/trait/quarkus.go | 234 ++++++++++++---------
pkg/trait/util.go | 9 +
12 files changed, 166 insertions(+), 108 deletions(-)
diff --git a/config/crd/bases/camel.apache.org_integrationkits.yaml b/config/crd/bases/camel.apache.org_integrationkits.yaml
index 2757e6ceb..a6c966e2f 100644
--- a/config/crd/bases/camel.apache.org_integrationkits.yaml
+++ b/config/crd/bases/camel.apache.org_integrationkits.yaml
@@ -186,6 +186,7 @@ spec:
to the integration in case no existing kit that matches
the integration exists.
items:
+ description: Quarkus package type.
type: string
type: array
type: object
diff --git a/config/crd/bases/camel.apache.org_integrationplatforms.yaml b/config/crd/bases/camel.apache.org_integrationplatforms.yaml
index 716a18b7e..97e728f3c 100644
--- a/config/crd/bases/camel.apache.org_integrationplatforms.yaml
+++ b/config/crd/bases/camel.apache.org_integrationplatforms.yaml
@@ -1444,6 +1444,7 @@ spec:
to the integration in case no existing kit that matches
the integration exists.
items:
+ description: Quarkus package type.
type: string
type: array
type: object
@@ -3049,6 +3050,7 @@ spec:
to the integration in case no existing kit that matches
the integration exists.
items:
+ description: Quarkus package type.
type: string
type: array
type: object
diff --git a/config/crd/bases/camel.apache.org_integrations.yaml b/config/crd/bases/camel.apache.org_integrations.yaml
index e0cc1dbae..aaa5cc3c1 100644
--- a/config/crd/bases/camel.apache.org_integrations.yaml
+++ b/config/crd/bases/camel.apache.org_integrations.yaml
@@ -6921,6 +6921,7 @@ spec:
to the integration in case no existing kit that matches
the integration exists.
items:
+ description: Quarkus package type.
type: string
type: array
type: object
diff --git a/config/crd/bases/camel.apache.org_kameletbindings.yaml b/config/crd/bases/camel.apache.org_kameletbindings.yaml
index c8e451d32..3c937cb1b 100644
--- a/config/crd/bases/camel.apache.org_kameletbindings.yaml
+++ b/config/crd/bases/camel.apache.org_kameletbindings.yaml
@@ -7215,6 +7215,7 @@ spec:
be assigned to the integration in case no existing kit
that matches the integration exists.
items:
+ description: Quarkus package type.
type: string
type: array
type: object
diff --git a/helm/camel-k/crds/crd-integration-kit.yaml b/helm/camel-k/crds/crd-integration-kit.yaml
index 2757e6ceb..a6c966e2f 100644
--- a/helm/camel-k/crds/crd-integration-kit.yaml
+++ b/helm/camel-k/crds/crd-integration-kit.yaml
@@ -186,6 +186,7 @@ spec:
to the integration in case no existing kit that matches
the integration exists.
items:
+ description: Quarkus package type.
type: string
type: array
type: object
diff --git a/helm/camel-k/crds/crd-integration-platform.yaml b/helm/camel-k/crds/crd-integration-platform.yaml
index 716a18b7e..97e728f3c 100644
--- a/helm/camel-k/crds/crd-integration-platform.yaml
+++ b/helm/camel-k/crds/crd-integration-platform.yaml
@@ -1444,6 +1444,7 @@ spec:
to the integration in case no existing kit that matches
the integration exists.
items:
+ description: Quarkus package type.
type: string
type: array
type: object
@@ -3049,6 +3050,7 @@ spec:
to the integration in case no existing kit that matches
the integration exists.
items:
+ description: Quarkus package type.
type: string
type: array
type: object
diff --git a/helm/camel-k/crds/crd-integration.yaml b/helm/camel-k/crds/crd-integration.yaml
index e0cc1dbae..aaa5cc3c1 100644
--- a/helm/camel-k/crds/crd-integration.yaml
+++ b/helm/camel-k/crds/crd-integration.yaml
@@ -6921,6 +6921,7 @@ spec:
to the integration in case no existing kit that matches
the integration exists.
items:
+ description: Quarkus package type.
type: string
type: array
type: object
diff --git a/helm/camel-k/crds/crd-kamelet-binding.yaml b/helm/camel-k/crds/crd-kamelet-binding.yaml
index c8e451d32..3c937cb1b 100644
--- a/helm/camel-k/crds/crd-kamelet-binding.yaml
+++ b/helm/camel-k/crds/crd-kamelet-binding.yaml
@@ -7215,6 +7215,7 @@ spec:
be assigned to the integration in case no existing kit
that matches the integration exists.
items:
+ description: Quarkus package type.
type: string
type: array
type: object
diff --git a/pkg/apis/camel/v1/trait/quarkus.go b/pkg/apis/camel/v1/trait/quarkus.go
index 8432e68f9..c521fe616 100644
--- a/pkg/apis/camel/v1/trait/quarkus.go
+++ b/pkg/apis/camel/v1/trait/quarkus.go
@@ -39,9 +39,12 @@ type QuarkusTrait struct {
PackageTypes []QuarkusPackageType `property:"package-type" json:"packageTypes,omitempty"`
}
+// Quarkus package type.
type QuarkusPackageType string
const (
+ // Quarkus package type representing "fast jar" packaging.
FastJarPackageType QuarkusPackageType = "fast-jar"
- NativePackageType QuarkusPackageType = "native"
+ // Quarkus package type representing "native" packaging.
+ NativePackageType QuarkusPackageType = "native"
)
diff --git a/pkg/resources/resources.go b/pkg/resources/resources.go
index a9851feea..d50f1734c 100644
--- a/pkg/resources/resources.go
+++ b/pkg/resources/resources.go
@@ -131,30 +131,30 @@ var assets = func() http.FileSystem {
"/crd/bases/camel.apache.org_integrationkits.yaml": &vfsgen۰CompressedFileInfo{
name: "camel.apache.org_integrationkits.yaml",
modTime: time.Time{},
- uncompressedSize: 15017,
+ uncompressedSize: 15078,
- compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x3b\x5d\x73\xdb\x48\x72\xef\xfc\x15\x5d\xab\x07\xdb\x55\x24\x74\x9b\x5c\x5d\xa5\x94\xca\x83\x4e\xb6\xf7\x54\xb6\x25\xc7\xe4\xee\x65\xab\xf6\x41\x4d\xa0\x09\xce\x12\x98\xc1\xcd\x0c\x48\x31\xa9\xfc\xf7\x54\xf7\x0c\x40\x90\x04\x48\xae\x76\x9d\x7b\x31\x5e\x2c\x02\x33\x3d\xfd\xfd\x39\xbe\x82\xc9\x1f\xf7\x8c\xae\xe0\xa3\x4a\x49\x3b\xca\xc0\x1b\xf0\x4b\x82\xdb\x0a\xd3\x25\xc1\xd4\x2c\xfc\x06\x2d\xc1\x7b\x53\xeb\x0c\xbd\x [...]
+ compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x3b\x5d\x6f\xdb\x48\x92\xef\xfa\x15\x85\xf1\x43\x12\x40\xa2\x77\xee\x16\x8b\x83\x0f\xf7\xe0\x75\x92\x59\x23\x89\x9d\x8b\x34\xb3\x37\xc0\x3c\xb8\x44\x96\xa8\x1e\x91\xdd\xdc\xee\xa6\x64\xdd\xe1\xfe\xfb\xa2\xaa\x9b\x14\x25\x91\x92\xc6\x33\xc1\xbe\x84\x2f\xb1\xc8\xee\xea\xfa\xfe\xec\x5c\xc1\xe4\x8f\x7b\x46\x57\xf0\x51\xa5\xa4\x1d\x65\xe0\x0d\xf8\x25\xc1\x6d\x85\xe9\x92\x60\x6a\x16\x7e\x83\x96\xe0\xbd\xa9\x75\x86\x5e\x [...]
},
"/crd/bases/camel.apache.org_integrationplatforms.yaml": &vfsgen۰CompressedFileInfo{
name: "camel.apache.org_integrationplatforms.yaml",
modTime: time.Time{},
- uncompressedSize: 174247,
+ uncompressedSize: 174369,
- compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xbd\x7d\x73\xdb\x36\xb6\x30\xfe\x7f\x3e\x05\xc6\xfd\x23\x4e\x46\x92\x9b\xdd\xdb\xdd\x5e\xdf\xe9\x3c\x8f\xd7\x49\x5b\x37\x71\xec\x6b\x3b\xb9\x77\xa7\xed\x54\x10\x79\x24\x21\x22\x01\x2e\x00\xca\x51\x7f\xfb\xfb\xee\xcf\xe0\x00\x20\x29\x89\x04\x29\xc9\x6f\x6d\xc4\xce\xec\xc6\x36\x01\x1e\x1c\x1c\x9c\x37\x9c\x97\xaf\x48\xff\xee\x9e\x67\x5f\x91\x77\x2c\x02\xae\x20\x26\x5a\x10\x3d\x05\x72\x92\xd1\x68\x0a\xe4\x5a\x8c\xf5\x [...]
+ compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xbd\x7d\x73\xdb\x36\xb6\x30\xfe\x7f\x3e\x05\xc6\xfd\x23\x4e\x46\x92\x9b\xdd\xdb\xdd\x5e\xdf\xe9\x3c\x8f\xd7\x49\x5b\x37\x71\xec\x6b\x3b\xb9\x77\xa7\xed\x54\x10\x79\x24\x21\x22\x01\x2e\x00\xca\x51\x7f\xfb\xfb\xee\xcf\xe0\x00\x20\x29\x89\x04\x29\xc9\x6f\x6d\xc4\xce\xec\xc6\x36\x01\x1e\x1c\x1c\x9c\x37\x9c\x97\xaf\x48\xff\xee\x9e\x67\x5f\x91\x77\x2c\x02\xae\x20\x26\x5a\x10\x3d\x05\x72\x92\xd1\x68\x0a\xe4\x5a\x8c\xf5\x [...]
},
"/crd/bases/camel.apache.org_integrations.yaml": &vfsgen۰CompressedFileInfo{
name: "camel.apache.org_integrations.yaml",
modTime: time.Time{},
- uncompressedSize: 470887,
+ uncompressedSize: 470948,
- compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xbd\x7b\x73\x1b\x37\xf6\x28\xf8\xbf\x3f\x05\x4a\x49\x5d\x49\x13\x91\xb2\x33\x73\x53\xbf\xf1\x4e\xdd\x94\x46\x92\x13\x6d\x6c\x99\x65\x29\xc9\x4d\x39\x9e\x04\xec\x06\x49\x5c\x35\x81\x1e\x00\x4d\x89\xbf\xf5\x7e\xf7\x2d\x1c\x00\xfd\xe0\xab\x0f\x5a\xa2\xe3\xcc\x36\xa6\x6a\x62\x52\xec\xd3\x78\x1c\x9c\xf7\xe3\x0b\x32\x78\xba\xf1\xec\x0b\xf2\x9a\x27\x4c\x68\x96\x12\x23\x89\x99\x31\x72\x96\xd3\x64\xc6\xc8\x8d\x9c\x98\x7b\x [...]
+ compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xbd\x7b\x73\x1b\x37\xf6\x28\xf8\xbf\x3f\x05\x4a\x49\x5d\x49\x13\x91\xb2\x33\x73\x53\xbf\xf1\x4e\xdd\x94\x46\x92\x13\x6d\x6c\x99\x65\x29\xc9\x4d\x39\x9e\x04\xec\x06\x49\x5c\x35\x81\x1e\x00\x4d\x89\xbf\xf5\x7e\xf7\x2d\x1c\x00\xfd\xe0\xab\x0f\x5a\xa2\xe3\xcc\x36\xa6\x6a\x62\x52\xec\xd3\x78\x1c\x9c\xf7\xe3\x0b\x32\x78\xba\xf1\xec\x0b\xf2\x9a\x27\x4c\x68\x96\x12\x23\x89\x99\x31\x72\x96\xd3\x64\xc6\xc8\x8d\x9c\x98\x7b\x [...]
},
"/crd/bases/camel.apache.org_kameletbindings.yaml": &vfsgen۰CompressedFileInfo{
name: "camel.apache.org_kameletbindings.yaml",
modTime: time.Time{},
- uncompressedSize: 543833,
+ uncompressedSize: 543898,
- compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xfd\xfd\x73\x1b\x37\xb2\x2f\x8c\xff\xee\xbf\x02\x25\xa7\xae\xa4\x13\x92\xb2\xb3\xbb\xa9\xb3\xfe\x6e\xdd\x94\x56\x96\x13\x7d\x63\xcb\x2c\x4b\x71\x6e\xca\xc9\x49\xc0\x19\x90\xc4\xd5\x10\x98\x05\x30\x94\xb8\x8f\x9f\xff\xfd\x29\x34\x80\x79\xe1\x9b\xd0\x43\x51\x51\x36\x83\x53\x75\x36\x92\x35\x3d\x18\x00\xdd\xe8\xee\x4f\xbf\x3c\x27\xfd\x87\x1b\xcf\x9e\x93\xb7\x3c\x61\x42\xb3\x94\x18\x49\xcc\x94\x91\xd3\x9c\x26\x53\x46\x [...]
+ compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xfd\xfd\x73\x1b\x37\xb2\x2f\x8c\xff\xee\xbf\x02\x25\xa7\xae\xa4\x13\x92\xb2\xb3\xbb\xa9\xb3\xfe\x6e\xdd\x94\x56\x96\x13\x7d\x63\xcb\x2c\x4b\x71\x6e\xca\xc9\x49\xc0\x19\x90\xc4\xd5\x10\x98\x05\x30\x94\xb8\x8f\x9f\xff\xfd\x29\x34\x80\x79\xe1\x9b\xd0\x43\x51\x51\x36\x83\x53\x75\x36\x92\x35\x3d\x18\x00\xdd\xe8\xee\x4f\xbf\x3c\x27\xfd\x87\x1b\xcf\x9e\x93\xb7\x3c\x61\x42\xb3\x94\x18\x49\xcc\x94\x91\xd3\x9c\x26\x53\x46\x [...]
},
"/crd/bases/camel.apache.org_kamelets.yaml": &vfsgen۰CompressedFileInfo{
name: "camel.apache.org_kamelets.yaml",
diff --git a/pkg/trait/quarkus.go b/pkg/trait/quarkus.go
index 92e34fc19..0951fd3ad 100644
--- a/pkg/trait/quarkus.go
+++ b/pkg/trait/quarkus.go
@@ -79,13 +79,12 @@ func (t *quarkusTrait) Matches(trait Trait) bool {
return false
}
-types:
for _, pt := range t.PackageTypes {
if pt == traitv1.FastJarPackageType && len(qt.PackageTypes) == 0 {
continue
}
if containsPackageType(qt.PackageTypes, pt) {
- continue types
+ continue
}
return false
}
@@ -106,110 +105,77 @@ func (t *quarkusTrait) Configure(e *Environment) (bool, error) {
func (t *quarkusTrait) Apply(e *Environment) error {
if e.IntegrationInPhase(v1.IntegrationPhaseBuildingKit) {
- if containsPackageType(t.PackageTypes, traitv1.NativePackageType) {
- // Native compilation is only supported for a subset of languages,
- // so let's check for compatibility, and fail-fast the Integration,
- // to save compute resources and user time.
- for _, source := range e.Integration.Sources() {
- if language := source.InferLanguage(); language != v1.LanguageKamelet &&
- language != v1.LanguageYaml &&
- language != v1.LanguageXML {
- t.L.ForIntegration(e.Integration).Infof("Integration %s contains a %s source that cannot be compiled to native executable", e.Integration.Namespace+"/"+e.Integration.Name, language)
- e.Integration.Status.Phase = v1.IntegrationPhaseError
- e.Integration.Status.SetCondition(
- v1.IntegrationConditionKitAvailable,
- corev1.ConditionFalse,
- v1.IntegrationConditionUnsupportedLanguageReason,
- fmt.Sprintf("native compilation for language %q is not supported", language))
- // Let the calling controller handle the Integration update
- return nil
- }
- }
- }
-
- switch len(t.PackageTypes) {
- case 0:
- kit := t.newIntegrationKit(e, traitv1.FastJarPackageType)
- e.IntegrationKits = append(e.IntegrationKits, *kit)
-
- case 1:
- kit := t.newIntegrationKit(e, t.PackageTypes[0])
- e.IntegrationKits = append(e.IntegrationKits, *kit)
-
- default:
- for _, packageType := range t.PackageTypes {
- kit := t.newIntegrationKit(e, packageType)
- if kit.Spec.Traits.Quarkus == nil {
- kit.Spec.Traits.Quarkus = &traitv1.QuarkusTrait{}
- }
- kit.Spec.Traits.Quarkus.PackageTypes = []traitv1.QuarkusPackageType{packageType}
- e.IntegrationKits = append(e.IntegrationKits, *kit)
- }
- }
+ t.applyWhileBuildingKit(e)
return nil
}
switch e.IntegrationKit.Status.Phase {
-
case v1.IntegrationKitPhaseBuildSubmitted:
- build := getBuilderTask(e.BuildTasks)
- if build == nil {
- return fmt.Errorf("unable to find builder task: %s", e.Integration.Name)
- }
-
- if build.Maven.Properties == nil {
- build.Maven.Properties = make(map[string]string)
- }
-
- steps, err := builder.StepsFrom(build.Steps...)
- if err != nil {
+ if err := t.applyWhenBuildSubmitted(e); err != nil {
return err
}
- steps = append(steps, builder.Quarkus.CommonSteps...)
-
- native, err := t.isNativeKit(e)
- if err != nil {
+ case v1.IntegrationKitPhaseReady:
+ if err := t.applyWhenKitReady(e); err != nil {
return err
}
+ }
- if native {
- build.Maven.Properties["quarkus.package.type"] = string(traitv1.NativePackageType)
- steps = append(steps, builder.Image.NativeImageContext)
- // Spectrum does not rely on Dockerfile to assemble the image
- if e.Platform.Status.Build.PublishStrategy != v1.IntegrationPlatformBuildPublishStrategySpectrum {
- steps = append(steps, builder.Image.ExecutableDockerfile)
- }
- } else {
- build.Maven.Properties["quarkus.package.type"] = string(traitv1.FastJarPackageType)
- steps = append(steps, builder.Quarkus.ComputeQuarkusDependencies, builder.Image.IncrementalImageContext)
- // Spectrum does not rely on Dockerfile to assemble the image
- if e.Platform.Status.Build.PublishStrategy != v1.IntegrationPlatformBuildPublishStrategySpectrum {
- steps = append(steps, builder.Image.JvmDockerfile)
- }
+ return nil
+}
+
+func (t *quarkusTrait) applyWhileBuildingKit(e *Environment) {
+ if containsPackageType(t.PackageTypes, traitv1.NativePackageType) {
+ // Native compilation is only supported for a subset of languages,
+ // so let's check for compatibility, and fail-fast the Integration,
+ // to save compute resources and user time.
+ if !t.validateNativeSupport(e) {
+ // Let the calling controller handle the Integration update
+ return
}
+ }
- // Sort steps by phase
- sort.SliceStable(steps, func(i, j int) bool {
- return steps[i].Phase() < steps[j].Phase()
- })
+ switch len(t.PackageTypes) {
+ case 0:
+ kit := t.newIntegrationKit(e, traitv1.FastJarPackageType)
+ e.IntegrationKits = append(e.IntegrationKits, *kit)
- build.Steps = builder.StepIDsFor(steps...)
+ case 1:
+ kit := t.newIntegrationKit(e, t.PackageTypes[0])
+ e.IntegrationKits = append(e.IntegrationKits, *kit)
- case v1.IntegrationKitPhaseReady:
- if e.IntegrationInRunningPhases() && t.isNativeIntegration(e) {
- container := e.GetIntegrationContainer()
- if container == nil {
- return fmt.Errorf("unable to find integration container: %s", e.Integration.Name)
+ default:
+ for _, pt := range t.PackageTypes {
+ packageType := pt
+ kit := t.newIntegrationKit(e, packageType)
+ if kit.Spec.Traits.Quarkus == nil {
+ kit.Spec.Traits.Quarkus = &traitv1.QuarkusTrait{}
}
+ kit.Spec.Traits.Quarkus.PackageTypes = []traitv1.QuarkusPackageType{packageType}
+ e.IntegrationKits = append(e.IntegrationKits, *kit)
+ }
+ }
+}
- container.Command = []string{"./camel-k-integration-" + defaults.Version + "-runner"}
- container.WorkingDir = builder.DeploymentDir
+func (t *quarkusTrait) validateNativeSupport(e *Environment) bool {
+ for _, source := range e.Integration.Sources() {
+ if language := source.InferLanguage(); language != v1.LanguageKamelet &&
+ language != v1.LanguageYaml &&
+ language != v1.LanguageXML {
+ t.L.ForIntegration(e.Integration).Infof("Integration %s/%s contains a %s source that cannot be compiled to native executable", e.Integration.Namespace, e.Integration.Name, language)
+ e.Integration.Status.Phase = v1.IntegrationPhaseError
+ e.Integration.Status.SetCondition(
+ v1.IntegrationConditionKitAvailable,
+ corev1.ConditionFalse,
+ v1.IntegrationConditionUnsupportedLanguageReason,
+ fmt.Sprintf("native compilation for language %q is not supported", language))
+
+ return false
}
}
- return nil
+ return true
}
func (t *quarkusTrait) newIntegrationKit(e *Environment, packageType traitv1.QuarkusPackageType) *v1.IntegrationKit {
@@ -242,16 +208,81 @@ func (t *quarkusTrait) newIntegrationKit(e *Environment, packageType traitv1.Qua
kit.Spec = v1.IntegrationKitSpec{
Dependencies: e.Integration.Status.Dependencies,
Repositories: e.Integration.Spec.Repositories,
- Traits: v1.IntegrationKitTraits{
- Builder: e.Integration.Spec.Traits.Builder,
- Quarkus: e.Integration.Spec.Traits.Quarkus,
- Registry: e.Integration.Spec.Traits.Registry,
- },
+ Traits: propagateKitTraits(e),
}
return kit
}
+func propagateKitTraits(e *Environment) v1.IntegrationKitTraits {
+ traits := e.Integration.Spec.Traits
+ kitTraits := v1.IntegrationKitTraits{
+ Builder: traits.Builder.DeepCopy(),
+ Quarkus: traits.Quarkus.DeepCopy(),
+ Registry: traits.Registry.DeepCopy(),
+ }
+
+ // propagate addons that influence kits too
+ if len(traits.Addons) > 0 {
+ kitTraits.Addons = make(map[string]v1.AddonTrait)
+ for id, addon := range traits.Addons {
+ if t := e.Catalog.GetTrait(id); t != nil && t.InfluencesKit() {
+ kitTraits.Addons[id] = *addon.DeepCopy()
+ }
+ }
+ }
+
+ return kitTraits
+}
+
+func (t *quarkusTrait) applyWhenBuildSubmitted(e *Environment) error {
+ build := getBuilderTask(e.BuildTasks)
+ if build == nil {
+ return fmt.Errorf("unable to find builder task: %s", e.Integration.Name)
+ }
+
+ if build.Maven.Properties == nil {
+ build.Maven.Properties = make(map[string]string)
+ }
+
+ steps, err := builder.StepsFrom(build.Steps...)
+ if err != nil {
+ return err
+ }
+
+ steps = append(steps, builder.Quarkus.CommonSteps...)
+
+ native, err := t.isNativeKit(e)
+ if err != nil {
+ return err
+ }
+
+ if native {
+ build.Maven.Properties["quarkus.package.type"] = string(traitv1.NativePackageType)
+ steps = append(steps, builder.Image.NativeImageContext)
+ // Spectrum does not rely on Dockerfile to assemble the image
+ if e.Platform.Status.Build.PublishStrategy != v1.IntegrationPlatformBuildPublishStrategySpectrum {
+ steps = append(steps, builder.Image.ExecutableDockerfile)
+ }
+ } else {
+ build.Maven.Properties["quarkus.package.type"] = string(traitv1.FastJarPackageType)
+ steps = append(steps, builder.Quarkus.ComputeQuarkusDependencies, builder.Image.IncrementalImageContext)
+ // Spectrum does not rely on Dockerfile to assemble the image
+ if e.Platform.Status.Build.PublishStrategy != v1.IntegrationPlatformBuildPublishStrategySpectrum {
+ steps = append(steps, builder.Image.JvmDockerfile)
+ }
+ }
+
+ // Sort steps by phase
+ sort.SliceStable(steps, func(i, j int) bool {
+ return steps[i].Phase() < steps[j].Phase()
+ })
+
+ build.Steps = builder.StepIDsFor(steps...)
+
+ return nil
+}
+
func (t *quarkusTrait) isNativeKit(e *Environment) (bool, error) {
switch types := t.PackageTypes; len(types) {
case 0:
@@ -263,20 +294,25 @@ func (t *quarkusTrait) isNativeKit(e *Environment) (bool, error) {
}
}
-func (t *quarkusTrait) isNativeIntegration(e *Environment) bool {
- // The current IntegrationKit determines the Integration runtime type
- return e.IntegrationKit.Labels[v1.IntegrationKitLayoutLabel] == v1.IntegrationKitLayoutNative
-}
-
-func getBuilderTask(tasks []v1.Task) *v1.BuilderTask {
- for i, task := range tasks {
- if task.Builder != nil {
- return tasks[i].Builder
+func (t *quarkusTrait) applyWhenKitReady(e *Environment) error {
+ if e.IntegrationInRunningPhases() && t.isNativeIntegration(e) {
+ container := e.GetIntegrationContainer()
+ if container == nil {
+ return fmt.Errorf("unable to find integration container: %s", e.Integration.Name)
}
+
+ container.Command = []string{"./camel-k-integration-" + defaults.Version + "-runner"}
+ container.WorkingDir = builder.DeploymentDir
}
+
return nil
}
+func (t *quarkusTrait) isNativeIntegration(e *Environment) bool {
+ // The current IntegrationKit determines the Integration runtime type
+ return e.IntegrationKit.Labels[v1.IntegrationKitLayoutLabel] == v1.IntegrationKitLayoutNative
+}
+
func containsPackageType(types []traitv1.QuarkusPackageType, t traitv1.QuarkusPackageType) bool {
for _, ti := range types {
if t == ti {
diff --git a/pkg/trait/util.go b/pkg/trait/util.go
index 17e43a853..ef7b9ec31 100644
--- a/pkg/trait/util.go
+++ b/pkg/trait/util.go
@@ -267,3 +267,12 @@ func ToTrait(trait map[string]interface{}, target interface{}) error {
return nil
}
+
+func getBuilderTask(tasks []v1.Task) *v1.BuilderTask {
+ for i, task := range tasks {
+ if task.Builder != nil {
+ return tasks[i].Builder
+ }
+ }
+ return nil
+}
[camel-k] 14/14: fix(cli): make promote aware of legacy and new trait configurations
Posted by ts...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tsato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 35ed0ee29c86caf824f17224d8a06751baeda07b
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Tue Jul 5 18:10:28 2022 +0900
fix(cli): make promote aware of legacy and new trait configurations
---
pkg/cmd/describe.go | 6 +-
pkg/cmd/promote.go | 111 +++++++++++++++++++++----------------
pkg/cmd/run_test.go | 4 +-
pkg/controller/integration/kits.go | 8 +--
pkg/trait/trait_configure.go | 29 ++++------
pkg/trait/trait_configure_test.go | 2 +-
pkg/trait/util.go | 54 ++++++++++++++++--
pkg/trait/util_test.go | 99 ++++++++++++++++++++++++++++++++-
8 files changed, 229 insertions(+), 84 deletions(-)
diff --git a/pkg/cmd/describe.go b/pkg/cmd/describe.go
index 44e119f8e..5252f753a 100644
--- a/pkg/cmd/describe.go
+++ b/pkg/cmd/describe.go
@@ -51,15 +51,15 @@ func describeObjectMeta(w *indentedwriter.Writer, om metav1.ObjectMeta) {
}
func describeTraits(w *indentedwriter.Writer, traits interface{}) error {
- traitsMap, err := trait.ToMap(traits)
+ traitMap, err := trait.ToTraitMap(traits)
if err != nil {
return err
}
- if len(traitsMap) > 0 {
+ if len(traitMap) > 0 {
w.Writef(0, "Traits:\n")
- for id, trait := range traitsMap {
+ for id, trait := range traitMap {
w.Writef(1, "%s:\n", strings.Title(id))
// TODO: print the whole TraitSpec as Yaml
for k, v := range trait {
diff --git a/pkg/cmd/promote.go b/pkg/cmd/promote.go
index db9159475..4eb216c89 100644
--- a/pkg/cmd/promote.go
+++ b/pkg/cmd/promote.go
@@ -19,7 +19,6 @@ package cmd
import (
"context"
- "encoding/json"
"fmt"
"regexp"
"strings"
@@ -30,6 +29,7 @@ import (
traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
"github.com/apache/camel-k/pkg/client"
+ "github.com/apache/camel-k/pkg/trait"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/kamelets"
"github.com/apache/camel-k/pkg/util/kubernetes"
@@ -181,81 +181,83 @@ func (o *promoteCmdOptions) getIntegration(c client.Client, name string) (*v1.In
}
func (o *promoteCmdOptions) validateDestResources(c client.Client, it *v1.Integration) error {
- var traits map[string][]string
var configmaps []string
var secrets []string
var pvcs []string
var kamelets []string
// Mount trait
- mounts := it.Spec.Traits.Mount
- if err := json.Unmarshal(mounts.Configuration.RawMessage, &traits); err != nil {
+ mount, err := toPropertyMap(it.Spec.Traits.Mount)
+ if err != nil {
return err
}
- for t, v := range traits {
+ for t, v := range mount {
switch t {
case "configs":
- for _, cn := range v {
- if conf, parseErr := resource.ParseConfig(cn); parseErr == nil {
- if conf.StorageType() == resource.StorageTypeConfigmap {
- configmaps = append(configmaps, conf.Name())
- } else if conf.StorageType() == resource.StorageTypeSecret {
- secrets = append(secrets, conf.Name())
+ if list, ok := v.([]string); ok {
+ for _, cn := range list {
+ if conf, parseErr := resource.ParseConfig(cn); parseErr == nil {
+ if conf.StorageType() == resource.StorageTypeConfigmap {
+ configmaps = append(configmaps, conf.Name())
+ } else if conf.StorageType() == resource.StorageTypeSecret {
+ secrets = append(secrets, conf.Name())
+ }
+ } else {
+ return parseErr
}
- } else {
- return parseErr
}
}
case "resources":
- for _, cn := range v {
- if conf, parseErr := resource.ParseResource(cn); parseErr == nil {
- if conf.StorageType() == resource.StorageTypeConfigmap {
- configmaps = append(configmaps, conf.Name())
- } else if conf.StorageType() == resource.StorageTypeSecret {
- secrets = append(secrets, conf.Name())
+ if list, ok := v.([]string); ok {
+ for _, cn := range list {
+ if conf, parseErr := resource.ParseResource(cn); parseErr == nil {
+ if conf.StorageType() == resource.StorageTypeConfigmap {
+ configmaps = append(configmaps, conf.Name())
+ } else if conf.StorageType() == resource.StorageTypeSecret {
+ secrets = append(secrets, conf.Name())
+ }
+ } else {
+ return parseErr
}
- } else {
- return parseErr
}
}
case "volumes":
- for _, cn := range v {
- if conf, parseErr := resource.ParseVolume(cn); parseErr == nil {
- if conf.StorageType() == resource.StorageTypePVC {
- pvcs = append(pvcs, conf.Name())
+ if list, ok := v.([]string); ok {
+ for _, cn := range list {
+ if conf, parseErr := resource.ParseVolume(cn); parseErr == nil {
+ if conf.StorageType() == resource.StorageTypePVC {
+ pvcs = append(pvcs, conf.Name())
+ }
+ } else {
+ return parseErr
}
- } else {
- return parseErr
}
}
}
}
- // Openapi trait
- openapis := it.Spec.Traits.OpenAPI
- traits = map[string][]string{}
- if len(openapis.Configuration.RawMessage) > 0 {
- if err := json.Unmarshal(openapis.Configuration.RawMessage, &traits); err != nil {
- return err
- }
+ // OpenAPI trait
+ openapi, err := toPropertyMap(it.Spec.Traits.OpenAPI)
+ if err != nil {
+ return err
}
- for k, v := range traits {
- for _, cn := range v {
- if k == "configmaps" {
- configmaps = append(configmaps, cn)
- }
+ for k, v := range openapi {
+ if k != "configmaps" {
+ continue
}
- }
-
- // Kamelet trait
- kameletTrait := it.Spec.Traits.Kamelets
- var kameletListTrait map[string]string
- if len(kameletTrait.Configuration.RawMessage) > 0 {
- if err := json.Unmarshal(kameletTrait.Configuration.RawMessage, &kameletListTrait); err != nil {
- return err
+ if list, ok := v.([]string); ok {
+ configmaps = append(configmaps, list...)
+ break
}
+ }
- kamelets = strings.Split(kameletListTrait["list"], ",")
+ // Kamelets trait
+ kamelet, err := toPropertyMap(it.Spec.Traits.Kamelets)
+ if err != nil {
+ return err
+ }
+ if list, ok := kamelet["list"].(string); ok {
+ kamelets = strings.Split(list, ",")
}
sourceKamelets, err := o.listKamelets(c, it)
if err != nil {
@@ -297,6 +299,19 @@ func (o *promoteCmdOptions) validateDestResources(c client.Client, it *v1.Integr
return nil
}
+func toPropertyMap(src interface{}) (map[string]interface{}, error) {
+ propMap, err := trait.ToPropertyMap(src)
+ if err != nil {
+ return nil, err
+ }
+ // Migrate legacy configuration properties before promoting
+ if err := trait.MigrateLegacyConfiguration(propMap); err != nil {
+ return nil, err
+ }
+
+ return propMap, nil
+}
+
func (o *promoteCmdOptions) listKamelets(c client.Client, it *v1.Integration) ([]string, error) {
catalog, err := camel.DefaultCatalog()
if err != nil {
diff --git a/pkg/cmd/run_test.go b/pkg/cmd/run_test.go
index d826e2338..4e1fc28a2 100644
--- a/pkg/cmd/run_test.go
+++ b/pkg/cmd/run_test.go
@@ -373,9 +373,9 @@ func TestConfigureTraits(t *testing.T) {
err = configureTraits(runCmdOptions.Traits, &traits, catalog)
assert.Nil(t, err)
- traitsMap, err := trait.ToMap(traits)
+ traitMap, err := trait.ToTraitMap(traits)
assert.Nil(t, err)
- assert.Len(t, traitsMap, 5)
+ assert.Len(t, traitMap, 5)
assertTraitConfiguration(t, traits.Affinity, &traitv1.AffinityTrait{PodAffinity: pointer.Bool(false)})
assertTraitConfiguration(t, traits.Container, &traitv1.ContainerTrait{DeprecatedProbesEnabled: pointer.Bool(false)})
assertTraitConfiguration(t, traits.Environment, &traitv1.EnvironmentTrait{ContainerMeta: pointer.Bool(false)})
diff --git a/pkg/controller/integration/kits.go b/pkg/controller/integration/kits.go
index 2f029b037..06aa5fcf6 100644
--- a/pkg/controller/integration/kits.go
+++ b/pkg/controller/integration/kits.go
@@ -161,11 +161,11 @@ func kitMatches(kit1 *v1.IntegrationKit, kit2 *v1.IntegrationKit) (bool, error)
}
func hasMatchingTraits(traits interface{}, kitTraits interface{}) (bool, error) {
- traitsMap, err := trait.ToMap(traits)
+ traitMap, err := trait.ToTraitMap(traits)
if err != nil {
return false, err
}
- kitTraitsMap, err := trait.ToMap(kitTraits)
+ kitTraitMap, err := trait.ToTraitMap(kitTraits)
if err != nil {
return false, err
}
@@ -177,8 +177,8 @@ func hasMatchingTraits(traits interface{}, kitTraits interface{}) (bool, error)
continue
}
id := string(t.ID())
- it, ok1 := findTrait(traitsMap, id)
- kt, ok2 := findTrait(kitTraitsMap, id)
+ it, ok1 := findTrait(traitMap, id)
+ kt, ok2 := findTrait(kitTraitMap, id)
if !ok1 && !ok2 {
continue
diff --git a/pkg/trait/trait_configure.go b/pkg/trait/trait_configure.go
index 94ae5578f..658449b54 100644
--- a/pkg/trait/trait_configure.go
+++ b/pkg/trait/trait_configure.go
@@ -61,13 +61,15 @@ func (c *Catalog) Configure(env *Environment) error {
}
func (c *Catalog) configureTraits(traits interface{}) error {
- traitsMap, err := ToMap(traits)
+ traitMap, err := ToTraitMap(traits)
if err != nil {
return err
}
- for id, trait := range traitsMap {
+ for id, trait := range traitMap {
if id == "addons" {
+ // Handle addons later so that the configurations on the new API
+ // take precedence over the legacy addon configurations
continue
}
if err := c.configureTrait(id, trait); err != nil {
@@ -75,7 +77,7 @@ func (c *Catalog) configureTraits(traits interface{}) error {
}
}
// Addons
- for id, trait := range traitsMap["addons"] {
+ for id, trait := range traitMap["addons"] {
if addons, ok := trait.(map[string]interface{}); ok {
if err := c.configureTrait(id, addons); err != nil {
return err
@@ -88,7 +90,7 @@ func (c *Catalog) configureTraits(traits interface{}) error {
func (c *Catalog) configureTrait(id string, trait map[string]interface{}) error {
if catTrait := c.GetTrait(id); catTrait != nil {
- if err := decodeTrait(trait, catTrait, true); err != nil {
+ if err := decodeTrait(trait, catTrait); err != nil {
return err
}
}
@@ -96,21 +98,10 @@ func (c *Catalog) configureTrait(id string, trait map[string]interface{}) error
return nil
}
-func decodeTrait(in map[string]interface{}, target Trait, root bool) error {
- // decode legacy configuration first if it exists
- if root && in["configuration"] != nil {
- if config, ok := in["configuration"].(map[string]interface{}); ok {
- // for traits that had the same property name "configuration",
- // it needs to be renamed to "config" to avoid naming conflicts
- // (e.g. Knative trait).
- if config["configuration"] != nil {
- config["config"] = config["configuration"]
- }
-
- if err := decodeTrait(config, target, false); err != nil {
- return err
- }
- }
+func decodeTrait(in map[string]interface{}, target Trait) error {
+ // Migrate legacy configuration properties before applying to catalog
+ if err := MigrateLegacyConfiguration(in); err != nil {
+ return err
}
data, err := json.Marshal(&in)
diff --git a/pkg/trait/trait_configure_test.go b/pkg/trait/trait_configure_test.go
index 2c106fa39..ad4d7020b 100644
--- a/pkg/trait/trait_configure_test.go
+++ b/pkg/trait/trait_configure_test.go
@@ -223,7 +223,7 @@ func TestTraitDecode(t *testing.T) {
target, ok := newContainerTrait().(*containerTrait)
require.True(t, ok)
- err := decodeTrait(trait, target, true)
+ err := decodeTrait(trait, target)
require.NoError(t, err)
assert.Equal(t, false, pointer.BoolDeref(target.Enabled, true))
diff --git a/pkg/trait/util.go b/pkg/trait/util.go
index ef7b9ec31..c1310ec6e 100644
--- a/pkg/trait/util.go
+++ b/pkg/trait/util.go
@@ -236,8 +236,8 @@ func AssertTraitsType(traits interface{}) error {
return nil
}
-// ToMap accepts either v1.Traits or v1.IntegrationKitTraits and converts it to a map.
-func ToMap(traits interface{}) (map[string]map[string]interface{}, error) {
+// ToTraitMap accepts either v1.Traits or v1.IntegrationKitTraits and converts it to a map of traits.
+func ToTraitMap(traits interface{}) (map[string]map[string]interface{}, error) {
if err := AssertTraitsType(traits); err != nil {
return nil, err
}
@@ -246,12 +246,56 @@ func ToMap(traits interface{}) (map[string]map[string]interface{}, error) {
if err != nil {
return nil, err
}
- traitsMap := make(map[string]map[string]interface{})
- if err = json.Unmarshal(data, &traitsMap); err != nil {
+ traitMap := make(map[string]map[string]interface{})
+ if err = json.Unmarshal(data, &traitMap); err != nil {
return nil, err
}
- return traitsMap, nil
+ return traitMap, nil
+}
+
+// ToPropertyMap accepts a trait and converts it to a map of trait properties.
+func ToPropertyMap(trait interface{}) (map[string]interface{}, error) {
+ data, err := json.Marshal(trait)
+ if err != nil {
+ return nil, err
+ }
+ propMap := make(map[string]interface{})
+ if err = json.Unmarshal(data, &propMap); err != nil {
+ return nil, err
+ }
+
+ return propMap, nil
+}
+
+// MigrateLegacyConfiguration moves up the legacy configuration in a trait to the new top-level properties.
+// Values of the new properties always take precedence over the ones from the legacy configuration
+// with the same property names.
+func MigrateLegacyConfiguration(trait map[string]interface{}) error {
+ if trait["configuration"] == nil {
+ return nil
+ }
+
+ if config, ok := trait["configuration"].(map[string]interface{}); ok {
+ // For traits that had the same property name "configuration",
+ // the property needs to be renamed to "config" to avoid naming conflicts
+ // (e.g. Knative trait).
+ if config["configuration"] != nil {
+ config["config"] = config["configuration"]
+ delete(config, "configuration")
+ }
+
+ for k, v := range config {
+ if trait[k] == nil {
+ trait[k] = v
+ }
+ }
+ delete(trait, "configuration")
+ } else {
+ return errors.Errorf(`unexpected type for "configuration" field: %v`, reflect.TypeOf(trait["configuration"]))
+ }
+
+ return nil
}
// ToTrait unmarshals a map configuration to a target trait.
diff --git a/pkg/trait/util_test.go b/pkg/trait/util_test.go
index 3a56bf029..c44a3e26b 100644
--- a/pkg/trait/util_test.go
+++ b/pkg/trait/util_test.go
@@ -28,11 +28,15 @@ import (
"github.com/stretchr/testify/assert"
)
-func TestToMap(t *testing.T) {
+func TestToTraitMap(t *testing.T) {
traits := v1.Traits{
Container: &traitv1.ContainerTrait{
Trait: traitv1.Trait{
Enabled: pointer.Bool(true),
+ Configuration: configurationFromMap(t, map[string]interface{}{
+ "name": "test-container",
+ "port": 8082,
+ }),
},
Auto: pointer.Bool(false),
Expose: pointer.Bool(true),
@@ -61,6 +65,10 @@ func TestToMap(t *testing.T) {
"portName": "http-8081",
"servicePort": float64(81),
"servicePortName": "http-81",
+ "configuration": map[string]interface{}{
+ "name": "test-container",
+ "port": float64(8082),
+ },
},
"service": {
"enabled": true,
@@ -72,12 +80,91 @@ func TestToMap(t *testing.T) {
},
}
- traitMap, err := ToMap(traits)
+ traitMap, err := ToTraitMap(traits)
assert.NoError(t, err)
assert.Equal(t, expected, traitMap)
}
+func TestToPropertyMap(t *testing.T) {
+ trait := traitv1.ContainerTrait{
+ Trait: traitv1.Trait{
+ Enabled: pointer.Bool(true),
+ Configuration: configurationFromMap(t, map[string]interface{}{
+ "name": "test-container",
+ "port": 8082,
+ }),
+ },
+ Auto: pointer.Bool(false),
+ Expose: pointer.Bool(true),
+ Port: 8081,
+ PortName: "http-8081",
+ ServicePort: 81,
+ ServicePortName: "http-81",
+ }
+ expected := map[string]interface{}{
+ "enabled": true,
+ "auto": false,
+ "expose": true,
+ "port": float64(8081),
+ "portName": "http-8081",
+ "servicePort": float64(81),
+ "servicePortName": "http-81",
+ "configuration": map[string]interface{}{
+ "name": "test-container",
+ "port": float64(8082),
+ },
+ }
+
+ propMap, err := ToPropertyMap(trait)
+
+ assert.NoError(t, err)
+ assert.Equal(t, expected, propMap)
+}
+
+func TestMigrateLegacyConfiguration(t *testing.T) {
+ trait := map[string]interface{}{
+ "enabled": true,
+ "auto": false,
+ "port": float64(8081),
+ "portName": "http-8081",
+ "servicePortName": "http-81",
+ "configuration": map[string]interface{}{
+ "auto": true,
+ "expose": true,
+ "name": "test-container",
+ "port": float64(8082),
+ "servicePort": float64(81),
+ },
+ }
+ expected := map[string]interface{}{
+ "enabled": true,
+ "auto": false,
+ "port": float64(8081),
+ "portName": "http-8081",
+ "servicePortName": "http-81",
+ "expose": true,
+ "name": "test-container",
+ "servicePort": float64(81),
+ }
+
+ err := MigrateLegacyConfiguration(trait)
+
+ assert.NoError(t, err)
+ assert.Equal(t, expected, trait)
+}
+
+func TestMigrateLegacyConfiguration_invalidConfiguration(t *testing.T) {
+ trait := map[string]interface{}{
+ "enabled": true,
+ "configuration": "It should not be a string!",
+ }
+
+ err := MigrateLegacyConfiguration(trait)
+
+ assert.Error(t, err)
+}
+
func TestToTrait(t *testing.T) {
config := map[string]interface{}{
"enabled": true,
@@ -87,10 +174,18 @@ func TestToTrait(t *testing.T) {
"portName": "http-8081",
"servicePort": 81,
"servicePortName": "http-81",
+ "configuration": map[string]interface{}{
+ "name": "test-container",
+ "port": float64(8082),
+ },
}
expected := traitv1.ContainerTrait{
Trait: traitv1.Trait{
Enabled: pointer.Bool(true),
+ Configuration: configurationFromMap(t, map[string]interface{}{
+ "name": "test-container",
+ "port": 8082,
+ }),
},
Auto: pointer.Bool(false),
Expose: pointer.Bool(true),
[camel-k] 04/14: fix(api): restore TraitSpec/Configuration for backward compatibility
Posted by ts...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tsato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 2dbdaf4a1fe9890e9eac6fd504e629db86208d30
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Tue Jun 28 13:01:25 2022 +0900
fix(api): restore TraitSpec/Configuration for backward compatibility
---
e2e/global/common/secondary_platform_test.go | 14 +-
e2e/support/test_support.go | 6 +-
go.mod | 2 +-
go.sum | 3 +-
pkg/apis/camel/v1/common_types.go | 25 ++++
pkg/apis/camel/v1/trait/base.go | 12 ++
pkg/apis/camel/v1/trait/{base.go => support.go} | 27 +++-
pkg/cmd/promote.go | 176 +++++++++---------------
pkg/cmd/promote_test.go | 60 --------
pkg/trait/test_support.go | 32 +++++
pkg/trait/trait_configure.go | 16 ++-
pkg/trait/trait_configure_test.go | 26 ++++
pkg/trait/trait_test.go | 18 ---
script/Makefile | 3 +
14 files changed, 216 insertions(+), 204 deletions(-)
diff --git a/e2e/global/common/secondary_platform_test.go b/e2e/global/common/secondary_platform_test.go
index ad2cd1c9b..665262737 100644
--- a/e2e/global/common/secondary_platform_test.go
+++ b/e2e/global/common/secondary_platform_test.go
@@ -31,6 +31,7 @@ import (
. "github.com/apache/camel-k/e2e/support"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
)
func TestSecondaryPlatform(t *testing.T) {
@@ -38,13 +39,12 @@ func TestSecondaryPlatform(t *testing.T) {
Expect(KamelInstall(ns).Execute()).To(Succeed())
Expect(ConfigureSecondayPlatfromWith(ns, func(p *v1.IntegrationPlatform) {
p.Name = "secondary"
- if p.Spec.Traits == nil {
- p.Spec.Traits = make(map[string]v1.TraitSpec)
- }
- p.Spec.Traits["container"] = v1.TraitSpec{
- Configuration: AsTraitConfiguration(map[string]string{
- "limitCPU": "0.1",
- }),
+ p.Spec.Traits.Container = &traitv1.ContainerTrait{
+ Trait: traitv1.Trait{
+ Configuration: AsTraitConfiguration(map[string]string{
+ "limitCPU": "0.1",
+ }),
+ },
}
})).To(Succeed())
diff --git a/e2e/support/test_support.go b/e2e/support/test_support.go
index cec5e580b..08f9d7455 100644
--- a/e2e/support/test_support.go
+++ b/e2e/support/test_support.go
@@ -71,6 +71,7 @@ import (
"github.com/apache/camel-k/e2e/support/util"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
"github.com/apache/camel-k/pkg/client"
"github.com/apache/camel-k/pkg/cmd"
@@ -1764,12 +1765,13 @@ func asEndpointProperties(props map[string]string) *v1alpha1.EndpointProperties
}
}
-func AsTraitConfiguration(props map[string]string) v1.TraitConfiguration {
+// nolint: staticcheck
+func AsTraitConfiguration(props map[string]string) *traitv1.Configuration {
bytes, err := json.Marshal(props)
if err != nil {
failTest(err)
}
- return v1.TraitConfiguration{
+ return &traitv1.Configuration{
RawMessage: bytes,
}
}
diff --git a/go.mod b/go.mod
index 4ee008a89..c28f89e8b 100644
--- a/go.mod
+++ b/go.mod
@@ -57,7 +57,7 @@ require (
k8s.io/gengo v0.0.0-20211129171323-c02415ce4185
k8s.io/klog/v2 v2.40.1
k8s.io/kubectl v0.22.5
- k8s.io/utils v0.0.0-20211208161948-7d6a63dca704
+ k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9
knative.dev/eventing v0.29.0
knative.dev/pkg v0.0.0-20220118160532-77555ea48cd4
knative.dev/serving v0.29.0
diff --git a/go.sum b/go.sum
index 5bc79daf9..9783c2877 100644
--- a/go.sum
+++ b/go.sum
@@ -2134,8 +2134,9 @@ k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
-k8s.io/utils v0.0.0-20211208161948-7d6a63dca704 h1:ZKMMxTvduyf5WUtREOqg5LiXaN1KO/+0oOQPRFrClpo=
k8s.io/utils v0.0.0-20211208161948-7d6a63dca704/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
+k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc=
+k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
knative.dev/caching v0.0.0-20220118175933-0c1cc094a7f4/go.mod h1:OHsK3XaWmdi2/mPaNBiX8LbefbtM6TptnT90eVbYGSA=
knative.dev/eventing v0.29.0 h1:+AhcYEuuz37x1op71bknZ/lFgsvuZJl0AKFOOFiH03s=
knative.dev/eventing v0.29.0/go.mod h1:u5T5NZTDUsLR7yJwp5MDnBnDX5MhywD3yK3Rq+7gTtI=
diff --git a/pkg/apis/camel/v1/common_types.go b/pkg/apis/camel/v1/common_types.go
index 83d95c93e..12a4122d7 100644
--- a/pkg/apis/camel/v1/common_types.go
+++ b/pkg/apis/camel/v1/common_types.go
@@ -173,6 +173,31 @@ type Traits struct {
ServiceBinding *trait.ServiceBindingTrait `property:"service-binding" json:"service-binding,omitempty"`
// The configuration of Toleration trait
Toleration *trait.TolerationTrait `property:"toleration" json:"toleration,omitempty"`
+
+ // Deprecated: for backward compatibility.
+ Keda *TraitSpec `property:"keda" json:"keda,omitempty"`
+ // Deprecated: for backward compatibility.
+ Master *TraitSpec `property:"master" json:"master,omitempty"`
+ // Deprecated: for backward compatibility.
+ Strimzi *TraitSpec `property:"strimzi" json:"strimzi,omitempty"`
+ // Deprecated: for backward compatibility.
+ ThreeScale *TraitSpec `property:"3scale" json:"3scale,omitempty"`
+ // Deprecated: for backward compatibility.
+ Tracing *TraitSpec `property:"tracing" json:"tracing,omitempty"`
+}
+
+// A TraitSpec contains the configuration of a trait
+// Deprecated: superceded by each Trait type, left for backward compatibility.
+type TraitSpec struct {
+ // TraitConfiguration parameters configuration
+ Configuration TraitConfiguration `json:"configuration"`
+}
+
+// TraitConfiguration represents the expected configuration for a given trait parameter
+// Deprecated: superceded by each Trait type, left for backward compatibility.
+type TraitConfiguration struct {
+ // generic raw message, typically a map containing the keys (trait parameters) and the values (either single text or array)
+ RawMessage `json:",inline"`
}
// +kubebuilder:validation:Type=object
diff --git a/pkg/apis/camel/v1/trait/base.go b/pkg/apis/camel/v1/trait/base.go
index 863d17a2f..5117e1ac9 100644
--- a/pkg/apis/camel/v1/trait/base.go
+++ b/pkg/apis/camel/v1/trait/base.go
@@ -21,4 +21,16 @@ package trait
type Trait struct {
// Can be used to enable or disable a trait. All traits share this common property.
Enabled *bool `property:"enabled" json:"enabled,omitempty"`
+
+ // Legacy trait configuration parameters.
+ // Deprecated: for backward compatibility.
+ Configuration *Configuration `json:"configuration,omitempty"`
+}
+
+// Deprecated: for backward compatibility.
+type Configuration struct {
+ RawMessage `json:",inline"`
}
+
+// Deprecated: for backward compatibility.
+type RawMessage []byte
diff --git a/pkg/apis/camel/v1/trait/base.go b/pkg/apis/camel/v1/trait/support.go
similarity index 59%
copy from pkg/apis/camel/v1/trait/base.go
copy to pkg/apis/camel/v1/trait/support.go
index 863d17a2f..027fdc700 100644
--- a/pkg/apis/camel/v1/trait/base.go
+++ b/pkg/apis/camel/v1/trait/support.go
@@ -17,8 +17,27 @@ limitations under the License.
package trait
-// Base type for all traits.
-type Trait struct {
- // Can be used to enable or disable a trait. All traits share this common property.
- Enabled *bool `property:"enabled" json:"enabled,omitempty"`
+import (
+ "encoding/json"
+ "errors"
+)
+
+// MarshalJSON returns m as the JSON encoding of m.
+func (m RawMessage) MarshalJSON() ([]byte, error) {
+ if m == nil {
+ return []byte("null"), nil
+ }
+ return m, nil
+}
+
+// UnmarshalJSON sets *m to a copy of data.
+func (m *RawMessage) UnmarshalJSON(data []byte) error {
+ if m == nil {
+ return errors.New("json.RawMessage: UnmarshalJSON on nil pointer")
+ }
+ *m = append((*m)[0:0], data...)
+ return nil
}
+
+var _ json.Marshaler = (*RawMessage)(nil)
+var _ json.Unmarshaler = (*RawMessage)(nil)
diff --git a/pkg/cmd/promote.go b/pkg/cmd/promote.go
index c1fb1f3e4..db9159475 100644
--- a/pkg/cmd/promote.go
+++ b/pkg/cmd/promote.go
@@ -27,6 +27,7 @@ import (
"github.com/pkg/errors"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
"github.com/apache/camel-k/pkg/client"
"github.com/apache/camel-k/pkg/util/camel"
@@ -123,20 +124,12 @@ func (o *promoteCmdOptions) run(cmd *cobra.Command, args []string) error {
}
if promoteKameletBinding {
// KameletBinding promotion
- destKameletBinding, err := o.editKameletBinding(sourceKameletBinding, sourceIntegration)
- if err != nil {
- return errors.Wrap(err, "could not edit KameletBinding "+name)
- }
+ destKameletBinding := o.editKameletBinding(sourceKameletBinding, sourceIntegration)
return c.Create(o.Context, destKameletBinding)
}
// Plain Integration promotion
- destIntegration, err := o.editIntegration(sourceIntegration)
- if err != nil {
- if err != nil {
- return errors.Wrap(err, "could not edit Integration "+name)
- }
- }
+ destIntegration := o.editIntegration(sourceIntegration)
// Ensure the destination namespace has access to the source namespace images
err = addSystemPullerRoleBinding(o.Context, c, sourceIntegration.Namespace, destIntegration.Namespace)
@@ -194,82 +187,76 @@ func (o *promoteCmdOptions) validateDestResources(c client.Client, it *v1.Integr
var pvcs []string
var kamelets []string
- if it.Spec.Traits != nil {
- // Mount trait
- mounts := it.Spec.Traits["mount"]
- if err := json.Unmarshal(mounts.Configuration.RawMessage, &traits); err != nil {
- return err
- }
- for t, v := range traits {
- switch t {
- case "configs":
- for _, cn := range v {
- if conf, parseErr := resource.ParseConfig(cn); parseErr == nil {
- if conf.StorageType() == resource.StorageTypeConfigmap {
- configmaps = append(configmaps, conf.Name())
- } else if conf.StorageType() == resource.StorageTypeSecret {
- secrets = append(secrets, conf.Name())
- }
- } else {
- return parseErr
+ // Mount trait
+ mounts := it.Spec.Traits.Mount
+ if err := json.Unmarshal(mounts.Configuration.RawMessage, &traits); err != nil {
+ return err
+ }
+ for t, v := range traits {
+ switch t {
+ case "configs":
+ for _, cn := range v {
+ if conf, parseErr := resource.ParseConfig(cn); parseErr == nil {
+ if conf.StorageType() == resource.StorageTypeConfigmap {
+ configmaps = append(configmaps, conf.Name())
+ } else if conf.StorageType() == resource.StorageTypeSecret {
+ secrets = append(secrets, conf.Name())
}
+ } else {
+ return parseErr
}
- case "resources":
- for _, cn := range v {
- if conf, parseErr := resource.ParseResource(cn); parseErr == nil {
- if conf.StorageType() == resource.StorageTypeConfigmap {
- configmaps = append(configmaps, conf.Name())
- } else if conf.StorageType() == resource.StorageTypeSecret {
- secrets = append(secrets, conf.Name())
- }
- } else {
- return parseErr
+ }
+ case "resources":
+ for _, cn := range v {
+ if conf, parseErr := resource.ParseResource(cn); parseErr == nil {
+ if conf.StorageType() == resource.StorageTypeConfigmap {
+ configmaps = append(configmaps, conf.Name())
+ } else if conf.StorageType() == resource.StorageTypeSecret {
+ secrets = append(secrets, conf.Name())
}
+ } else {
+ return parseErr
}
- case "volumes":
- for _, cn := range v {
- if conf, parseErr := resource.ParseVolume(cn); parseErr == nil {
- if conf.StorageType() == resource.StorageTypePVC {
- pvcs = append(pvcs, conf.Name())
- }
- } else {
- return parseErr
+ }
+ case "volumes":
+ for _, cn := range v {
+ if conf, parseErr := resource.ParseVolume(cn); parseErr == nil {
+ if conf.StorageType() == resource.StorageTypePVC {
+ pvcs = append(pvcs, conf.Name())
}
+ } else {
+ return parseErr
}
}
}
+ }
- // Openapi trait
- openapis := it.Spec.Traits["openapi"]
-
- traits = map[string][]string{}
- if len(openapis.Configuration.RawMessage) > 0 {
- if err := json.Unmarshal(openapis.Configuration.RawMessage, &traits); err != nil {
- return err
- }
+ // Openapi trait
+ openapis := it.Spec.Traits.OpenAPI
+ traits = map[string][]string{}
+ if len(openapis.Configuration.RawMessage) > 0 {
+ if err := json.Unmarshal(openapis.Configuration.RawMessage, &traits); err != nil {
+ return err
}
-
- for k, v := range traits {
- for _, cn := range v {
- if k == "configmaps" {
- configmaps = append(configmaps, cn)
- }
+ }
+ for k, v := range traits {
+ for _, cn := range v {
+ if k == "configmaps" {
+ configmaps = append(configmaps, cn)
}
}
+ }
- // Kamelet trait
- kameletTrait := it.Spec.Traits["kamelets"]
- var kameletListTrait map[string]string
-
- if len(kameletTrait.Configuration.RawMessage) > 0 {
- if err := json.Unmarshal(kameletTrait.Configuration.RawMessage, &kameletListTrait); err != nil {
- return err
- }
-
- kamelets = strings.Split(kameletListTrait["list"], ",")
+ // Kamelet trait
+ kameletTrait := it.Spec.Traits.Kamelets
+ var kameletListTrait map[string]string
+ if len(kameletTrait.Configuration.RawMessage) > 0 {
+ if err := json.Unmarshal(kameletTrait.Configuration.RawMessage, &kameletListTrait); err != nil {
+ return err
}
- } // end of it.Spec.Traits != nil
+ kamelets = strings.Split(kameletListTrait["list"], ",")
+ }
sourceKamelets, err := o.listKamelets(c, it)
if err != nil {
return err
@@ -391,30 +378,28 @@ func existsKamelet(ctx context.Context, c client.Client, name string, namespace
return true
}
-func (o *promoteCmdOptions) editIntegration(it *v1.Integration) (*v1.Integration, error) {
+func (o *promoteCmdOptions) editIntegration(it *v1.Integration) *v1.Integration {
dst := v1.NewIntegration(o.To, it.Name)
contImage := it.Status.Image
dst.Spec = *it.Spec.DeepCopy()
- if dst.Spec.Traits == nil {
- dst.Spec.Traits = map[string]v1.TraitSpec{}
+ if dst.Spec.Traits.Container == nil {
+ dst.Spec.Traits.Container = &traitv1.ContainerTrait{}
}
- editedContTrait, err := editContainerImage(dst.Spec.Traits["container"], contImage)
- dst.Spec.Traits["container"] = editedContTrait
- return &dst, err
+ dst.Spec.Traits.Container.Image = contImage
+ return &dst
}
-func (o *promoteCmdOptions) editKameletBinding(kb *v1alpha1.KameletBinding, it *v1.Integration) (*v1alpha1.KameletBinding, error) {
+func (o *promoteCmdOptions) editKameletBinding(kb *v1alpha1.KameletBinding, it *v1.Integration) *v1alpha1.KameletBinding {
dst := v1alpha1.NewKameletBinding(o.To, kb.Name)
dst.Spec = *kb.Spec.DeepCopy()
contImage := it.Status.Image
if dst.Spec.Integration == nil {
dst.Spec.Integration = &v1.IntegrationSpec{}
}
- if dst.Spec.Integration.Traits == nil {
- dst.Spec.Integration.Traits = map[string]v1.TraitSpec{}
+ if dst.Spec.Integration.Traits.Container == nil {
+ dst.Spec.Integration.Traits.Container = &traitv1.ContainerTrait{}
}
- editedContTrait, err := editContainerImage(dst.Spec.Integration.Traits["container"], contImage)
- dst.Spec.Integration.Traits["container"] = editedContTrait
+ dst.Spec.Integration.Traits.Container.Image = contImage
if dst.Spec.Source.Ref != nil {
dst.Spec.Source.Ref.Namespace = o.To
}
@@ -428,32 +413,7 @@ func (o *promoteCmdOptions) editKameletBinding(kb *v1alpha1.KameletBinding, it *
}
}
}
- return &dst, err
-}
-
-func editContainerImage(contTrait v1.TraitSpec, image string) (v1.TraitSpec, error) {
- var editedTrait v1.TraitSpec
- m := make(map[string]map[string]interface{})
- data, err := json.Marshal(contTrait)
- if err != nil {
- return editedTrait, err
- }
- err = json.Unmarshal(data, &m)
- if err != nil {
- return editedTrait, err
- }
- // We must initialize, if it was not initialized so far
- if m["configuration"] == nil {
- m["configuration"] = make(map[string]interface{})
- }
- m["configuration"]["image"] = image
- newData, err := json.Marshal(m)
- if err != nil {
- return editedTrait, err
- }
- err = json.Unmarshal(newData, &editedTrait)
-
- return editedTrait, err
+ return &dst
}
//
diff --git a/pkg/cmd/promote_test.go b/pkg/cmd/promote_test.go
deleted file mode 100644
index 3fe2331b5..000000000
--- a/pkg/cmd/promote_test.go
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package cmd
-
-import (
- "encoding/json"
- "testing"
-
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
- "github.com/stretchr/testify/assert"
-)
-
-func TestEditContainerTrait(t *testing.T) {
- var containerTrait v1.TraitSpec
- m := make(map[string]interface{})
- m["configuration"] = map[string]interface{}{
- "name": "myName",
- "image": "myImage",
- }
- data, _ := json.Marshal(m)
- _ = json.Unmarshal(data, &containerTrait)
-
- editedContainerTrait, err := editContainerImage(containerTrait, "editedImage")
- assert.Nil(t, err)
-
- mappedTrait := make(map[string]map[string]interface{})
- newData, _ := json.Marshal(editedContainerTrait)
- _ = json.Unmarshal(newData, &mappedTrait)
-
- assert.Equal(t, "myName", mappedTrait["configuration"]["name"])
- assert.Equal(t, "editedImage", mappedTrait["configuration"]["image"])
-}
-
-func TestEditMissingContainerTrait(t *testing.T) {
- var containerTrait v1.TraitSpec
-
- editedContainerTrait, err := editContainerImage(containerTrait, "editedImage")
- assert.Nil(t, err)
-
- mappedTrait := make(map[string]map[string]interface{})
- newData, _ := json.Marshal(editedContainerTrait)
- _ = json.Unmarshal(newData, &mappedTrait)
-
- assert.Equal(t, "editedImage", mappedTrait["configuration"]["image"])
-}
diff --git a/pkg/trait/test_support.go b/pkg/trait/test_support.go
index 31d77adc6..5dd0aafb9 100644
--- a/pkg/trait/test_support.go
+++ b/pkg/trait/test_support.go
@@ -18,6 +18,9 @@ limitations under the License.
package trait
import (
+ "encoding/json"
+ "testing"
+
serving "knative.dev/serving/pkg/apis/serving/v1"
appsv1 "k8s.io/api/apps/v1"
@@ -26,7 +29,10 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util/kubernetes"
+
+ "github.com/stretchr/testify/require"
)
func createNominalDeploymentTraitTest() (*Environment, *appsv1.Deployment) {
@@ -115,3 +121,29 @@ func createNominalCronJobTraitTest() (*Environment, *batchv1.CronJob) {
return environment, cronJob
}
+
+// nolint: staticcheck
+func configurationFromMap(t *testing.T, configMap map[string]interface{}) *traitv1.Configuration {
+ t.Helper()
+
+ data, err := json.Marshal(configMap)
+ require.NoError(t, err)
+
+ return &traitv1.Configuration{
+ RawMessage: data,
+ }
+}
+
+func traitToMap(t *testing.T, trait interface{}) map[string]interface{} {
+ t.Helper()
+
+ traitMap := make(map[string]interface{})
+
+ data, err := json.Marshal(trait)
+ require.NoError(t, err)
+
+ err = json.Unmarshal(data, &traitMap)
+ require.NoError(t, err)
+
+ return traitMap
+}
diff --git a/pkg/trait/trait_configure.go b/pkg/trait/trait_configure.go
index fb442b28e..fe0287a69 100644
--- a/pkg/trait/trait_configure.go
+++ b/pkg/trait/trait_configure.go
@@ -30,6 +30,7 @@ import (
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
)
+// configure reads trait configurations from environment and applies them to catalog.
func (c *Catalog) configure(env *Environment) error {
if env.Platform != nil {
if err := c.configureTraits(env.Platform.Status.Traits); err != nil {
@@ -68,7 +69,7 @@ func (c *Catalog) configureTraits(traits interface{}) error {
for id, trait := range traitsMap {
t := trait // Avoid G601: Implicit memory aliasing in for loop
if catTrait := c.GetTrait(id); catTrait != nil {
- if err := decodeTraitSpec(&t, catTrait); err != nil {
+ if err := decodeTrait(t, catTrait, true); err != nil {
return err
}
}
@@ -77,13 +78,22 @@ func (c *Catalog) configureTraits(traits interface{}) error {
return nil
}
-func decodeTraitSpec(in interface{}, target interface{}) error {
+func decodeTrait(in map[string]interface{}, target Trait, root bool) error {
+ // decode legacy configuration first if it exists
+ if root && in["configuration"] != nil {
+ if config, ok := in["configuration"].(map[string]interface{}); ok {
+ if err := decodeTrait(config, target, false); err != nil {
+ return err
+ }
+ }
+ }
+
data, err := json.Marshal(&in)
if err != nil {
return err
}
- return json.Unmarshal(data, &target)
+ return json.Unmarshal(data, target)
}
func (c *Catalog) configureTraitsFromAnnotations(annotations map[string]string) error {
diff --git a/pkg/trait/trait_configure_test.go b/pkg/trait/trait_configure_test.go
index 00c374955..125ddd42b 100644
--- a/pkg/trait/trait_configure_test.go
+++ b/pkg/trait/trait_configure_test.go
@@ -21,6 +21,7 @@ import (
"testing"
"github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/pointer"
@@ -170,3 +171,28 @@ func TestTraitSplitConfiguration(t *testing.T) {
assert.NoError(t, c.configure(&env))
assert.Equal(t, []string{"opt1", "opt2"}, c.GetTrait("owner").(*ownerTrait).TargetLabels)
}
+
+func TestTraitDecode(t *testing.T) {
+ trait := traitToMap(t, traitv1.ContainerTrait{
+ Trait: traitv1.Trait{
+ Enabled: pointer.Bool(false),
+ Configuration: configurationFromMap(t, map[string]interface{}{
+ "name": "test-container",
+ "port": 8081,
+ }),
+ },
+ Port: 7071,
+ Auto: pointer.Bool(false),
+ })
+
+ target, ok := newContainerTrait().(*containerTrait)
+ require.True(t, ok)
+ err := decodeTrait(trait, target, true)
+ require.NoError(t, err)
+
+ assert.Equal(t, false, pointer.BoolDeref(target.Enabled, true))
+ assert.Equal(t, "test-container", target.Name)
+ // legacy configuration should not override a value in new API field
+ assert.Equal(t, 7071, target.Port)
+ assert.Equal(t, false, pointer.BoolDeref(target.Auto, true))
+}
diff --git a/pkg/trait/trait_test.go b/pkg/trait/trait_test.go
index efc7aa9fc..b55b43eba 100644
--- a/pkg/trait/trait_test.go
+++ b/pkg/trait/trait_test.go
@@ -136,24 +136,6 @@ func TestKubernetesTraitsWithWeb(t *testing.T) {
}))
}
-func TestTraitDecode(t *testing.T) {
- trait := traitv1.ContainerTrait{
- Trait: traitv1.Trait{
- Enabled: pointer.Bool(false),
- },
- Port: 7071,
- Auto: pointer.Bool(true),
- }
-
- ctr, _ := newContainerTrait().(*containerTrait)
- err := decodeTraitSpec(&trait, ctr)
-
- assert.Nil(t, err)
- assert.Equal(t, 7071, ctr.Port)
- assert.NotNil(t, ctr.Enabled)
- assert.Equal(t, false, *ctr.Enabled)
-}
-
func TestTraitHierarchyDecode(t *testing.T) {
env := createTestEnv(t, v1.IntegrationPlatformClusterOpenShift, "")
diff --git a/script/Makefile b/script/Makefile
index d2b1509c5..2ffbee1e2 100644
--- a/script/Makefile
+++ b/script/Makefile
@@ -326,6 +326,9 @@ clean:
dep:
go mod tidy
+ cd pkg/apis/camel && go mod tidy
+ cd pkg/client/camel && go mod tidy
+ cd pkg/kamelet/repository && go mod tidy
lint:
GOGC=$(LINT_GOGC) golangci-lint run --config .golangci.yml --out-format tab --deadline $(LINT_DEADLINE) --verbose
[camel-k] 02/14: feat(api): strongly-typed traits configuration API for addons
Posted by ts...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tsato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 9b13525e2f182e20e1ed38366cde1bca9dae465a
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Tue Jun 21 16:02:01 2022 +0900
feat(api): strongly-typed traits configuration API for addons
---
addons/keda/keda.go | 9 +++++++--
addons/master/master.go | 11 ++++++++---
addons/strimzi/strimzi_test.go | 4 ++--
addons/threescale/3scale.go | 10 ++++++++--
addons/tracing/tracing.go | 9 +++++++--
pkg/apis/camel/v1/common_types.go | 2 +-
pkg/apis/camel/v1/trait_container.go | 1 +
pkg/cmd/debug.go | 1 -
pkg/cmd/run.go | 11 +++++------
pkg/cmd/run_test.go | 27 ---------------------------
pkg/trait/trait_configure.go | 3 ++-
pkg/trait/util.go | 2 +-
12 files changed, 42 insertions(+), 48 deletions(-)
diff --git a/addons/keda/keda.go b/addons/keda/keda.go
index e6e1d5e17..a556cc575 100644
--- a/addons/keda/keda.go
+++ b/addons/keda/keda.go
@@ -72,8 +72,8 @@ const (
// The KEDA trait is disabled by default.
//
// +camel-k:trait=keda.
-type kedaTrait struct {
- trait.BaseTrait `property:",squash"`
+type Trait struct {
+ camelv1.Trait `property:",squash" json:",inline"`
// Enables automatic configuration of the trait. Allows the trait to infer KEDA triggers from the Kamelets.
Auto *bool `property:"auto" json:"auto,omitempty"`
// Set the spec->replicas field on the top level controller to an explicit value if missing, to allow KEDA to recognize it as a scalable resource.
@@ -95,6 +95,11 @@ type kedaTrait struct {
Triggers []kedaTrigger `property:"triggers" json:"triggers,omitempty"`
}
+type kedaTrait struct {
+ trait.BaseTrait
+ Trait `property:",squash"`
+}
+
type kedaTrigger struct {
Type string `property:"type" json:"type,omitempty"`
Metadata map[string]string `property:"metadata" json:"metadata,omitempty"`
diff --git a/addons/master/master.go b/addons/master/master.go
index 6acf221f0..ddb2e06ec 100644
--- a/addons/master/master.go
+++ b/addons/master/master.go
@@ -41,8 +41,8 @@ import (
// It's recommended to use a different service account than "default" when running the integration.
//
// +camel-k:trait=master.
-type masterTrait struct {
- trait.BaseTrait `property:",squash"`
+type Trait struct {
+ v1.Trait `property:",squash" json:",inline"`
// Enables automatic configuration of the trait.
Auto *bool `property:"auto" json:"auto,omitempty"`
// When this flag is active, the operator analyzes the source code to add dependencies required by delegate endpoints.
@@ -57,7 +57,12 @@ type masterTrait struct {
// Label that will be used to identify all pods contending the lock. Defaults to "camel.apache.org/integration".
LabelKey *string `property:"label-key" json:"labelKey,omitempty"`
// Label value that will be used to identify all pods contending the lock. Defaults to the integration name.
- LabelValue *string `property:"label-value" json:"labelValue,omitempty"`
+ LabelValue *string `property:"label-value" json:"labelValue,omitempty"`
+}
+
+type masterTrait struct {
+ trait.BaseTrait
+ Trait `property:",squash"`
delegateDependencies []string `json:"-"`
}
diff --git a/addons/strimzi/strimzi_test.go b/addons/strimzi/strimzi_test.go
index 1ef679d04..b1df8ebdc 100644
--- a/addons/strimzi/strimzi_test.go
+++ b/addons/strimzi/strimzi_test.go
@@ -64,7 +64,7 @@ func TestStrimziDirect(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, binding)
assert.Equal(t, "kafka:mytopic?brokers=my-cluster-kafka-bootstrap%3A9092", binding.URI)
- assert.Nil(t, binding.Traits)
+ assert.Equal(t, camelv1.Traits{}, binding.Traits)
}
func TestStrimziLookup(t *testing.T) {
@@ -124,7 +124,7 @@ func TestStrimziLookup(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, binding)
assert.Equal(t, "kafka:mytopicy?brokers=my-clusterx-kafka-bootstrap%3A9092", binding.URI)
- assert.Nil(t, binding.Traits)
+ assert.Equal(t, camelv1.Traits{}, binding.Traits)
}
func asEndpointProperties(props map[string]string) *v1alpha1.EndpointProperties {
diff --git a/addons/threescale/3scale.go b/addons/threescale/3scale.go
index a1ee7dfbd..7f11cd585 100644
--- a/addons/threescale/3scale.go
+++ b/addons/threescale/3scale.go
@@ -22,6 +22,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
"github.com/apache/camel-k/pkg/trait"
)
@@ -31,8 +32,8 @@ import (
// The 3scale trait is disabled by default.
//
// +camel-k:trait=3scale.
-type threeScaleTrait struct {
- trait.BaseTrait `property:",squash"`
+type Trait struct {
+ v1.Trait `property:",squash" json:",inline"`
// Enables automatic configuration of the trait.
Auto *bool `property:"auto" json:"auto,omitempty"`
// The scheme to use to contact the service (default `http`)
@@ -45,6 +46,11 @@ type threeScaleTrait struct {
DescriptionPath *string `property:"description-path" json:"descriptionPath,omitempty"`
}
+type threeScaleTrait struct {
+ trait.BaseTrait
+ Trait `property:",squash"`
+}
+
const (
// ThreeScaleSchemeAnnotation --.
ThreeScaleSchemeAnnotation = "discovery.3scale.net/scheme"
diff --git a/addons/tracing/tracing.go b/addons/tracing/tracing.go
index dc3843c3c..f43f5e88b 100644
--- a/addons/tracing/tracing.go
+++ b/addons/tracing/tracing.go
@@ -34,8 +34,8 @@ import (
// The Tracing trait is disabled by default.
//
// +camel-k:trait=tracing.
-type tracingTrait struct {
- trait.BaseTrait `property:",squash"`
+type Trait struct {
+ v1.Trait `property:",squash" json:",inline"`
// Enables automatic configuration of the trait, including automatic discovery of the tracing endpoint.
Auto *bool `property:"auto" json:"auto,omitempty"`
// The name of the service that publishes tracing data (defaults to the integration name)
@@ -48,6 +48,11 @@ type tracingTrait struct {
SamplerParam *string `property:"sampler-param" json:"samplerParam,omitempty"`
}
+type tracingTrait struct {
+ trait.BaseTrait
+ Trait `property:",squash"`
+}
+
const (
propEnabled = "propEnabled"
propEndpoint = "propEndpoint"
diff --git a/pkg/apis/camel/v1/common_types.go b/pkg/apis/camel/v1/common_types.go
index 34553daa7..04e822224 100644
--- a/pkg/apis/camel/v1/common_types.go
+++ b/pkg/apis/camel/v1/common_types.go
@@ -113,7 +113,7 @@ type Traits struct {
Container *ContainerTrait `property:"container" json:"container,omitempty"`
// The configuration of Cron trait
Cron *CronTrait `property:"cron" json:"cron,omitempty"`
- // DependenciesTrait is the configuration of Dependencies trait
+ // The configuration of Dependencies trait
Dependencies *DependenciesTrait `property:"dependencies" json:"dependencies,omitempty"`
// The configuration of Deployer trait
Deployer *DeployerTrait `property:"deployer" json:"deployer,omitempty"`
diff --git a/pkg/apis/camel/v1/trait_container.go b/pkg/apis/camel/v1/trait_container.go
index c88b2be34..9d4ed991d 100644
--- a/pkg/apis/camel/v1/trait_container.go
+++ b/pkg/apis/camel/v1/trait_container.go
@@ -28,6 +28,7 @@ import corev1 "k8s.io/api/core/v1"
type ContainerTrait struct {
Trait `property:",squash" json:",inline"`
+ // To automatically enable the trait
Auto *bool `property:"auto" json:"auto,omitempty"`
// The minimum amount of CPU required.
diff --git a/pkg/cmd/debug.go b/pkg/cmd/debug.go
index 35f6c16f3..c1d67c34d 100644
--- a/pkg/cmd/debug.go
+++ b/pkg/cmd/debug.go
@@ -131,7 +131,6 @@ func (o *debugCmdOptions) run(cmd *cobra.Command, args []string) error {
return kubernetes.PortForward(o.Context, cmdClient, o.Namespace, selector, o.Port, o.RemotePort, cmd.OutOrStdout(), cmd.ErrOrStderr())
}
-// nolint: unparam
func (o *debugCmdOptions) toggleDebug(c camelv1.IntegrationsGetter, it *v1.Integration, active bool) (*v1.Integration, error) {
if it.Spec.Traits.JVM == nil {
it.Spec.Traits.JVM = &v1.JVMTrait{}
diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go
index e78f484ab..e9e603976 100644
--- a/pkg/cmd/run.go
+++ b/pkg/cmd/run.go
@@ -307,8 +307,7 @@ func (o *runCmdOptions) run(cmd *cobra.Command, args []string) error {
return err
}
- catalog := trait.NewCatalog(c)
- integration, err := o.createOrUpdateIntegration(cmd, c, args, catalog)
+ integration, err := o.createOrUpdateIntegration(cmd, c, args)
if err != nil {
return err
}
@@ -333,7 +332,7 @@ func (o *runCmdOptions) run(cmd *cobra.Command, args []string) error {
}
if o.Sync || o.Dev {
- err = o.syncIntegration(cmd, c, args, catalog)
+ err = o.syncIntegration(cmd, c, args)
if err != nil {
return err
}
@@ -423,7 +422,7 @@ func (o *runCmdOptions) waitForIntegrationReady(cmd *cobra.Command, c client.Cli
return watch.HandleIntegrationStateChanges(o.Context, c, integration, handler)
}
-func (o *runCmdOptions) syncIntegration(cmd *cobra.Command, c client.Client, sources []string, catalog trait.Finder) error {
+func (o *runCmdOptions) syncIntegration(cmd *cobra.Command, c client.Client, sources []string) error {
// Let's watch all relevant files when in dev mode
var files []string
files = append(files, sources...)
@@ -461,7 +460,7 @@ func (o *runCmdOptions) syncIntegration(cmd *cobra.Command, c client.Client, sou
newCmd.Args = o.validateArgs
newCmd.PreRunE = o.decode
newCmd.RunE = func(cmd *cobra.Command, args []string) error {
- _, err := o.createOrUpdateIntegration(cmd, c, sources, catalog)
+ _, err := o.createOrUpdateIntegration(cmd, c, sources)
return err
}
newCmd.PostRunE = nil
@@ -485,7 +484,7 @@ func (o *runCmdOptions) syncIntegration(cmd *cobra.Command, c client.Client, sou
}
// nolint: gocyclo
-func (o *runCmdOptions) createOrUpdateIntegration(cmd *cobra.Command, c client.Client, sources []string, catalog trait.Finder) (*v1.Integration, error) {
+func (o *runCmdOptions) createOrUpdateIntegration(cmd *cobra.Command, c client.Client, sources []string) (*v1.Integration, error) {
namespace := o.Namespace
name := o.GetIntegrationName(sources)
diff --git a/pkg/cmd/run_test.go b/pkg/cmd/run_test.go
index f5c1dd350..a1543b64c 100644
--- a/pkg/cmd/run_test.go
+++ b/pkg/cmd/run_test.go
@@ -382,33 +382,6 @@ func assertTraitConfiguration(t *testing.T, trait interface{}, expected interfac
assert.Equal(t, expected, trait)
}
-type customTrait struct {
- trait.BaseTrait `property:",squash"`
- // SimpleMap
- SimpleMap map[string]string `property:"simple-map" json:"simpleMap,omitempty"`
- DoubleMap map[string]map[string]string `property:"double-map" json:"doubleMap,omitempty"`
- SliceOfMap []map[string]string `property:"slice-of-map" json:"sliceOfMap,omitempty"`
-}
-
-func (c customTrait) Configure(environment *trait.Environment) (bool, error) {
- panic("implement me")
-}
-func (c customTrait) Apply(environment *trait.Environment) error {
- panic("implement me")
-}
-
-var _ trait.Trait = &customTrait{}
-
-type customTraitFinder struct {
-}
-
-func (finder customTraitFinder) GetTrait(id string) trait.Trait {
- if id == "custom" {
- return &customTrait{}
- }
- return nil
-}
-
func TestRunUseFlowsFlag(t *testing.T) {
runCmdOptions, rootCmd, _ := initializeRunCmdOptions(t)
_, err := test.ExecuteCommand(rootCmd, cmdRun, "--use-flows=false", integrationSource)
diff --git a/pkg/trait/trait_configure.go b/pkg/trait/trait_configure.go
index 223d6926f..fb442b28e 100644
--- a/pkg/trait/trait_configure.go
+++ b/pkg/trait/trait_configure.go
@@ -66,8 +66,9 @@ func (c *Catalog) configureTraits(traits interface{}) error {
}
for id, trait := range traitsMap {
+ t := trait // Avoid G601: Implicit memory aliasing in for loop
if catTrait := c.GetTrait(id); catTrait != nil {
- if err := decodeTraitSpec(&trait, catTrait); err != nil {
+ if err := decodeTraitSpec(&t, catTrait); err != nil {
return err
}
}
diff --git a/pkg/trait/util.go b/pkg/trait/util.go
index 97ae4748d..8b56e6f78 100644
--- a/pkg/trait/util.go
+++ b/pkg/trait/util.go
@@ -244,7 +244,7 @@ func ToMap(traits interface{}) (map[string]map[string]interface{}, error) {
return traitsMap, nil
}
-// ToTrait unmarshals a map configuration to a target trait
+// ToTrait unmarshals a map configuration to a target trait.
func ToTrait(trait map[string]interface{}, target interface{}) error {
data, err := json.Marshal(trait)
if err != nil {
[camel-k] 07/14: chore(crd,doc): regen crd & docs
Posted by ts...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tsato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit aeca95989e6ea2d37585ca2548f9f5791ae1e5ff
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Thu Jun 30 19:04:00 2022 +0900
chore(crd,doc): regen crd & docs
---
.../bases/camel.apache.org_integrationkits.yaml | 76 +-
.../camel.apache.org_integrationplatforms.yaml | 2994 ++++++++++++++++++--
.../crd/bases/camel.apache.org_integrations.yaml | 1258 +++++++-
.../bases/camel.apache.org_kameletbindings.yaml | 1281 ++++++++-
docs/modules/traits/pages/container.adoc | 2 +-
docs/modules/traits/pages/gc.adoc | 2 +-
docs/modules/traits/pages/quarkus.adoc | 2 +-
docs/modules/traits/pages/service-binding.adoc | 3 +-
go.mod | 2 +-
go.sum | 3 +-
helm/camel-k/crds/crd-integration-kit.yaml | 76 +-
helm/camel-k/crds/crd-integration-platform.yaml | 2994 ++++++++++++++++++--
helm/camel-k/crds/crd-integration.yaml | 1258 +++++++-
helm/camel-k/crds/crd-kamelet-binding.yaml | 1281 ++++++++-
pkg/resources/resources.go | 20 +-
resources/traits.yaml | 322 +--
script/gen_crd.sh | 10 +-
script/gen_doc.sh | 7 +-
18 files changed, 10838 insertions(+), 753 deletions(-)
diff --git a/config/crd/bases/camel.apache.org_integrationkits.yaml b/config/crd/bases/camel.apache.org_integrationkits.yaml
index ca5c8f90f..06e61aaf3 100644
--- a/config/crd/bases/camel.apache.org_integrationkits.yaml
+++ b/config/crd/bases/camel.apache.org_integrationkits.yaml
@@ -111,7 +111,7 @@ spec:
type: string
type: array
image:
- description: the container image as identify in the container registry
+ description: the container image as identified in the container registry
type: string
profile:
description: the profile which is expected by this kit
@@ -122,17 +122,73 @@ spec:
type: string
type: array
traits:
- additionalProperties:
- description: A TraitSpec contains the configuration of a trait
- properties:
- configuration:
- description: TraitConfiguration parameters configuration
+ description: traits that the kit will execute
+ properties:
+ addons:
+ additionalProperties:
+ description: AddonTrait represents the configuration of an addon
+ trait
type: object
x-kubernetes-preserve-unknown-fields: true
- required:
- - configuration
- type: object
- description: traits that the kit will execute
+ description: The collection of addon trait configurations
+ type: object
+ builder:
+ description: The builder trait is internally used to determine
+ the best strategy to build and configure IntegrationKits.
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ properties:
+ description: A list of properties to be provided to the build
+ task
+ items:
+ type: string
+ type: array
+ verbose:
+ description: Enable verbose logging on build components that
+ support it (e.g. Kaniko build pod).
+ type: boolean
+ type: object
+ quarkus:
+ description: 'The Quarkus trait configures the Quarkus runtime.
+ It''s enabled by default. NOTE: Compiling to a native executable,
+ i.e. when using `package-type=native`, is only supported for
+ kamelets, as well as YAML and XML integrations. It also requires
+ at least 4GiB of memory, so the Pod running the native build,
+ that is either the operator Pod, or the build Pod (depending
+ on the build strategy configured for the platform), must have
+ enough memory available.'
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ packageTypes:
+ description: The Quarkus package types, either `fast-jar`
+ or `native` (default `fast-jar`). In case both `fast-jar`
+ and `native` are specified, two `IntegrationKit` resources
+ are created, with the `native` kit having precedence over
+ the `fast-jar` one once ready. The order influences the
+ resolution of the current kit for the integration. The kit
+ corresponding to the first package type will be assigned
+ to the integration in case no existing kit that matches
+ the integration exists.
+ items:
+ type: string
+ type: array
+ type: object
type: object
type: object
status:
diff --git a/config/crd/bases/camel.apache.org_integrationplatforms.yaml b/config/crd/bases/camel.apache.org_integrationplatforms.yaml
index d83005fbe..716a18b7e 100644
--- a/config/crd/bases/camel.apache.org_integrationplatforms.yaml
+++ b/config/crd/bases/camel.apache.org_integrationplatforms.yaml
@@ -367,255 +367,1495 @@ spec:
description: 'Deprecated: not used'
type: object
traits:
- additionalProperties:
- description: A TraitSpec contains the configuration of a trait
- properties:
- configuration:
- description: TraitConfiguration parameters configuration
- type: object
- x-kubernetes-preserve-unknown-fields: true
- required:
- - configuration
- type: object
description: list of traits to be executed for all the Integration/IntegrationKits
built from this IntegrationPlatform
- type: object
- type: object
- status:
- description: IntegrationPlatformStatus defines the observed state of IntegrationPlatform
- properties:
- build:
- description: specify how to build the Integration/IntegrationKits
properties:
- PublishStrategyOptions:
+ 3scale:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ addons:
additionalProperties:
- type: string
+ description: AddonTrait represents the configuration of an addon
+ trait
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ description: The extension point with addon traits
type: object
- baseImage:
- description: a base image that can be used as base layer for all
- images. It can be useful if you want to provide some custom
- base image with further utility softwares
- type: string
- buildStrategy:
- description: the strategy to adopt for building an Integration
- base image
- enum:
- - routine
- - pod
- type: string
- kanikoBuildCache:
- description: 'Deprecated: Use PublishStrategyOptions instead enables
- Kaniko publish strategy cache'
- type: boolean
- maven:
- description: Maven configuration used to build the Camel/Camel-Quarkus
- applications
+ affinity:
+ description: The configuration of Affinity trait
properties:
- caSecret:
- description: 'Deprecated: use CASecrets The Secret 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.'
- 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
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
type: object
- caSecrets:
- description: 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.
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ nodeAffinityLabels:
+ description: Defines a set of nodes the integration pod(s)
+ are eligible to be scheduled on, based on labels on the
+ node.
items:
- description: SecretKeySelector 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: string
type: array
- cliOptions:
- description: 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.8.4/maven-embedder/cli.html.
+ podAffinity:
+ description: Always co-locates multiple replicas of the integration
+ in the same node (default *false*).
+ type: boolean
+ podAffinityLabels:
+ description: Defines a set of pods (namely those matching
+ the label selector, relative to the given namespace) that
+ the integration pod(s) should be co-located with.
items:
type: string
type: array
- extension:
- description: The Maven build extensions. See https://maven.apache.org/guides/mini/guide-using-extensions.html.
+ podAntiAffinity:
+ description: Never co-locates multiple replicas of the integration
+ in the same node (default *false*).
+ type: boolean
+ podAntiAffinityLabels:
+ description: Defines a set of pods (namely those matching
+ the label selector, relative to the given namespace) that
+ the integration pod(s) should not be co-located with.
items:
- description: MavenArtifact defines a GAV (Group:Artifact:Version)
- Maven artifact
- properties:
- artifactId:
- description: Maven Artifact
- type: string
- groupId:
- description: Maven Group
- type: string
- version:
- description: Maven Version
- type: string
- required:
- - artifactId
- - groupId
- type: object
+ type: string
type: array
- localRepository:
- description: The path of the local Maven repository.
- type: string
+ type: object
+ builder:
+ description: The configuration of Builder trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
properties:
- additionalProperties:
+ description: A list of properties to be provided to the build
+ task
+ items:
type: string
- description: The Maven properties.
- type: object
- settings:
- description: A reference to the ConfigMap or Secret key that
- contains the Maven settings.
- 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
- settingsSecurity:
- description: A reference to the ConfigMap or Secret key that
- contains the security of the Maven settings.
- 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: array
+ verbose:
+ description: Enable verbose logging on build components that
+ support it (e.g. Kaniko build pod).
+ type: boolean
+ type: object
+ camel:
+ description: The configuration of Camel trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ properties:
+ description: A list of properties to be provided to the Integration
+ runtime
+ items:
+ type: string
+ type: array
+ runtimeVersion:
+ description: The camel-k-runtime version to use for the integration.
+ It overrides the default version set in the Integration
+ Platform.
+ type: string
type: object
- persistentVolumeClaim:
- description: 'Deprecated: Use PublishStrategyOptions instead the
- Persistent Volume Claim used by Kaniko publish strategy, if
- cache is enabled'
- type: string
- publishStrategy:
- description: the strategy to adopt for publishing an Integration
- base image
- type: string
- registry:
- description: the image registry used to push/pull Integration
- images
+ container:
+ description: The configuration of Container trait
properties:
- address:
- description: the URI to access
+ auto:
+ description: To automatically enable the trait
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ expose:
+ description: Can be used to enable/disable exposure via kubernetes
+ Service.
+ type: boolean
+ image:
+ description: The main container image
type: string
- ca:
- description: the configmap which stores the Certificate Authority
+ imagePullPolicy:
+ description: 'The pull policy: Always|Never|IfNotPresent'
type: string
- insecure:
- description: if the container registry is insecure (ie, http
- only)
+ limitCPU:
+ description: The maximum amount of CPU required.
+ type: string
+ limitMemory:
+ description: The maximum amount of memory required.
+ type: string
+ livenessFailureThreshold:
+ description: 'Minimum consecutive failures for the probe to
+ be considered failed after having succeeded. Applies to
+ the liveness probe. Deprecated: replaced by the health trait.'
+ format: int32
+ type: integer
+ livenessInitialDelay:
+ description: 'Number of seconds after the container has started
+ before liveness probes are initiated. Deprecated: replaced
+ by the health trait.'
+ format: int32
+ type: integer
+ livenessPeriod:
+ description: 'How often to perform the probe. Applies to the
+ liveness probe. Deprecated: replaced by the health trait.'
+ format: int32
+ type: integer
+ livenessScheme:
+ description: 'Scheme to use when connecting. Defaults to HTTP.
+ Applies to the liveness probe. Deprecated: replaced by the
+ health trait.'
+ type: string
+ livenessSuccessThreshold:
+ description: 'Minimum consecutive successes for the probe
+ to be considered successful after having failed. Applies
+ to the liveness probe. Deprecated: replaced by the health
+ trait.'
+ format: int32
+ type: integer
+ livenessTimeout:
+ description: 'Number of seconds after which the probe times
+ out. Applies to the liveness probe. Deprecated: replaced
+ by the health trait.'
+ format: int32
+ type: integer
+ name:
+ description: The main container name. It's named `integration`
+ by default.
+ type: string
+ port:
+ description: To configure a different port exposed by the
+ container (default `8080`).
+ type: integer
+ portName:
+ description: To configure a different port name for the port
+ exposed by the container. It defaults to `http` only when
+ the `expose` parameter is true.
+ type: string
+ probesEnabled:
+ description: 'DeprecatedProbesEnabled enable/disable probes
+ on the container (default `false`) Deprecated: replaced
+ by the health trait.'
type: boolean
- organization:
- description: the registry organization
+ readinessFailureThreshold:
+ description: 'Minimum consecutive failures for the probe to
+ be considered failed after having succeeded. Applies to
+ the readiness probe. Deprecated: replaced by the health
+ trait.'
+ format: int32
+ type: integer
+ readinessInitialDelay:
+ description: 'Number of seconds after the container has started
+ before readiness probes are initiated. Deprecated: replaced
+ by the health trait.'
+ format: int32
+ type: integer
+ readinessPeriod:
+ description: 'How often to perform the probe. Applies to the
+ readiness probe. Deprecated: replaced by the health trait.'
+ format: int32
+ type: integer
+ readinessScheme:
+ description: 'Scheme to use when connecting. Defaults to HTTP.
+ Applies to the readiness probe. Deprecated: replaced by
+ the health trait.'
type: string
- secret:
- description: the secret where credentials are stored
+ readinessSuccessThreshold:
+ description: 'Minimum consecutive successes for the probe
+ to be considered successful after having failed. Applies
+ to the readiness probe. Deprecated: replaced by the health
+ trait.'
+ format: int32
+ type: integer
+ readinessTimeout:
+ description: 'Number of seconds after which the probe times
+ out. Applies to the readiness probe. Deprecated: replaced
+ by the health trait.'
+ format: int32
+ type: integer
+ requestCPU:
+ description: The minimum amount of CPU required.
+ type: string
+ requestMemory:
+ description: The minimum amount of memory required.
+ type: string
+ servicePort:
+ description: To configure under which service port the container
+ port is to be exposed (default `80`).
+ type: integer
+ servicePortName:
+ description: To configure under which service port name the
+ container port is to be exposed (default `http`).
type: string
type: object
- runtimeProvider:
- description: the runtime used. Likely Camel Quarkus (we used to
- have main runtime which has been discontinued since version
+ cron:
+ description: The configuration of Cron trait
+ properties:
+ activeDeadlineSeconds:
+ description: Specifies the duration in seconds, relative to
+ the start time, that the job may be continuously active
+ before it is considered to be failed. It defaults to 60s.
+ format: int64
+ type: integer
+ auto:
+ description: "Automatically deploy the integration as CronJob
+ when all routes are either starting from a periodic consumer
+ (only `cron`, `timer` and `quartz` are supported) or a passive
+ consumer (e.g. `direct` is a passive consumer). \n It's
+ required that all periodic consumers have the same period
+ and it can be expressed as cron schedule (e.g. `1m` can
+ be expressed as `0/1 * * * *`, while `35m` or `50s` cannot)."
+ type: boolean
+ backoffLimit:
+ description: Specifies the number of retries before marking
+ the job failed. It defaults to 2.
+ format: int32
+ type: integer
+ components:
+ description: "A comma separated list of the Camel components
+ that need to be customized in order for them to work when
+ the schedule is triggered externally by Kubernetes. A specific
+ customizer is activated for each specified component. E.g.
+ for the `timer` component, the `cron-timer` customizer is
+ activated (it's present in the `org.apache.camel.k:camel-k-cron`
+ library). \n Supported components are currently: `cron`,
+ `timer` and `quartz`."
+ type: string
+ concurrencyPolicy:
+ description: 'Specifies how to treat concurrent executions
+ of a Job. Valid values are: - "Allow": allows CronJobs to
+ run concurrently; - "Forbid" (default): forbids concurrent
+ runs, skipping next run if previous run hasn''t finished
+ yet; - "Replace": cancels currently running job and replaces
+ it with a new one'
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ fallback:
+ description: Use the default Camel implementation of the `cron`
+ endpoint (`quartz`) instead of trying to materialize the
+ integration as Kubernetes CronJob.
+ type: boolean
+ schedule:
+ description: The CronJob schedule for the whole integration.
+ If multiple routes are declared, they must have the same
+ schedule for this mechanism to work correctly.
+ type: string
+ startingDeadlineSeconds:
+ description: Optional deadline in seconds for starting the
+ job if it misses scheduled time for any reason. Missed
+ jobs executions will be counted as failed ones.
+ format: int64
+ type: integer
+ type: object
+ dependencies:
+ description: The configuration of Dependencies trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ deployer:
+ description: The configuration of Deployer trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ kind:
+ description: Allows to explicitly select the desired deployment
+ kind between `deployment`, `cron-job` or `knative-service`
+ when creating the resources for running the integration.
+ type: string
+ useSSA:
+ description: Use server-side apply to update the owned resources
+ (default `true`). Note that it automatically falls back
+ to client-side patching, if SSA is not available, e.g.,
+ on old Kubernetes clusters.
+ type: boolean
+ type: object
+ deployment:
+ description: The configuration of Deployment trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ progressDeadlineSeconds:
+ description: The maximum time in seconds for the deployment
+ to make progress before it is considered to be failed. It
+ defaults to 60s.
+ format: int32
+ type: integer
+ type: object
+ environment:
+ description: The configuration of Environment trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ containerMeta:
+ description: Enables injection of `NAMESPACE` and `POD_NAME`
+ environment variables (default `true`)
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ httpProxy:
+ description: Propagates the `HTTP_PROXY`, `HTTPS_PROXY` and
+ `NO_PROXY` environment variables (default `true`)
+ type: boolean
+ vars:
+ description: A list of environment variables to be added to
+ the integration container. The syntax is KEY=VALUE, e.g.,
+ `MY_VAR="my value"`. These take precedence over the previously
+ defined environment variables.
+ items:
+ type: string
+ type: array
+ type: object
+ error-handler:
+ description: The configuration of Error Handler trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ ref:
+ description: The error handler ref name provided or found
+ in application properties
+ type: string
+ type: object
+ gc:
+ description: The configuration of GC trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ discoveryCache:
+ description: Discovery client cache to be used, either `disabled`,
+ `disk` or `memory` (default `memory`)
+ type: string
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ health:
+ description: The configuration of Health trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ livenessFailureThreshold:
+ description: Minimum consecutive failures for the liveness
+ probe to be considered failed after having succeeded.
+ format: int32
+ type: integer
+ livenessInitialDelay:
+ description: Number of seconds after the container has started
+ before the liveness probe is initiated.
+ format: int32
+ type: integer
+ livenessPeriod:
+ description: How often to perform the liveness probe.
+ format: int32
+ type: integer
+ livenessProbeEnabled:
+ description: Configures the liveness probe for the integration
+ container (default `false`).
+ type: boolean
+ livenessScheme:
+ description: Scheme to use when connecting to the liveness
+ probe (default `HTTP`).
+ type: string
+ livenessSuccessThreshold:
+ description: Minimum consecutive successes for the liveness
+ probe to be considered successful after having failed.
+ format: int32
+ type: integer
+ livenessTimeout:
+ description: Number of seconds after which the liveness probe
+ times out.
+ format: int32
+ type: integer
+ readinessFailureThreshold:
+ description: Minimum consecutive failures for the readiness
+ probe to be considered failed after having succeeded.
+ format: int32
+ type: integer
+ readinessInitialDelay:
+ description: Number of seconds after the container has started
+ before the readiness probe is initiated.
+ format: int32
+ type: integer
+ readinessPeriod:
+ description: How often to perform the readiness probe.
+ format: int32
+ type: integer
+ readinessProbeEnabled:
+ description: Configures the readiness probe for the integration
+ container (default `true`).
+ type: boolean
+ readinessScheme:
+ description: Scheme to use when connecting to the readiness
+ probe (default `HTTP`).
+ type: string
+ readinessSuccessThreshold:
+ description: Minimum consecutive successes for the readiness
+ probe to be considered successful after having failed.
+ format: int32
+ type: integer
+ readinessTimeout:
+ description: Number of seconds after which the readiness probe
+ times out.
+ format: int32
+ type: integer
+ type: object
+ ingress:
+ description: The configuration of Ingress trait
+ properties:
+ auto:
+ description: To automatically add an ingress whenever the
+ integration uses a HTTP endpoint consumer.
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ host:
+ description: '**Required**. To configure the host exposed
+ by the ingress.'
+ type: string
+ type: object
+ istio:
+ description: The configuration of Istio trait
+ properties:
+ allow:
+ description: Configures a (comma-separated) list of CIDR subnets
+ that should not be intercepted by the Istio proxy (`10.0.0.0/8,172.16.0.0/12,192.168.0.0/16`
+ by default).
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ inject:
+ description: Forces the value for labels `sidecar.istio.io/inject`.
+ By default the label is set to `true` on deployment and
+ not set on Knative Service.
+ type: boolean
+ type: object
+ jolokia:
+ description: The configuration of Jolokia trait
+ properties:
+ CACert:
+ description: The PEM encoded CA certification file path, used
+ to verify client certificates, applicable when `protocol`
+ is `https` and `use-ssl-client-authentication` is `true`
+ (default `/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt`
+ for OpenShift).
+ type: string
+ clientPrincipal:
+ description: The principal(s) which must be given in a client
+ certificate to allow access to the Jolokia endpoint, applicable
+ when `protocol` is `https` and `use-ssl-client-authentication`
+ is `true` (default `clientPrincipal=cn=system:master-proxy`,
+ `cn=hawtio-online.hawtio.svc` and `cn=fuse-console.fuse.svc`
+ for OpenShift).
+ items:
+ type: string
+ type: array
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ discoveryEnabled:
+ description: Listen for multicast requests (default `false`)
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ extendedClientCheck:
+ description: Mandate the client certificate contains a client
+ flag in the extended key usage section, applicable when
+ `protocol` is `https` and `use-ssl-client-authentication`
+ is `true` (default `true` for OpenShift).
+ type: boolean
+ host:
+ description: The Host address to which the Jolokia agent should
+ bind to. If `"\*"` or `"0.0.0.0"` is given, the servers
+ binds to every network interface (default `"*"`).
+ type: string
+ options:
+ description: A list of additional Jolokia options as defined
+ in https://jolokia.org/reference/html/agents.html#agent-jvm-config[JVM
+ agent configuration options]
+ items:
+ type: string
+ type: array
+ password:
+ description: The password used for authentication, applicable
+ when the `user` option is set.
+ type: string
+ port:
+ description: The Jolokia endpoint port (default `8778`).
+ type: integer
+ protocol:
+ description: The protocol to use, either `http` or `https`
+ (default `https` for OpenShift)
+ type: string
+ useSSLClientAuthentication:
+ description: Whether client certificates should be used for
+ authentication (default `true` for OpenShift).
+ type: boolean
+ user:
+ description: The user to be used for authentication
+ type: string
+ type: object
+ jvm:
+ description: The configuration of JVM trait
+ properties:
+ classpath:
+ description: Additional JVM classpath (use `Linux` classpath
+ separator)
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ debug:
+ description: Activates remote debugging, so that a debugger
+ can be attached to the JVM, e.g., using port-forwarding
+ type: boolean
+ debugAddress:
+ description: Transport address at which to listen for the
+ newly launched JVM (default `*:5005`)
+ type: string
+ debugSuspend:
+ description: Suspends the target JVM immediately before the
+ main class is loaded
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ options:
+ description: A list of JVM options
+ items:
+ type: string
+ type: array
+ printCommand:
+ description: Prints the command used the start the JVM in
+ the container logs (default `true`)
+ type: boolean
+ type: object
+ kamelets:
+ description: The configuration of Kamelets trait
+ properties:
+ auto:
+ description: Automatically inject all referenced Kamelets
+ and their default configuration (enabled by default)
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ list:
+ description: Comma separated list of Kamelet names to load
+ into the current integration
+ type: string
+ type: object
+ keda:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ knative:
+ description: The configuration of Knative trait
+ properties:
+ auto:
+ description: Enable automatic discovery of all trait properties.
+ type: boolean
+ channelSinks:
+ description: List of channels used as destination of integration
+ routes. Can contain simple channel names or full Camel URIs.
+ items:
+ type: string
+ type: array
+ channelSources:
+ description: List of channels used as source of integration
+ routes. Can contain simple channel names or full Camel URIs.
+ items:
+ type: string
+ type: array
+ config:
+ description: Can be used to inject a Knative complete configuration
+ in JSON format.
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ endpointSinks:
+ description: List of endpoints used as destination of integration
+ routes. Can contain simple endpoint names or full Camel
+ URIs.
+ items:
+ type: string
+ type: array
+ endpointSources:
+ description: List of channels used as source of integration
+ routes.
+ items:
+ type: string
+ type: array
+ eventSinks:
+ description: List of event types that the integration will
+ produce. Can contain simple event types or full Camel URIs
+ (to use a specific broker).
+ items:
+ type: string
+ type: array
+ eventSources:
+ description: List of event types that the integration will
+ be subscribed to. Can contain simple event types or full
+ Camel URIs (to use a specific broker different from "default").
+ items:
+ type: string
+ type: array
+ filterSourceChannels:
+ description: Enables filtering on events based on the header
+ "ce-knativehistory". Since this header has been removed
+ in newer versions of Knative, filtering is disabled by default.
+ type: boolean
+ sinkBinding:
+ description: Allows binding the integration to a sink via
+ a Knative SinkBinding resource. This can be used when the
+ integration targets a single sink. It's enabled by default
+ when the integration targets a single sink (except when
+ the integration is owned by a Knative source).
+ type: boolean
+ type: object
+ knative-service:
+ description: The configuration of Knative Service trait
+ properties:
+ auto:
+ description: "Automatically deploy the integration as Knative
+ service when all conditions hold: \n * Integration is using
+ the Knative profile * All routes are either starting from
+ a HTTP based consumer or a passive consumer (e.g. `direct`
+ is a passive consumer)"
+ type: boolean
+ autoscalingMetric:
+ description: "Configures the Knative autoscaling metric property
+ (e.g. to set `concurrency` based or `cpu` based autoscaling).
+ \n Refer to the Knative documentation for more information."
+ type: string
+ autoscalingTarget:
+ description: "Sets the allowed concurrency level or CPU percentage
+ (depending on the autoscaling metric) for each Pod. \n Refer
+ to the Knative documentation for more information."
+ type: integer
+ class:
+ description: "Configures the Knative autoscaling class property
+ (e.g. to set `hpa.autoscaling.knative.dev` or `kpa.autoscaling.knative.dev`
+ autoscaling). \n Refer to the Knative documentation for
+ more information."
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ maxScale:
+ description: "An upper bound for the number of Pods that can
+ be running in parallel for the integration. Knative has
+ its own cap value that depends on the installation. \n Refer
+ to the Knative documentation for more information."
+ type: integer
+ minScale:
+ description: "The minimum number of Pods that should be running
+ at any time for the integration. It's **zero** by default,
+ meaning that the integration is scaled down to zero when
+ not used for a configured amount of time. \n Refer to the
+ Knative documentation for more information."
+ type: integer
+ rolloutDuration:
+ description: Enables to gradually shift traffic to the latest
+ Revision and sets the rollout duration. It's disabled by
+ default and must be expressed as a Golang `time.Duration`
+ string representation, rounded to a second precision.
+ type: string
+ type: object
+ logging:
+ description: The configuration of Logging trait
+ properties:
+ color:
+ description: Colorize the log output
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ format:
+ description: Logs message format
+ type: string
+ json:
+ description: Output the logs in JSON
+ type: boolean
+ jsonPrettyPrint:
+ description: Enable "pretty printing" of the JSON logs
+ type: boolean
+ level:
+ description: Adjust the logging level (defaults to INFO)
+ type: string
+ type: object
+ master:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ mount:
+ description: The configuration of Mount trait
+ properties:
+ configs:
+ description: 'A list of configuration pointing to configmap/secret.
+ The configuration are expected to be UTF-8 resources as
+ they are processed by runtime Camel Context and tried to
+ be parsed as property files. They are also made available
+ on the classpath in order to ease their usage directly from
+ the Route. Syntax: [configmap|secret]:name[/key], where
+ name represents the resource name and key optionally represents
+ the resource key to be filtered'
+ items:
+ type: string
+ type: array
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ resources:
+ description: 'A list of resources (text or binary content)
+ pointing to configmap/secret. The resources are expected
+ to be any resource type (text or binary content). The destination
+ path can be either a default location or any path specified
+ by the user. Syntax: [configmap|secret]:name[/key][@path],
+ where name represents the resource name, key optionally
+ represents the resource key to be filtered and path represents
+ the destination path'
+ items:
+ type: string
+ type: array
+ volumes:
+ description: 'A list of Persistent Volume Claims to be mounted.
+ Syntax: [pvcname:/container/path]'
+ items:
+ type: string
+ type: array
+ type: object
+ openapi:
+ description: The configuration of OpenAPI trait
+ properties:
+ configmaps:
+ description: The configmaps holding the spec of the OpenAPI
+ items:
+ type: string
+ type: array
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ owner:
+ description: The configuration of Owner trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ targetAnnotations:
+ description: The set of annotations to be transferred
+ items:
+ type: string
+ type: array
+ targetLabels:
+ description: The set of labels to be transferred
+ items:
+ type: string
+ type: array
+ type: object
+ pdb:
+ description: The configuration of PDB trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ maxUnavailable:
+ description: The number of pods for the Integration that can
+ be unavailable after an eviction. It can be either an absolute
+ number or a percentage (default `1` if `min-available` is
+ also not set). Only one of `max-unavailable` and `min-available`
+ can be specified.
+ type: string
+ minAvailable:
+ description: The number of pods for the Integration that must
+ still be available after an eviction. It can be either an
+ absolute number or a percentage. Only one of `min-available`
+ and `max-unavailable` can be specified.
+ type: string
+ type: object
+ platform:
+ description: The configuration of Platform trait
+ properties:
+ auto:
+ description: To automatically detect from the environment
+ if a default platform can be created (it will be created
+ on OpenShift only).
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ createDefault:
+ description: To create a default (empty) platform when the
+ platform is missing.
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ global:
+ description: Indicates if the platform should be created globally
+ in the case of global operator (default true).
+ type: boolean
+ type: object
+ pod:
+ description: The configuration of Pod trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ prometheus:
+ description: The configuration of Prometheus trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ podMonitor:
+ description: Whether a `PodMonitor` resource is created (default
+ `true`).
+ type: boolean
+ podMonitorLabels:
+ description: The `PodMonitor` resource labels, applicable
+ when `pod-monitor` is `true`.
+ items:
+ type: string
+ type: array
+ type: object
+ pull-secret:
+ description: The configuration of Pull Secret trait
+ properties:
+ auto:
+ description: Automatically configures the platform registry
+ secret on the pod if it is of type `kubernetes.io/dockerconfigjson`.
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ imagePullerDelegation:
+ description: When using a global operator with a shared platform,
+ this enables delegation of the `system:image-puller` cluster
+ role on the operator namespace to the integration service
+ account.
+ type: boolean
+ secretName:
+ description: The pull secret name to set on the Pod. If left
+ empty this is automatically taken from the `IntegrationPlatform`
+ registry configuration.
+ type: string
+ type: object
+ quarkus:
+ description: The configuration of Quarkus trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ packageTypes:
+ description: The Quarkus package types, either `fast-jar`
+ or `native` (default `fast-jar`). In case both `fast-jar`
+ and `native` are specified, two `IntegrationKit` resources
+ are created, with the `native` kit having precedence over
+ the `fast-jar` one once ready. The order influences the
+ resolution of the current kit for the integration. The kit
+ corresponding to the first package type will be assigned
+ to the integration in case no existing kit that matches
+ the integration exists.
+ items:
+ type: string
+ type: array
+ type: object
+ registry:
+ description: The configuration of Registry trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ route:
+ description: The configuration of Route trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ host:
+ description: To configure the host exposed by the route.
+ type: string
+ tlsCACertificate:
+ description: "The TLS CA certificate contents. \n Refer to
+ the OpenShift route documentation for additional information."
+ type: string
+ tlsCACertificateSecret:
+ description: "The secret name and key reference to the TLS
+ CA certificate. The format is \"secret-name[/key-name]\",
+ the value represents the secret name, if there is only one
+ key in the secret it will be read, otherwise you can set
+ a key name separated with a \"/\". \n Refer to the OpenShift
+ route documentation for additional information."
+ type: string
+ tlsCertificate:
+ description: "The TLS certificate contents. \n Refer to the
+ OpenShift route documentation for additional information."
+ type: string
+ tlsCertificateSecret:
+ description: "The secret name and key reference to the TLS
+ certificate. The format is \"secret-name[/key-name]\", the
+ value represents the secret name, if there is only one key
+ in the secret it will be read, otherwise you can set a key
+ name separated with a \"/\". \n Refer to the OpenShift route
+ documentation for additional information."
+ type: string
+ tlsDestinationCACertificate:
+ description: "The destination CA certificate provides the
+ contents of the ca certificate of the final destination.
+ \ When using reencrypt termination this file should be provided
+ in order to have routers use it for health checks on the
+ secure connection. If this field is not specified, the router
+ may provide its own destination CA and perform hostname
+ validation using the short service name (service.namespace.svc),
+ which allows infrastructure generated certificates to automatically
+ verify. \n Refer to the OpenShift route documentation for
+ additional information."
+ type: string
+ tlsDestinationCACertificateSecret:
+ description: "The secret name and key reference to the destination
+ CA certificate. The format is \"secret-name[/key-name]\",
+ the value represents the secret name, if there is only one
+ key in the secret it will be read, otherwise you can set
+ a key name separated with a \"/\". \n Refer to the OpenShift
+ route documentation for additional information."
+ type: string
+ tlsInsecureEdgeTerminationPolicy:
+ description: "To configure how to deal with insecure traffic,
+ e.g. `Allow`, `Disable` or `Redirect` traffic. \n Refer
+ to the OpenShift route documentation for additional information."
+ type: string
+ tlsKey:
+ description: "The TLS certificate key contents. \n Refer to
+ the OpenShift route documentation for additional information."
+ type: string
+ tlsKeySecret:
+ description: "The secret name and key reference to the TLS
+ certificate key. The format is \"secret-name[/key-name]\",
+ the value represents the secret name, if there is only one
+ key in the secret it will be read, otherwise you can set
+ a key name separated with a \"/\". \n Refer to the OpenShift
+ route documentation for additional information."
+ type: string
+ tlsTermination:
+ description: "The TLS termination type, like `edge`, `passthrough`
+ or `reencrypt`. \n Refer to the OpenShift route documentation
+ for additional information."
+ type: string
+ type: object
+ service:
+ description: The configuration of Service trait
+ properties:
+ auto:
+ description: To automatically detect from the code if a Service
+ needs to be created.
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ nodePort:
+ description: Enable Service to be exposed as NodePort (default
+ `false`).
+ type: boolean
+ type: object
+ service-binding:
+ description: The configuration of Service Binding trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ services:
+ description: List of Services in the form [[apigroup/]version:]kind:[namespace/]name
+ items:
+ type: string
+ type: array
+ type: object
+ strimzi:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ toleration:
+ description: The configuration of Toleration trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ taints:
+ description: The list of taints to tolerate, in the form `Key[=Value]:Effect[:Seconds]`
+ items:
+ type: string
+ type: array
+ type: object
+ tracing:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ type: object
+ type: object
+ status:
+ description: IntegrationPlatformStatus defines the observed state of IntegrationPlatform
+ properties:
+ build:
+ description: specify how to build the Integration/IntegrationKits
+ properties:
+ PublishStrategyOptions:
+ additionalProperties:
+ type: string
+ type: object
+ baseImage:
+ description: a base image that can be used as base layer for all
+ images. It can be useful if you want to provide some custom
+ base image with further utility softwares
+ type: string
+ buildStrategy:
+ description: the strategy to adopt for building an Integration
+ base image
+ enum:
+ - routine
+ - pod
+ type: string
+ kanikoBuildCache:
+ description: 'Deprecated: Use PublishStrategyOptions instead enables
+ Kaniko publish strategy cache'
+ type: boolean
+ maven:
+ description: Maven configuration used to build the Camel/Camel-Quarkus
+ applications
+ properties:
+ caSecret:
+ description: 'Deprecated: use CASecrets The Secret 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.'
+ 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
+ caSecrets:
+ description: 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.
+ items:
+ description: SecretKeySelector 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: array
+ cliOptions:
+ description: 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.8.4/maven-embedder/cli.html.
+ items:
+ type: string
+ type: array
+ extension:
+ description: The Maven build extensions. See https://maven.apache.org/guides/mini/guide-using-extensions.html.
+ items:
+ description: MavenArtifact defines a GAV (Group:Artifact:Version)
+ Maven artifact
+ properties:
+ artifactId:
+ description: Maven Artifact
+ type: string
+ groupId:
+ description: Maven Group
+ type: string
+ version:
+ description: Maven Version
+ type: string
+ required:
+ - artifactId
+ - groupId
+ type: object
+ type: array
+ localRepository:
+ description: The path of the local Maven repository.
+ type: string
+ properties:
+ additionalProperties:
+ type: string
+ description: The Maven properties.
+ type: object
+ settings:
+ description: A reference to the ConfigMap or Secret key that
+ contains the Maven settings.
+ 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
+ settingsSecurity:
+ description: A reference to the ConfigMap or Secret key that
+ contains the security of the Maven settings.
+ 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
+ type: object
+ persistentVolumeClaim:
+ description: 'Deprecated: Use PublishStrategyOptions instead the
+ Persistent Volume Claim used by Kaniko publish strategy, if
+ cache is enabled'
+ type: string
+ publishStrategy:
+ description: the strategy to adopt for publishing an Integration
+ base image
+ type: string
+ registry:
+ description: the image registry used to push/pull Integration
+ images
+ properties:
+ address:
+ description: the URI to access
+ type: string
+ ca:
+ description: the configmap which stores the Certificate Authority
+ type: string
+ insecure:
+ description: if the container registry is insecure (ie, http
+ only)
+ type: boolean
+ organization:
+ description: the registry organization
+ type: string
+ secret:
+ description: the secret where credentials are stored
+ type: string
+ type: object
+ runtimeProvider:
+ description: the runtime used. Likely Camel Quarkus (we used to
+ have main runtime which has been discontinued since version
1.5)
type: string
runtimeVersion:
@@ -711,39 +1951,1279 @@ spec:
uri:
description: the remote repository in the format github:ORG/REPO/PATH_TO_KAMELETS_FOLDER
type: string
- type: object
- type: array
- type: object
- observedGeneration:
- description: ObservedGeneration is the most recent generation observed
- for this IntegrationPlatform.
- format: int64
- type: integer
- phase:
- description: defines in what phase the IntegrationPlatform is found
- type: string
- profile:
- description: the profile you wish to use. It will apply certain traits
- which are required by the specific profile chosen. It usually relates
- the Cluster with the optional definition of special profiles (ie,
- Knative)
- type: string
- resources:
- description: 'Deprecated: not used'
- type: object
- traits:
- additionalProperties:
- description: A TraitSpec contains the configuration of a trait
- properties:
- configuration:
- description: TraitConfiguration parameters configuration
- type: object
- x-kubernetes-preserve-unknown-fields: true
- required:
- - configuration
- type: object
- description: list of traits to be executed for all the Integration/IntegrationKits
- built from this IntegrationPlatform
+ type: object
+ type: array
+ type: object
+ observedGeneration:
+ description: ObservedGeneration is the most recent generation observed
+ for this IntegrationPlatform.
+ format: int64
+ type: integer
+ phase:
+ description: defines in what phase the IntegrationPlatform is found
+ type: string
+ profile:
+ description: the profile you wish to use. It will apply certain traits
+ which are required by the specific profile chosen. It usually relates
+ the Cluster with the optional definition of special profiles (ie,
+ Knative)
+ type: string
+ resources:
+ description: 'Deprecated: not used'
+ type: object
+ traits:
+ description: list of traits to be executed for all the Integration/IntegrationKits
+ built from this IntegrationPlatform
+ properties:
+ 3scale:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ addons:
+ additionalProperties:
+ description: AddonTrait represents the configuration of an addon
+ trait
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ description: The extension point with addon traits
+ type: object
+ affinity:
+ description: The configuration of Affinity trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ nodeAffinityLabels:
+ description: Defines a set of nodes the integration pod(s)
+ are eligible to be scheduled on, based on labels on the
+ node.
+ items:
+ type: string
+ type: array
+ podAffinity:
+ description: Always co-locates multiple replicas of the integration
+ in the same node (default *false*).
+ type: boolean
+ podAffinityLabels:
+ description: Defines a set of pods (namely those matching
+ the label selector, relative to the given namespace) that
+ the integration pod(s) should be co-located with.
+ items:
+ type: string
+ type: array
+ podAntiAffinity:
+ description: Never co-locates multiple replicas of the integration
+ in the same node (default *false*).
+ type: boolean
+ podAntiAffinityLabels:
+ description: Defines a set of pods (namely those matching
+ the label selector, relative to the given namespace) that
+ the integration pod(s) should not be co-located with.
+ items:
+ type: string
+ type: array
+ type: object
+ builder:
+ description: The configuration of Builder trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ properties:
+ description: A list of properties to be provided to the build
+ task
+ items:
+ type: string
+ type: array
+ verbose:
+ description: Enable verbose logging on build components that
+ support it (e.g. Kaniko build pod).
+ type: boolean
+ type: object
+ camel:
+ description: The configuration of Camel trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ properties:
+ description: A list of properties to be provided to the Integration
+ runtime
+ items:
+ type: string
+ type: array
+ runtimeVersion:
+ description: The camel-k-runtime version to use for the integration.
+ It overrides the default version set in the Integration
+ Platform.
+ type: string
+ type: object
+ container:
+ description: The configuration of Container trait
+ properties:
+ auto:
+ description: To automatically enable the trait
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ expose:
+ description: Can be used to enable/disable exposure via kubernetes
+ Service.
+ type: boolean
+ image:
+ description: The main container image
+ type: string
+ imagePullPolicy:
+ description: 'The pull policy: Always|Never|IfNotPresent'
+ type: string
+ limitCPU:
+ description: The maximum amount of CPU required.
+ type: string
+ limitMemory:
+ description: The maximum amount of memory required.
+ type: string
+ livenessFailureThreshold:
+ description: 'Minimum consecutive failures for the probe to
+ be considered failed after having succeeded. Applies to
+ the liveness probe. Deprecated: replaced by the health trait.'
+ format: int32
+ type: integer
+ livenessInitialDelay:
+ description: 'Number of seconds after the container has started
+ before liveness probes are initiated. Deprecated: replaced
+ by the health trait.'
+ format: int32
+ type: integer
+ livenessPeriod:
+ description: 'How often to perform the probe. Applies to the
+ liveness probe. Deprecated: replaced by the health trait.'
+ format: int32
+ type: integer
+ livenessScheme:
+ description: 'Scheme to use when connecting. Defaults to HTTP.
+ Applies to the liveness probe. Deprecated: replaced by the
+ health trait.'
+ type: string
+ livenessSuccessThreshold:
+ description: 'Minimum consecutive successes for the probe
+ to be considered successful after having failed. Applies
+ to the liveness probe. Deprecated: replaced by the health
+ trait.'
+ format: int32
+ type: integer
+ livenessTimeout:
+ description: 'Number of seconds after which the probe times
+ out. Applies to the liveness probe. Deprecated: replaced
+ by the health trait.'
+ format: int32
+ type: integer
+ name:
+ description: The main container name. It's named `integration`
+ by default.
+ type: string
+ port:
+ description: To configure a different port exposed by the
+ container (default `8080`).
+ type: integer
+ portName:
+ description: To configure a different port name for the port
+ exposed by the container. It defaults to `http` only when
+ the `expose` parameter is true.
+ type: string
+ probesEnabled:
+ description: 'DeprecatedProbesEnabled enable/disable probes
+ on the container (default `false`) Deprecated: replaced
+ by the health trait.'
+ type: boolean
+ readinessFailureThreshold:
+ description: 'Minimum consecutive failures for the probe to
+ be considered failed after having succeeded. Applies to
+ the readiness probe. Deprecated: replaced by the health
+ trait.'
+ format: int32
+ type: integer
+ readinessInitialDelay:
+ description: 'Number of seconds after the container has started
+ before readiness probes are initiated. Deprecated: replaced
+ by the health trait.'
+ format: int32
+ type: integer
+ readinessPeriod:
+ description: 'How often to perform the probe. Applies to the
+ readiness probe. Deprecated: replaced by the health trait.'
+ format: int32
+ type: integer
+ readinessScheme:
+ description: 'Scheme to use when connecting. Defaults to HTTP.
+ Applies to the readiness probe. Deprecated: replaced by
+ the health trait.'
+ type: string
+ readinessSuccessThreshold:
+ description: 'Minimum consecutive successes for the probe
+ to be considered successful after having failed. Applies
+ to the readiness probe. Deprecated: replaced by the health
+ trait.'
+ format: int32
+ type: integer
+ readinessTimeout:
+ description: 'Number of seconds after which the probe times
+ out. Applies to the readiness probe. Deprecated: replaced
+ by the health trait.'
+ format: int32
+ type: integer
+ requestCPU:
+ description: The minimum amount of CPU required.
+ type: string
+ requestMemory:
+ description: The minimum amount of memory required.
+ type: string
+ servicePort:
+ description: To configure under which service port the container
+ port is to be exposed (default `80`).
+ type: integer
+ servicePortName:
+ description: To configure under which service port name the
+ container port is to be exposed (default `http`).
+ type: string
+ type: object
+ cron:
+ description: The configuration of Cron trait
+ properties:
+ activeDeadlineSeconds:
+ description: Specifies the duration in seconds, relative to
+ the start time, that the job may be continuously active
+ before it is considered to be failed. It defaults to 60s.
+ format: int64
+ type: integer
+ auto:
+ description: "Automatically deploy the integration as CronJob
+ when all routes are either starting from a periodic consumer
+ (only `cron`, `timer` and `quartz` are supported) or a passive
+ consumer (e.g. `direct` is a passive consumer). \n It's
+ required that all periodic consumers have the same period
+ and it can be expressed as cron schedule (e.g. `1m` can
+ be expressed as `0/1 * * * *`, while `35m` or `50s` cannot)."
+ type: boolean
+ backoffLimit:
+ description: Specifies the number of retries before marking
+ the job failed. It defaults to 2.
+ format: int32
+ type: integer
+ components:
+ description: "A comma separated list of the Camel components
+ that need to be customized in order for them to work when
+ the schedule is triggered externally by Kubernetes. A specific
+ customizer is activated for each specified component. E.g.
+ for the `timer` component, the `cron-timer` customizer is
+ activated (it's present in the `org.apache.camel.k:camel-k-cron`
+ library). \n Supported components are currently: `cron`,
+ `timer` and `quartz`."
+ type: string
+ concurrencyPolicy:
+ description: 'Specifies how to treat concurrent executions
+ of a Job. Valid values are: - "Allow": allows CronJobs to
+ run concurrently; - "Forbid" (default): forbids concurrent
+ runs, skipping next run if previous run hasn''t finished
+ yet; - "Replace": cancels currently running job and replaces
+ it with a new one'
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ fallback:
+ description: Use the default Camel implementation of the `cron`
+ endpoint (`quartz`) instead of trying to materialize the
+ integration as Kubernetes CronJob.
+ type: boolean
+ schedule:
+ description: The CronJob schedule for the whole integration.
+ If multiple routes are declared, they must have the same
+ schedule for this mechanism to work correctly.
+ type: string
+ startingDeadlineSeconds:
+ description: Optional deadline in seconds for starting the
+ job if it misses scheduled time for any reason. Missed
+ jobs executions will be counted as failed ones.
+ format: int64
+ type: integer
+ type: object
+ dependencies:
+ description: The configuration of Dependencies trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ deployer:
+ description: The configuration of Deployer trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ kind:
+ description: Allows to explicitly select the desired deployment
+ kind between `deployment`, `cron-job` or `knative-service`
+ when creating the resources for running the integration.
+ type: string
+ useSSA:
+ description: Use server-side apply to update the owned resources
+ (default `true`). Note that it automatically falls back
+ to client-side patching, if SSA is not available, e.g.,
+ on old Kubernetes clusters.
+ type: boolean
+ type: object
+ deployment:
+ description: The configuration of Deployment trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ progressDeadlineSeconds:
+ description: The maximum time in seconds for the deployment
+ to make progress before it is considered to be failed. It
+ defaults to 60s.
+ format: int32
+ type: integer
+ type: object
+ environment:
+ description: The configuration of Environment trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ containerMeta:
+ description: Enables injection of `NAMESPACE` and `POD_NAME`
+ environment variables (default `true`)
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ httpProxy:
+ description: Propagates the `HTTP_PROXY`, `HTTPS_PROXY` and
+ `NO_PROXY` environment variables (default `true`)
+ type: boolean
+ vars:
+ description: A list of environment variables to be added to
+ the integration container. The syntax is KEY=VALUE, e.g.,
+ `MY_VAR="my value"`. These take precedence over the previously
+ defined environment variables.
+ items:
+ type: string
+ type: array
+ type: object
+ error-handler:
+ description: The configuration of Error Handler trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ ref:
+ description: The error handler ref name provided or found
+ in application properties
+ type: string
+ type: object
+ gc:
+ description: The configuration of GC trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ discoveryCache:
+ description: Discovery client cache to be used, either `disabled`,
+ `disk` or `memory` (default `memory`)
+ type: string
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ health:
+ description: The configuration of Health trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ livenessFailureThreshold:
+ description: Minimum consecutive failures for the liveness
+ probe to be considered failed after having succeeded.
+ format: int32
+ type: integer
+ livenessInitialDelay:
+ description: Number of seconds after the container has started
+ before the liveness probe is initiated.
+ format: int32
+ type: integer
+ livenessPeriod:
+ description: How often to perform the liveness probe.
+ format: int32
+ type: integer
+ livenessProbeEnabled:
+ description: Configures the liveness probe for the integration
+ container (default `false`).
+ type: boolean
+ livenessScheme:
+ description: Scheme to use when connecting to the liveness
+ probe (default `HTTP`).
+ type: string
+ livenessSuccessThreshold:
+ description: Minimum consecutive successes for the liveness
+ probe to be considered successful after having failed.
+ format: int32
+ type: integer
+ livenessTimeout:
+ description: Number of seconds after which the liveness probe
+ times out.
+ format: int32
+ type: integer
+ readinessFailureThreshold:
+ description: Minimum consecutive failures for the readiness
+ probe to be considered failed after having succeeded.
+ format: int32
+ type: integer
+ readinessInitialDelay:
+ description: Number of seconds after the container has started
+ before the readiness probe is initiated.
+ format: int32
+ type: integer
+ readinessPeriod:
+ description: How often to perform the readiness probe.
+ format: int32
+ type: integer
+ readinessProbeEnabled:
+ description: Configures the readiness probe for the integration
+ container (default `true`).
+ type: boolean
+ readinessScheme:
+ description: Scheme to use when connecting to the readiness
+ probe (default `HTTP`).
+ type: string
+ readinessSuccessThreshold:
+ description: Minimum consecutive successes for the readiness
+ probe to be considered successful after having failed.
+ format: int32
+ type: integer
+ readinessTimeout:
+ description: Number of seconds after which the readiness probe
+ times out.
+ format: int32
+ type: integer
+ type: object
+ ingress:
+ description: The configuration of Ingress trait
+ properties:
+ auto:
+ description: To automatically add an ingress whenever the
+ integration uses a HTTP endpoint consumer.
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ host:
+ description: '**Required**. To configure the host exposed
+ by the ingress.'
+ type: string
+ type: object
+ istio:
+ description: The configuration of Istio trait
+ properties:
+ allow:
+ description: Configures a (comma-separated) list of CIDR subnets
+ that should not be intercepted by the Istio proxy (`10.0.0.0/8,172.16.0.0/12,192.168.0.0/16`
+ by default).
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ inject:
+ description: Forces the value for labels `sidecar.istio.io/inject`.
+ By default the label is set to `true` on deployment and
+ not set on Knative Service.
+ type: boolean
+ type: object
+ jolokia:
+ description: The configuration of Jolokia trait
+ properties:
+ CACert:
+ description: The PEM encoded CA certification file path, used
+ to verify client certificates, applicable when `protocol`
+ is `https` and `use-ssl-client-authentication` is `true`
+ (default `/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt`
+ for OpenShift).
+ type: string
+ clientPrincipal:
+ description: The principal(s) which must be given in a client
+ certificate to allow access to the Jolokia endpoint, applicable
+ when `protocol` is `https` and `use-ssl-client-authentication`
+ is `true` (default `clientPrincipal=cn=system:master-proxy`,
+ `cn=hawtio-online.hawtio.svc` and `cn=fuse-console.fuse.svc`
+ for OpenShift).
+ items:
+ type: string
+ type: array
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ discoveryEnabled:
+ description: Listen for multicast requests (default `false`)
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ extendedClientCheck:
+ description: Mandate the client certificate contains a client
+ flag in the extended key usage section, applicable when
+ `protocol` is `https` and `use-ssl-client-authentication`
+ is `true` (default `true` for OpenShift).
+ type: boolean
+ host:
+ description: The Host address to which the Jolokia agent should
+ bind to. If `"\*"` or `"0.0.0.0"` is given, the servers
+ binds to every network interface (default `"*"`).
+ type: string
+ options:
+ description: A list of additional Jolokia options as defined
+ in https://jolokia.org/reference/html/agents.html#agent-jvm-config[JVM
+ agent configuration options]
+ items:
+ type: string
+ type: array
+ password:
+ description: The password used for authentication, applicable
+ when the `user` option is set.
+ type: string
+ port:
+ description: The Jolokia endpoint port (default `8778`).
+ type: integer
+ protocol:
+ description: The protocol to use, either `http` or `https`
+ (default `https` for OpenShift)
+ type: string
+ useSSLClientAuthentication:
+ description: Whether client certificates should be used for
+ authentication (default `true` for OpenShift).
+ type: boolean
+ user:
+ description: The user to be used for authentication
+ type: string
+ type: object
+ jvm:
+ description: The configuration of JVM trait
+ properties:
+ classpath:
+ description: Additional JVM classpath (use `Linux` classpath
+ separator)
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ debug:
+ description: Activates remote debugging, so that a debugger
+ can be attached to the JVM, e.g., using port-forwarding
+ type: boolean
+ debugAddress:
+ description: Transport address at which to listen for the
+ newly launched JVM (default `*:5005`)
+ type: string
+ debugSuspend:
+ description: Suspends the target JVM immediately before the
+ main class is loaded
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ options:
+ description: A list of JVM options
+ items:
+ type: string
+ type: array
+ printCommand:
+ description: Prints the command used the start the JVM in
+ the container logs (default `true`)
+ type: boolean
+ type: object
+ kamelets:
+ description: The configuration of Kamelets trait
+ properties:
+ auto:
+ description: Automatically inject all referenced Kamelets
+ and their default configuration (enabled by default)
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ list:
+ description: Comma separated list of Kamelet names to load
+ into the current integration
+ type: string
+ type: object
+ keda:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ knative:
+ description: The configuration of Knative trait
+ properties:
+ auto:
+ description: Enable automatic discovery of all trait properties.
+ type: boolean
+ channelSinks:
+ description: List of channels used as destination of integration
+ routes. Can contain simple channel names or full Camel URIs.
+ items:
+ type: string
+ type: array
+ channelSources:
+ description: List of channels used as source of integration
+ routes. Can contain simple channel names or full Camel URIs.
+ items:
+ type: string
+ type: array
+ config:
+ description: Can be used to inject a Knative complete configuration
+ in JSON format.
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ endpointSinks:
+ description: List of endpoints used as destination of integration
+ routes. Can contain simple endpoint names or full Camel
+ URIs.
+ items:
+ type: string
+ type: array
+ endpointSources:
+ description: List of channels used as source of integration
+ routes.
+ items:
+ type: string
+ type: array
+ eventSinks:
+ description: List of event types that the integration will
+ produce. Can contain simple event types or full Camel URIs
+ (to use a specific broker).
+ items:
+ type: string
+ type: array
+ eventSources:
+ description: List of event types that the integration will
+ be subscribed to. Can contain simple event types or full
+ Camel URIs (to use a specific broker different from "default").
+ items:
+ type: string
+ type: array
+ filterSourceChannels:
+ description: Enables filtering on events based on the header
+ "ce-knativehistory". Since this header has been removed
+ in newer versions of Knative, filtering is disabled by default.
+ type: boolean
+ sinkBinding:
+ description: Allows binding the integration to a sink via
+ a Knative SinkBinding resource. This can be used when the
+ integration targets a single sink. It's enabled by default
+ when the integration targets a single sink (except when
+ the integration is owned by a Knative source).
+ type: boolean
+ type: object
+ knative-service:
+ description: The configuration of Knative Service trait
+ properties:
+ auto:
+ description: "Automatically deploy the integration as Knative
+ service when all conditions hold: \n * Integration is using
+ the Knative profile * All routes are either starting from
+ a HTTP based consumer or a passive consumer (e.g. `direct`
+ is a passive consumer)"
+ type: boolean
+ autoscalingMetric:
+ description: "Configures the Knative autoscaling metric property
+ (e.g. to set `concurrency` based or `cpu` based autoscaling).
+ \n Refer to the Knative documentation for more information."
+ type: string
+ autoscalingTarget:
+ description: "Sets the allowed concurrency level or CPU percentage
+ (depending on the autoscaling metric) for each Pod. \n Refer
+ to the Knative documentation for more information."
+ type: integer
+ class:
+ description: "Configures the Knative autoscaling class property
+ (e.g. to set `hpa.autoscaling.knative.dev` or `kpa.autoscaling.knative.dev`
+ autoscaling). \n Refer to the Knative documentation for
+ more information."
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ maxScale:
+ description: "An upper bound for the number of Pods that can
+ be running in parallel for the integration. Knative has
+ its own cap value that depends on the installation. \n Refer
+ to the Knative documentation for more information."
+ type: integer
+ minScale:
+ description: "The minimum number of Pods that should be running
+ at any time for the integration. It's **zero** by default,
+ meaning that the integration is scaled down to zero when
+ not used for a configured amount of time. \n Refer to the
+ Knative documentation for more information."
+ type: integer
+ rolloutDuration:
+ description: Enables to gradually shift traffic to the latest
+ Revision and sets the rollout duration. It's disabled by
+ default and must be expressed as a Golang `time.Duration`
+ string representation, rounded to a second precision.
+ type: string
+ type: object
+ logging:
+ description: The configuration of Logging trait
+ properties:
+ color:
+ description: Colorize the log output
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ format:
+ description: Logs message format
+ type: string
+ json:
+ description: Output the logs in JSON
+ type: boolean
+ jsonPrettyPrint:
+ description: Enable "pretty printing" of the JSON logs
+ type: boolean
+ level:
+ description: Adjust the logging level (defaults to INFO)
+ type: string
+ type: object
+ master:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ mount:
+ description: The configuration of Mount trait
+ properties:
+ configs:
+ description: 'A list of configuration pointing to configmap/secret.
+ The configuration are expected to be UTF-8 resources as
+ they are processed by runtime Camel Context and tried to
+ be parsed as property files. They are also made available
+ on the classpath in order to ease their usage directly from
+ the Route. Syntax: [configmap|secret]:name[/key], where
+ name represents the resource name and key optionally represents
+ the resource key to be filtered'
+ items:
+ type: string
+ type: array
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ resources:
+ description: 'A list of resources (text or binary content)
+ pointing to configmap/secret. The resources are expected
+ to be any resource type (text or binary content). The destination
+ path can be either a default location or any path specified
+ by the user. Syntax: [configmap|secret]:name[/key][@path],
+ where name represents the resource name, key optionally
+ represents the resource key to be filtered and path represents
+ the destination path'
+ items:
+ type: string
+ type: array
+ volumes:
+ description: 'A list of Persistent Volume Claims to be mounted.
+ Syntax: [pvcname:/container/path]'
+ items:
+ type: string
+ type: array
+ type: object
+ openapi:
+ description: The configuration of OpenAPI trait
+ properties:
+ configmaps:
+ description: The configmaps holding the spec of the OpenAPI
+ items:
+ type: string
+ type: array
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ owner:
+ description: The configuration of Owner trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ targetAnnotations:
+ description: The set of annotations to be transferred
+ items:
+ type: string
+ type: array
+ targetLabels:
+ description: The set of labels to be transferred
+ items:
+ type: string
+ type: array
+ type: object
+ pdb:
+ description: The configuration of PDB trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ maxUnavailable:
+ description: The number of pods for the Integration that can
+ be unavailable after an eviction. It can be either an absolute
+ number or a percentage (default `1` if `min-available` is
+ also not set). Only one of `max-unavailable` and `min-available`
+ can be specified.
+ type: string
+ minAvailable:
+ description: The number of pods for the Integration that must
+ still be available after an eviction. It can be either an
+ absolute number or a percentage. Only one of `min-available`
+ and `max-unavailable` can be specified.
+ type: string
+ type: object
+ platform:
+ description: The configuration of Platform trait
+ properties:
+ auto:
+ description: To automatically detect from the environment
+ if a default platform can be created (it will be created
+ on OpenShift only).
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ createDefault:
+ description: To create a default (empty) platform when the
+ platform is missing.
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ global:
+ description: Indicates if the platform should be created globally
+ in the case of global operator (default true).
+ type: boolean
+ type: object
+ pod:
+ description: The configuration of Pod trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ prometheus:
+ description: The configuration of Prometheus trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ podMonitor:
+ description: Whether a `PodMonitor` resource is created (default
+ `true`).
+ type: boolean
+ podMonitorLabels:
+ description: The `PodMonitor` resource labels, applicable
+ when `pod-monitor` is `true`.
+ items:
+ type: string
+ type: array
+ type: object
+ pull-secret:
+ description: The configuration of Pull Secret trait
+ properties:
+ auto:
+ description: Automatically configures the platform registry
+ secret on the pod if it is of type `kubernetes.io/dockerconfigjson`.
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ imagePullerDelegation:
+ description: When using a global operator with a shared platform,
+ this enables delegation of the `system:image-puller` cluster
+ role on the operator namespace to the integration service
+ account.
+ type: boolean
+ secretName:
+ description: The pull secret name to set on the Pod. If left
+ empty this is automatically taken from the `IntegrationPlatform`
+ registry configuration.
+ type: string
+ type: object
+ quarkus:
+ description: The configuration of Quarkus trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ packageTypes:
+ description: The Quarkus package types, either `fast-jar`
+ or `native` (default `fast-jar`). In case both `fast-jar`
+ and `native` are specified, two `IntegrationKit` resources
+ are created, with the `native` kit having precedence over
+ the `fast-jar` one once ready. The order influences the
+ resolution of the current kit for the integration. The kit
+ corresponding to the first package type will be assigned
+ to the integration in case no existing kit that matches
+ the integration exists.
+ items:
+ type: string
+ type: array
+ type: object
+ registry:
+ description: The configuration of Registry trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ route:
+ description: The configuration of Route trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ host:
+ description: To configure the host exposed by the route.
+ type: string
+ tlsCACertificate:
+ description: "The TLS CA certificate contents. \n Refer to
+ the OpenShift route documentation for additional information."
+ type: string
+ tlsCACertificateSecret:
+ description: "The secret name and key reference to the TLS
+ CA certificate. The format is \"secret-name[/key-name]\",
+ the value represents the secret name, if there is only one
+ key in the secret it will be read, otherwise you can set
+ a key name separated with a \"/\". \n Refer to the OpenShift
+ route documentation for additional information."
+ type: string
+ tlsCertificate:
+ description: "The TLS certificate contents. \n Refer to the
+ OpenShift route documentation for additional information."
+ type: string
+ tlsCertificateSecret:
+ description: "The secret name and key reference to the TLS
+ certificate. The format is \"secret-name[/key-name]\", the
+ value represents the secret name, if there is only one key
+ in the secret it will be read, otherwise you can set a key
+ name separated with a \"/\". \n Refer to the OpenShift route
+ documentation for additional information."
+ type: string
+ tlsDestinationCACertificate:
+ description: "The destination CA certificate provides the
+ contents of the ca certificate of the final destination.
+ \ When using reencrypt termination this file should be provided
+ in order to have routers use it for health checks on the
+ secure connection. If this field is not specified, the router
+ may provide its own destination CA and perform hostname
+ validation using the short service name (service.namespace.svc),
+ which allows infrastructure generated certificates to automatically
+ verify. \n Refer to the OpenShift route documentation for
+ additional information."
+ type: string
+ tlsDestinationCACertificateSecret:
+ description: "The secret name and key reference to the destination
+ CA certificate. The format is \"secret-name[/key-name]\",
+ the value represents the secret name, if there is only one
+ key in the secret it will be read, otherwise you can set
+ a key name separated with a \"/\". \n Refer to the OpenShift
+ route documentation for additional information."
+ type: string
+ tlsInsecureEdgeTerminationPolicy:
+ description: "To configure how to deal with insecure traffic,
+ e.g. `Allow`, `Disable` or `Redirect` traffic. \n Refer
+ to the OpenShift route documentation for additional information."
+ type: string
+ tlsKey:
+ description: "The TLS certificate key contents. \n Refer to
+ the OpenShift route documentation for additional information."
+ type: string
+ tlsKeySecret:
+ description: "The secret name and key reference to the TLS
+ certificate key. The format is \"secret-name[/key-name]\",
+ the value represents the secret name, if there is only one
+ key in the secret it will be read, otherwise you can set
+ a key name separated with a \"/\". \n Refer to the OpenShift
+ route documentation for additional information."
+ type: string
+ tlsTermination:
+ description: "The TLS termination type, like `edge`, `passthrough`
+ or `reencrypt`. \n Refer to the OpenShift route documentation
+ for additional information."
+ type: string
+ type: object
+ service:
+ description: The configuration of Service trait
+ properties:
+ auto:
+ description: To automatically detect from the code if a Service
+ needs to be created.
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ nodePort:
+ description: Enable Service to be exposed as NodePort (default
+ `false`).
+ type: boolean
+ type: object
+ service-binding:
+ description: The configuration of Service Binding trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ services:
+ description: List of Services in the form [[apigroup/]version:]kind:[namespace/]name
+ items:
+ type: string
+ type: array
+ type: object
+ strimzi:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ toleration:
+ description: The configuration of Toleration trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ taints:
+ description: The list of taints to tolerate, in the form `Key[=Value]:Effect[:Seconds]`
+ items:
+ type: string
+ type: array
+ type: object
+ tracing:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
type: object
version:
description: the Camel K operator version controlling this IntegrationPlatform
diff --git a/config/crd/bases/camel.apache.org_integrations.yaml b/config/crd/bases/camel.apache.org_integrations.yaml
index 764a2e332..e0cc1dbae 100644
--- a/config/crd/bases/camel.apache.org_integrations.yaml
+++ b/config/crd/bases/camel.apache.org_integrations.yaml
@@ -5845,17 +5845,1257 @@ spec:
type: object
type: object
traits:
- additionalProperties:
- description: A TraitSpec contains the configuration of a trait
- properties:
- configuration:
- description: TraitConfiguration parameters configuration
+ description: the traits needed to run this Integration
+ properties:
+ 3scale:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ addons:
+ additionalProperties:
+ description: AddonTrait represents the configuration of an addon
+ trait
type: object
x-kubernetes-preserve-unknown-fields: true
- required:
- - configuration
- type: object
- description: the traits needed to run this Integration
+ description: The extension point with addon traits
+ type: object
+ affinity:
+ description: The configuration of Affinity trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ nodeAffinityLabels:
+ description: Defines a set of nodes the integration pod(s)
+ are eligible to be scheduled on, based on labels on the
+ node.
+ items:
+ type: string
+ type: array
+ podAffinity:
+ description: Always co-locates multiple replicas of the integration
+ in the same node (default *false*).
+ type: boolean
+ podAffinityLabels:
+ description: Defines a set of pods (namely those matching
+ the label selector, relative to the given namespace) that
+ the integration pod(s) should be co-located with.
+ items:
+ type: string
+ type: array
+ podAntiAffinity:
+ description: Never co-locates multiple replicas of the integration
+ in the same node (default *false*).
+ type: boolean
+ podAntiAffinityLabels:
+ description: Defines a set of pods (namely those matching
+ the label selector, relative to the given namespace) that
+ the integration pod(s) should not be co-located with.
+ items:
+ type: string
+ type: array
+ type: object
+ builder:
+ description: The configuration of Builder trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ properties:
+ description: A list of properties to be provided to the build
+ task
+ items:
+ type: string
+ type: array
+ verbose:
+ description: Enable verbose logging on build components that
+ support it (e.g. Kaniko build pod).
+ type: boolean
+ type: object
+ camel:
+ description: The configuration of Camel trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ properties:
+ description: A list of properties to be provided to the Integration
+ runtime
+ items:
+ type: string
+ type: array
+ runtimeVersion:
+ description: The camel-k-runtime version to use for the integration.
+ It overrides the default version set in the Integration
+ Platform.
+ type: string
+ type: object
+ container:
+ description: The configuration of Container trait
+ properties:
+ auto:
+ description: To automatically enable the trait
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ expose:
+ description: Can be used to enable/disable exposure via kubernetes
+ Service.
+ type: boolean
+ image:
+ description: The main container image
+ type: string
+ imagePullPolicy:
+ description: 'The pull policy: Always|Never|IfNotPresent'
+ type: string
+ limitCPU:
+ description: The maximum amount of CPU required.
+ type: string
+ limitMemory:
+ description: The maximum amount of memory required.
+ type: string
+ livenessFailureThreshold:
+ description: 'Minimum consecutive failures for the probe to
+ be considered failed after having succeeded. Applies to
+ the liveness probe. Deprecated: replaced by the health trait.'
+ format: int32
+ type: integer
+ livenessInitialDelay:
+ description: 'Number of seconds after the container has started
+ before liveness probes are initiated. Deprecated: replaced
+ by the health trait.'
+ format: int32
+ type: integer
+ livenessPeriod:
+ description: 'How often to perform the probe. Applies to the
+ liveness probe. Deprecated: replaced by the health trait.'
+ format: int32
+ type: integer
+ livenessScheme:
+ description: 'Scheme to use when connecting. Defaults to HTTP.
+ Applies to the liveness probe. Deprecated: replaced by the
+ health trait.'
+ type: string
+ livenessSuccessThreshold:
+ description: 'Minimum consecutive successes for the probe
+ to be considered successful after having failed. Applies
+ to the liveness probe. Deprecated: replaced by the health
+ trait.'
+ format: int32
+ type: integer
+ livenessTimeout:
+ description: 'Number of seconds after which the probe times
+ out. Applies to the liveness probe. Deprecated: replaced
+ by the health trait.'
+ format: int32
+ type: integer
+ name:
+ description: The main container name. It's named `integration`
+ by default.
+ type: string
+ port:
+ description: To configure a different port exposed by the
+ container (default `8080`).
+ type: integer
+ portName:
+ description: To configure a different port name for the port
+ exposed by the container. It defaults to `http` only when
+ the `expose` parameter is true.
+ type: string
+ probesEnabled:
+ description: 'DeprecatedProbesEnabled enable/disable probes
+ on the container (default `false`) Deprecated: replaced
+ by the health trait.'
+ type: boolean
+ readinessFailureThreshold:
+ description: 'Minimum consecutive failures for the probe to
+ be considered failed after having succeeded. Applies to
+ the readiness probe. Deprecated: replaced by the health
+ trait.'
+ format: int32
+ type: integer
+ readinessInitialDelay:
+ description: 'Number of seconds after the container has started
+ before readiness probes are initiated. Deprecated: replaced
+ by the health trait.'
+ format: int32
+ type: integer
+ readinessPeriod:
+ description: 'How often to perform the probe. Applies to the
+ readiness probe. Deprecated: replaced by the health trait.'
+ format: int32
+ type: integer
+ readinessScheme:
+ description: 'Scheme to use when connecting. Defaults to HTTP.
+ Applies to the readiness probe. Deprecated: replaced by
+ the health trait.'
+ type: string
+ readinessSuccessThreshold:
+ description: 'Minimum consecutive successes for the probe
+ to be considered successful after having failed. Applies
+ to the readiness probe. Deprecated: replaced by the health
+ trait.'
+ format: int32
+ type: integer
+ readinessTimeout:
+ description: 'Number of seconds after which the probe times
+ out. Applies to the readiness probe. Deprecated: replaced
+ by the health trait.'
+ format: int32
+ type: integer
+ requestCPU:
+ description: The minimum amount of CPU required.
+ type: string
+ requestMemory:
+ description: The minimum amount of memory required.
+ type: string
+ servicePort:
+ description: To configure under which service port the container
+ port is to be exposed (default `80`).
+ type: integer
+ servicePortName:
+ description: To configure under which service port name the
+ container port is to be exposed (default `http`).
+ type: string
+ type: object
+ cron:
+ description: The configuration of Cron trait
+ properties:
+ activeDeadlineSeconds:
+ description: Specifies the duration in seconds, relative to
+ the start time, that the job may be continuously active
+ before it is considered to be failed. It defaults to 60s.
+ format: int64
+ type: integer
+ auto:
+ description: "Automatically deploy the integration as CronJob
+ when all routes are either starting from a periodic consumer
+ (only `cron`, `timer` and `quartz` are supported) or a passive
+ consumer (e.g. `direct` is a passive consumer). \n It's
+ required that all periodic consumers have the same period
+ and it can be expressed as cron schedule (e.g. `1m` can
+ be expressed as `0/1 * * * *`, while `35m` or `50s` cannot)."
+ type: boolean
+ backoffLimit:
+ description: Specifies the number of retries before marking
+ the job failed. It defaults to 2.
+ format: int32
+ type: integer
+ components:
+ description: "A comma separated list of the Camel components
+ that need to be customized in order for them to work when
+ the schedule is triggered externally by Kubernetes. A specific
+ customizer is activated for each specified component. E.g.
+ for the `timer` component, the `cron-timer` customizer is
+ activated (it's present in the `org.apache.camel.k:camel-k-cron`
+ library). \n Supported components are currently: `cron`,
+ `timer` and `quartz`."
+ type: string
+ concurrencyPolicy:
+ description: 'Specifies how to treat concurrent executions
+ of a Job. Valid values are: - "Allow": allows CronJobs to
+ run concurrently; - "Forbid" (default): forbids concurrent
+ runs, skipping next run if previous run hasn''t finished
+ yet; - "Replace": cancels currently running job and replaces
+ it with a new one'
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ fallback:
+ description: Use the default Camel implementation of the `cron`
+ endpoint (`quartz`) instead of trying to materialize the
+ integration as Kubernetes CronJob.
+ type: boolean
+ schedule:
+ description: The CronJob schedule for the whole integration.
+ If multiple routes are declared, they must have the same
+ schedule for this mechanism to work correctly.
+ type: string
+ startingDeadlineSeconds:
+ description: Optional deadline in seconds for starting the
+ job if it misses scheduled time for any reason. Missed
+ jobs executions will be counted as failed ones.
+ format: int64
+ type: integer
+ type: object
+ dependencies:
+ description: The configuration of Dependencies trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ deployer:
+ description: The configuration of Deployer trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ kind:
+ description: Allows to explicitly select the desired deployment
+ kind between `deployment`, `cron-job` or `knative-service`
+ when creating the resources for running the integration.
+ type: string
+ useSSA:
+ description: Use server-side apply to update the owned resources
+ (default `true`). Note that it automatically falls back
+ to client-side patching, if SSA is not available, e.g.,
+ on old Kubernetes clusters.
+ type: boolean
+ type: object
+ deployment:
+ description: The configuration of Deployment trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ progressDeadlineSeconds:
+ description: The maximum time in seconds for the deployment
+ to make progress before it is considered to be failed. It
+ defaults to 60s.
+ format: int32
+ type: integer
+ type: object
+ environment:
+ description: The configuration of Environment trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ containerMeta:
+ description: Enables injection of `NAMESPACE` and `POD_NAME`
+ environment variables (default `true`)
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ httpProxy:
+ description: Propagates the `HTTP_PROXY`, `HTTPS_PROXY` and
+ `NO_PROXY` environment variables (default `true`)
+ type: boolean
+ vars:
+ description: A list of environment variables to be added to
+ the integration container. The syntax is KEY=VALUE, e.g.,
+ `MY_VAR="my value"`. These take precedence over the previously
+ defined environment variables.
+ items:
+ type: string
+ type: array
+ type: object
+ error-handler:
+ description: The configuration of Error Handler trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ ref:
+ description: The error handler ref name provided or found
+ in application properties
+ type: string
+ type: object
+ gc:
+ description: The configuration of GC trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ discoveryCache:
+ description: Discovery client cache to be used, either `disabled`,
+ `disk` or `memory` (default `memory`)
+ type: string
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ health:
+ description: The configuration of Health trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ livenessFailureThreshold:
+ description: Minimum consecutive failures for the liveness
+ probe to be considered failed after having succeeded.
+ format: int32
+ type: integer
+ livenessInitialDelay:
+ description: Number of seconds after the container has started
+ before the liveness probe is initiated.
+ format: int32
+ type: integer
+ livenessPeriod:
+ description: How often to perform the liveness probe.
+ format: int32
+ type: integer
+ livenessProbeEnabled:
+ description: Configures the liveness probe for the integration
+ container (default `false`).
+ type: boolean
+ livenessScheme:
+ description: Scheme to use when connecting to the liveness
+ probe (default `HTTP`).
+ type: string
+ livenessSuccessThreshold:
+ description: Minimum consecutive successes for the liveness
+ probe to be considered successful after having failed.
+ format: int32
+ type: integer
+ livenessTimeout:
+ description: Number of seconds after which the liveness probe
+ times out.
+ format: int32
+ type: integer
+ readinessFailureThreshold:
+ description: Minimum consecutive failures for the readiness
+ probe to be considered failed after having succeeded.
+ format: int32
+ type: integer
+ readinessInitialDelay:
+ description: Number of seconds after the container has started
+ before the readiness probe is initiated.
+ format: int32
+ type: integer
+ readinessPeriod:
+ description: How often to perform the readiness probe.
+ format: int32
+ type: integer
+ readinessProbeEnabled:
+ description: Configures the readiness probe for the integration
+ container (default `true`).
+ type: boolean
+ readinessScheme:
+ description: Scheme to use when connecting to the readiness
+ probe (default `HTTP`).
+ type: string
+ readinessSuccessThreshold:
+ description: Minimum consecutive successes for the readiness
+ probe to be considered successful after having failed.
+ format: int32
+ type: integer
+ readinessTimeout:
+ description: Number of seconds after which the readiness probe
+ times out.
+ format: int32
+ type: integer
+ type: object
+ ingress:
+ description: The configuration of Ingress trait
+ properties:
+ auto:
+ description: To automatically add an ingress whenever the
+ integration uses a HTTP endpoint consumer.
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ host:
+ description: '**Required**. To configure the host exposed
+ by the ingress.'
+ type: string
+ type: object
+ istio:
+ description: The configuration of Istio trait
+ properties:
+ allow:
+ description: Configures a (comma-separated) list of CIDR subnets
+ that should not be intercepted by the Istio proxy (`10.0.0.0/8,172.16.0.0/12,192.168.0.0/16`
+ by default).
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ inject:
+ description: Forces the value for labels `sidecar.istio.io/inject`.
+ By default the label is set to `true` on deployment and
+ not set on Knative Service.
+ type: boolean
+ type: object
+ jolokia:
+ description: The configuration of Jolokia trait
+ properties:
+ CACert:
+ description: The PEM encoded CA certification file path, used
+ to verify client certificates, applicable when `protocol`
+ is `https` and `use-ssl-client-authentication` is `true`
+ (default `/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt`
+ for OpenShift).
+ type: string
+ clientPrincipal:
+ description: The principal(s) which must be given in a client
+ certificate to allow access to the Jolokia endpoint, applicable
+ when `protocol` is `https` and `use-ssl-client-authentication`
+ is `true` (default `clientPrincipal=cn=system:master-proxy`,
+ `cn=hawtio-online.hawtio.svc` and `cn=fuse-console.fuse.svc`
+ for OpenShift).
+ items:
+ type: string
+ type: array
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ discoveryEnabled:
+ description: Listen for multicast requests (default `false`)
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ extendedClientCheck:
+ description: Mandate the client certificate contains a client
+ flag in the extended key usage section, applicable when
+ `protocol` is `https` and `use-ssl-client-authentication`
+ is `true` (default `true` for OpenShift).
+ type: boolean
+ host:
+ description: The Host address to which the Jolokia agent should
+ bind to. If `"\*"` or `"0.0.0.0"` is given, the servers
+ binds to every network interface (default `"*"`).
+ type: string
+ options:
+ description: A list of additional Jolokia options as defined
+ in https://jolokia.org/reference/html/agents.html#agent-jvm-config[JVM
+ agent configuration options]
+ items:
+ type: string
+ type: array
+ password:
+ description: The password used for authentication, applicable
+ when the `user` option is set.
+ type: string
+ port:
+ description: The Jolokia endpoint port (default `8778`).
+ type: integer
+ protocol:
+ description: The protocol to use, either `http` or `https`
+ (default `https` for OpenShift)
+ type: string
+ useSSLClientAuthentication:
+ description: Whether client certificates should be used for
+ authentication (default `true` for OpenShift).
+ type: boolean
+ user:
+ description: The user to be used for authentication
+ type: string
+ type: object
+ jvm:
+ description: The configuration of JVM trait
+ properties:
+ classpath:
+ description: Additional JVM classpath (use `Linux` classpath
+ separator)
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ debug:
+ description: Activates remote debugging, so that a debugger
+ can be attached to the JVM, e.g., using port-forwarding
+ type: boolean
+ debugAddress:
+ description: Transport address at which to listen for the
+ newly launched JVM (default `*:5005`)
+ type: string
+ debugSuspend:
+ description: Suspends the target JVM immediately before the
+ main class is loaded
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ options:
+ description: A list of JVM options
+ items:
+ type: string
+ type: array
+ printCommand:
+ description: Prints the command used the start the JVM in
+ the container logs (default `true`)
+ type: boolean
+ type: object
+ kamelets:
+ description: The configuration of Kamelets trait
+ properties:
+ auto:
+ description: Automatically inject all referenced Kamelets
+ and their default configuration (enabled by default)
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ list:
+ description: Comma separated list of Kamelet names to load
+ into the current integration
+ type: string
+ type: object
+ keda:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ knative:
+ description: The configuration of Knative trait
+ properties:
+ auto:
+ description: Enable automatic discovery of all trait properties.
+ type: boolean
+ channelSinks:
+ description: List of channels used as destination of integration
+ routes. Can contain simple channel names or full Camel URIs.
+ items:
+ type: string
+ type: array
+ channelSources:
+ description: List of channels used as source of integration
+ routes. Can contain simple channel names or full Camel URIs.
+ items:
+ type: string
+ type: array
+ config:
+ description: Can be used to inject a Knative complete configuration
+ in JSON format.
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ endpointSinks:
+ description: List of endpoints used as destination of integration
+ routes. Can contain simple endpoint names or full Camel
+ URIs.
+ items:
+ type: string
+ type: array
+ endpointSources:
+ description: List of channels used as source of integration
+ routes.
+ items:
+ type: string
+ type: array
+ eventSinks:
+ description: List of event types that the integration will
+ produce. Can contain simple event types or full Camel URIs
+ (to use a specific broker).
+ items:
+ type: string
+ type: array
+ eventSources:
+ description: List of event types that the integration will
+ be subscribed to. Can contain simple event types or full
+ Camel URIs (to use a specific broker different from "default").
+ items:
+ type: string
+ type: array
+ filterSourceChannels:
+ description: Enables filtering on events based on the header
+ "ce-knativehistory". Since this header has been removed
+ in newer versions of Knative, filtering is disabled by default.
+ type: boolean
+ sinkBinding:
+ description: Allows binding the integration to a sink via
+ a Knative SinkBinding resource. This can be used when the
+ integration targets a single sink. It's enabled by default
+ when the integration targets a single sink (except when
+ the integration is owned by a Knative source).
+ type: boolean
+ type: object
+ knative-service:
+ description: The configuration of Knative Service trait
+ properties:
+ auto:
+ description: "Automatically deploy the integration as Knative
+ service when all conditions hold: \n * Integration is using
+ the Knative profile * All routes are either starting from
+ a HTTP based consumer or a passive consumer (e.g. `direct`
+ is a passive consumer)"
+ type: boolean
+ autoscalingMetric:
+ description: "Configures the Knative autoscaling metric property
+ (e.g. to set `concurrency` based or `cpu` based autoscaling).
+ \n Refer to the Knative documentation for more information."
+ type: string
+ autoscalingTarget:
+ description: "Sets the allowed concurrency level or CPU percentage
+ (depending on the autoscaling metric) for each Pod. \n Refer
+ to the Knative documentation for more information."
+ type: integer
+ class:
+ description: "Configures the Knative autoscaling class property
+ (e.g. to set `hpa.autoscaling.knative.dev` or `kpa.autoscaling.knative.dev`
+ autoscaling). \n Refer to the Knative documentation for
+ more information."
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ maxScale:
+ description: "An upper bound for the number of Pods that can
+ be running in parallel for the integration. Knative has
+ its own cap value that depends on the installation. \n Refer
+ to the Knative documentation for more information."
+ type: integer
+ minScale:
+ description: "The minimum number of Pods that should be running
+ at any time for the integration. It's **zero** by default,
+ meaning that the integration is scaled down to zero when
+ not used for a configured amount of time. \n Refer to the
+ Knative documentation for more information."
+ type: integer
+ rolloutDuration:
+ description: Enables to gradually shift traffic to the latest
+ Revision and sets the rollout duration. It's disabled by
+ default and must be expressed as a Golang `time.Duration`
+ string representation, rounded to a second precision.
+ type: string
+ type: object
+ logging:
+ description: The configuration of Logging trait
+ properties:
+ color:
+ description: Colorize the log output
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ format:
+ description: Logs message format
+ type: string
+ json:
+ description: Output the logs in JSON
+ type: boolean
+ jsonPrettyPrint:
+ description: Enable "pretty printing" of the JSON logs
+ type: boolean
+ level:
+ description: Adjust the logging level (defaults to INFO)
+ type: string
+ type: object
+ master:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ mount:
+ description: The configuration of Mount trait
+ properties:
+ configs:
+ description: 'A list of configuration pointing to configmap/secret.
+ The configuration are expected to be UTF-8 resources as
+ they are processed by runtime Camel Context and tried to
+ be parsed as property files. They are also made available
+ on the classpath in order to ease their usage directly from
+ the Route. Syntax: [configmap|secret]:name[/key], where
+ name represents the resource name and key optionally represents
+ the resource key to be filtered'
+ items:
+ type: string
+ type: array
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ resources:
+ description: 'A list of resources (text or binary content)
+ pointing to configmap/secret. The resources are expected
+ to be any resource type (text or binary content). The destination
+ path can be either a default location or any path specified
+ by the user. Syntax: [configmap|secret]:name[/key][@path],
+ where name represents the resource name, key optionally
+ represents the resource key to be filtered and path represents
+ the destination path'
+ items:
+ type: string
+ type: array
+ volumes:
+ description: 'A list of Persistent Volume Claims to be mounted.
+ Syntax: [pvcname:/container/path]'
+ items:
+ type: string
+ type: array
+ type: object
+ openapi:
+ description: The configuration of OpenAPI trait
+ properties:
+ configmaps:
+ description: The configmaps holding the spec of the OpenAPI
+ items:
+ type: string
+ type: array
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ owner:
+ description: The configuration of Owner trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ targetAnnotations:
+ description: The set of annotations to be transferred
+ items:
+ type: string
+ type: array
+ targetLabels:
+ description: The set of labels to be transferred
+ items:
+ type: string
+ type: array
+ type: object
+ pdb:
+ description: The configuration of PDB trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ maxUnavailable:
+ description: The number of pods for the Integration that can
+ be unavailable after an eviction. It can be either an absolute
+ number or a percentage (default `1` if `min-available` is
+ also not set). Only one of `max-unavailable` and `min-available`
+ can be specified.
+ type: string
+ minAvailable:
+ description: The number of pods for the Integration that must
+ still be available after an eviction. It can be either an
+ absolute number or a percentage. Only one of `min-available`
+ and `max-unavailable` can be specified.
+ type: string
+ type: object
+ platform:
+ description: The configuration of Platform trait
+ properties:
+ auto:
+ description: To automatically detect from the environment
+ if a default platform can be created (it will be created
+ on OpenShift only).
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ createDefault:
+ description: To create a default (empty) platform when the
+ platform is missing.
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ global:
+ description: Indicates if the platform should be created globally
+ in the case of global operator (default true).
+ type: boolean
+ type: object
+ pod:
+ description: The configuration of Pod trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ prometheus:
+ description: The configuration of Prometheus trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ podMonitor:
+ description: Whether a `PodMonitor` resource is created (default
+ `true`).
+ type: boolean
+ podMonitorLabels:
+ description: The `PodMonitor` resource labels, applicable
+ when `pod-monitor` is `true`.
+ items:
+ type: string
+ type: array
+ type: object
+ pull-secret:
+ description: The configuration of Pull Secret trait
+ properties:
+ auto:
+ description: Automatically configures the platform registry
+ secret on the pod if it is of type `kubernetes.io/dockerconfigjson`.
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ imagePullerDelegation:
+ description: When using a global operator with a shared platform,
+ this enables delegation of the `system:image-puller` cluster
+ role on the operator namespace to the integration service
+ account.
+ type: boolean
+ secretName:
+ description: The pull secret name to set on the Pod. If left
+ empty this is automatically taken from the `IntegrationPlatform`
+ registry configuration.
+ type: string
+ type: object
+ quarkus:
+ description: The configuration of Quarkus trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ packageTypes:
+ description: The Quarkus package types, either `fast-jar`
+ or `native` (default `fast-jar`). In case both `fast-jar`
+ and `native` are specified, two `IntegrationKit` resources
+ are created, with the `native` kit having precedence over
+ the `fast-jar` one once ready. The order influences the
+ resolution of the current kit for the integration. The kit
+ corresponding to the first package type will be assigned
+ to the integration in case no existing kit that matches
+ the integration exists.
+ items:
+ type: string
+ type: array
+ type: object
+ registry:
+ description: The configuration of Registry trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ route:
+ description: The configuration of Route trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ host:
+ description: To configure the host exposed by the route.
+ type: string
+ tlsCACertificate:
+ description: "The TLS CA certificate contents. \n Refer to
+ the OpenShift route documentation for additional information."
+ type: string
+ tlsCACertificateSecret:
+ description: "The secret name and key reference to the TLS
+ CA certificate. The format is \"secret-name[/key-name]\",
+ the value represents the secret name, if there is only one
+ key in the secret it will be read, otherwise you can set
+ a key name separated with a \"/\". \n Refer to the OpenShift
+ route documentation for additional information."
+ type: string
+ tlsCertificate:
+ description: "The TLS certificate contents. \n Refer to the
+ OpenShift route documentation for additional information."
+ type: string
+ tlsCertificateSecret:
+ description: "The secret name and key reference to the TLS
+ certificate. The format is \"secret-name[/key-name]\", the
+ value represents the secret name, if there is only one key
+ in the secret it will be read, otherwise you can set a key
+ name separated with a \"/\". \n Refer to the OpenShift route
+ documentation for additional information."
+ type: string
+ tlsDestinationCACertificate:
+ description: "The destination CA certificate provides the
+ contents of the ca certificate of the final destination.
+ \ When using reencrypt termination this file should be provided
+ in order to have routers use it for health checks on the
+ secure connection. If this field is not specified, the router
+ may provide its own destination CA and perform hostname
+ validation using the short service name (service.namespace.svc),
+ which allows infrastructure generated certificates to automatically
+ verify. \n Refer to the OpenShift route documentation for
+ additional information."
+ type: string
+ tlsDestinationCACertificateSecret:
+ description: "The secret name and key reference to the destination
+ CA certificate. The format is \"secret-name[/key-name]\",
+ the value represents the secret name, if there is only one
+ key in the secret it will be read, otherwise you can set
+ a key name separated with a \"/\". \n Refer to the OpenShift
+ route documentation for additional information."
+ type: string
+ tlsInsecureEdgeTerminationPolicy:
+ description: "To configure how to deal with insecure traffic,
+ e.g. `Allow`, `Disable` or `Redirect` traffic. \n Refer
+ to the OpenShift route documentation for additional information."
+ type: string
+ tlsKey:
+ description: "The TLS certificate key contents. \n Refer to
+ the OpenShift route documentation for additional information."
+ type: string
+ tlsKeySecret:
+ description: "The secret name and key reference to the TLS
+ certificate key. The format is \"secret-name[/key-name]\",
+ the value represents the secret name, if there is only one
+ key in the secret it will be read, otherwise you can set
+ a key name separated with a \"/\". \n Refer to the OpenShift
+ route documentation for additional information."
+ type: string
+ tlsTermination:
+ description: "The TLS termination type, like `edge`, `passthrough`
+ or `reencrypt`. \n Refer to the OpenShift route documentation
+ for additional information."
+ type: string
+ type: object
+ service:
+ description: The configuration of Service trait
+ properties:
+ auto:
+ description: To automatically detect from the code if a Service
+ needs to be created.
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ nodePort:
+ description: Enable Service to be exposed as NodePort (default
+ `false`).
+ type: boolean
+ type: object
+ service-binding:
+ description: The configuration of Service Binding trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ services:
+ description: List of Services in the form [[apigroup/]version:]kind:[namespace/]name
+ items:
+ type: string
+ type: array
+ type: object
+ strimzi:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ toleration:
+ description: The configuration of Toleration trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ taints:
+ description: The list of taints to tolerate, in the form `Key[=Value]:Effect[:Seconds]`
+ items:
+ type: string
+ type: array
+ type: object
+ tracing:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
type: object
type: object
status:
diff --git a/config/crd/bases/camel.apache.org_kameletbindings.yaml b/config/crd/bases/camel.apache.org_kameletbindings.yaml
index 549e42c83..c8e451d32 100644
--- a/config/crd/bases/camel.apache.org_kameletbindings.yaml
+++ b/config/crd/bases/camel.apache.org_kameletbindings.yaml
@@ -6125,17 +6125,1280 @@ spec:
type: object
type: object
traits:
- additionalProperties:
- description: A TraitSpec contains the configuration of a trait
- properties:
- configuration:
- description: TraitConfiguration parameters configuration
+ description: the traits needed to run this Integration
+ properties:
+ 3scale:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ addons:
+ additionalProperties:
+ description: AddonTrait represents the configuration of
+ an addon trait
type: object
x-kubernetes-preserve-unknown-fields: true
- required:
- - configuration
- type: object
- description: the traits needed to run this Integration
+ description: The extension point with addon traits
+ type: object
+ affinity:
+ description: The configuration of Affinity trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ nodeAffinityLabels:
+ description: Defines a set of nodes the integration pod(s)
+ are eligible to be scheduled on, based on labels on
+ the node.
+ items:
+ type: string
+ type: array
+ podAffinity:
+ description: Always co-locates multiple replicas of the
+ integration in the same node (default *false*).
+ type: boolean
+ podAffinityLabels:
+ description: Defines a set of pods (namely those matching
+ the label selector, relative to the given namespace)
+ that the integration pod(s) should be co-located with.
+ items:
+ type: string
+ type: array
+ podAntiAffinity:
+ description: Never co-locates multiple replicas of the
+ integration in the same node (default *false*).
+ type: boolean
+ podAntiAffinityLabels:
+ description: Defines a set of pods (namely those matching
+ the label selector, relative to the given namespace)
+ that the integration pod(s) should not be co-located
+ with.
+ items:
+ type: string
+ type: array
+ type: object
+ builder:
+ description: The configuration of Builder trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ properties:
+ description: A list of properties to be provided to the
+ build task
+ items:
+ type: string
+ type: array
+ verbose:
+ description: Enable verbose logging on build components
+ that support it (e.g. Kaniko build pod).
+ type: boolean
+ type: object
+ camel:
+ description: The configuration of Camel trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ properties:
+ description: A list of properties to be provided to the
+ Integration runtime
+ items:
+ type: string
+ type: array
+ runtimeVersion:
+ description: The camel-k-runtime version to use for the
+ integration. It overrides the default version set in
+ the Integration Platform.
+ type: string
+ type: object
+ container:
+ description: The configuration of Container trait
+ properties:
+ auto:
+ description: To automatically enable the trait
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ expose:
+ description: Can be used to enable/disable exposure via
+ kubernetes Service.
+ type: boolean
+ image:
+ description: The main container image
+ type: string
+ imagePullPolicy:
+ description: 'The pull policy: Always|Never|IfNotPresent'
+ type: string
+ limitCPU:
+ description: The maximum amount of CPU required.
+ type: string
+ limitMemory:
+ description: The maximum amount of memory required.
+ type: string
+ livenessFailureThreshold:
+ description: 'Minimum consecutive failures for the probe
+ to be considered failed after having succeeded. Applies
+ to the liveness probe. Deprecated: replaced by the health
+ trait.'
+ format: int32
+ type: integer
+ livenessInitialDelay:
+ description: 'Number of seconds after the container has
+ started before liveness probes are initiated. Deprecated:
+ replaced by the health trait.'
+ format: int32
+ type: integer
+ livenessPeriod:
+ description: 'How often to perform the probe. Applies
+ to the liveness probe. Deprecated: replaced by the health
+ trait.'
+ format: int32
+ type: integer
+ livenessScheme:
+ description: 'Scheme to use when connecting. Defaults
+ to HTTP. Applies to the liveness probe. Deprecated:
+ replaced by the health trait.'
+ type: string
+ livenessSuccessThreshold:
+ description: 'Minimum consecutive successes for the probe
+ to be considered successful after having failed. Applies
+ to the liveness probe. Deprecated: replaced by the health
+ trait.'
+ format: int32
+ type: integer
+ livenessTimeout:
+ description: 'Number of seconds after which the probe
+ times out. Applies to the liveness probe. Deprecated:
+ replaced by the health trait.'
+ format: int32
+ type: integer
+ name:
+ description: The main container name. It's named `integration`
+ by default.
+ type: string
+ port:
+ description: To configure a different port exposed by
+ the container (default `8080`).
+ type: integer
+ portName:
+ description: To configure a different port name for the
+ port exposed by the container. It defaults to `http`
+ only when the `expose` parameter is true.
+ type: string
+ probesEnabled:
+ description: 'DeprecatedProbesEnabled enable/disable probes
+ on the container (default `false`) Deprecated: replaced
+ by the health trait.'
+ type: boolean
+ readinessFailureThreshold:
+ description: 'Minimum consecutive failures for the probe
+ to be considered failed after having succeeded. Applies
+ to the readiness probe. Deprecated: replaced by the
+ health trait.'
+ format: int32
+ type: integer
+ readinessInitialDelay:
+ description: 'Number of seconds after the container has
+ started before readiness probes are initiated. Deprecated:
+ replaced by the health trait.'
+ format: int32
+ type: integer
+ readinessPeriod:
+ description: 'How often to perform the probe. Applies
+ to the readiness probe. Deprecated: replaced by the
+ health trait.'
+ format: int32
+ type: integer
+ readinessScheme:
+ description: 'Scheme to use when connecting. Defaults
+ to HTTP. Applies to the readiness probe. Deprecated:
+ replaced by the health trait.'
+ type: string
+ readinessSuccessThreshold:
+ description: 'Minimum consecutive successes for the probe
+ to be considered successful after having failed. Applies
+ to the readiness probe. Deprecated: replaced by the
+ health trait.'
+ format: int32
+ type: integer
+ readinessTimeout:
+ description: 'Number of seconds after which the probe
+ times out. Applies to the readiness probe. Deprecated:
+ replaced by the health trait.'
+ format: int32
+ type: integer
+ requestCPU:
+ description: The minimum amount of CPU required.
+ type: string
+ requestMemory:
+ description: The minimum amount of memory required.
+ type: string
+ servicePort:
+ description: To configure under which service port the
+ container port is to be exposed (default `80`).
+ type: integer
+ servicePortName:
+ description: To configure under which service port name
+ the container port is to be exposed (default `http`).
+ type: string
+ type: object
+ cron:
+ description: The configuration of Cron trait
+ properties:
+ activeDeadlineSeconds:
+ description: Specifies the duration in seconds, relative
+ to the start time, that the job may be continuously
+ active before it is considered to be failed. It defaults
+ to 60s.
+ format: int64
+ type: integer
+ auto:
+ description: "Automatically deploy the integration as
+ CronJob when all routes are either starting from a periodic
+ consumer (only `cron`, `timer` and `quartz` are supported)
+ or a passive consumer (e.g. `direct` is a passive consumer).
+ \n It's required that all periodic consumers have the
+ same period and it can be expressed as cron schedule
+ (e.g. `1m` can be expressed as `0/1 * * * *`, while
+ `35m` or `50s` cannot)."
+ type: boolean
+ backoffLimit:
+ description: Specifies the number of retries before marking
+ the job failed. It defaults to 2.
+ format: int32
+ type: integer
+ components:
+ description: "A comma separated list of the Camel components
+ that need to be customized in order for them to work
+ when the schedule is triggered externally by Kubernetes.
+ A specific customizer is activated for each specified
+ component. E.g. for the `timer` component, the `cron-timer`
+ customizer is activated (it's present in the `org.apache.camel.k:camel-k-cron`
+ library). \n Supported components are currently: `cron`,
+ `timer` and `quartz`."
+ type: string
+ concurrencyPolicy:
+ description: 'Specifies how to treat concurrent executions
+ of a Job. Valid values are: - "Allow": allows CronJobs
+ to run concurrently; - "Forbid" (default): forbids concurrent
+ runs, skipping next run if previous run hasn''t finished
+ yet; - "Replace": cancels currently running job and
+ replaces it with a new one'
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ fallback:
+ description: Use the default Camel implementation of the
+ `cron` endpoint (`quartz`) instead of trying to materialize
+ the integration as Kubernetes CronJob.
+ type: boolean
+ schedule:
+ description: The CronJob schedule for the whole integration.
+ If multiple routes are declared, they must have the
+ same schedule for this mechanism to work correctly.
+ type: string
+ startingDeadlineSeconds:
+ description: Optional deadline in seconds for starting
+ the job if it misses scheduled time for any reason. Missed
+ jobs executions will be counted as failed ones.
+ format: int64
+ type: integer
+ type: object
+ dependencies:
+ description: The configuration of Dependencies trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ type: object
+ deployer:
+ description: The configuration of Deployer trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ kind:
+ description: Allows to explicitly select the desired deployment
+ kind between `deployment`, `cron-job` or `knative-service`
+ when creating the resources for running the integration.
+ type: string
+ useSSA:
+ description: Use server-side apply to update the owned
+ resources (default `true`). Note that it automatically
+ falls back to client-side patching, if SSA is not available,
+ e.g., on old Kubernetes clusters.
+ type: boolean
+ type: object
+ deployment:
+ description: The configuration of Deployment trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ progressDeadlineSeconds:
+ description: The maximum time in seconds for the deployment
+ to make progress before it is considered to be failed.
+ It defaults to 60s.
+ format: int32
+ type: integer
+ type: object
+ environment:
+ description: The configuration of Environment trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ containerMeta:
+ description: Enables injection of `NAMESPACE` and `POD_NAME`
+ environment variables (default `true`)
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ httpProxy:
+ description: Propagates the `HTTP_PROXY`, `HTTPS_PROXY`
+ and `NO_PROXY` environment variables (default `true`)
+ type: boolean
+ vars:
+ description: A list of environment variables to be added
+ to the integration container. The syntax is KEY=VALUE,
+ e.g., `MY_VAR="my value"`. These take precedence over
+ the previously defined environment variables.
+ items:
+ type: string
+ type: array
+ type: object
+ error-handler:
+ description: The configuration of Error Handler trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ ref:
+ description: The error handler ref name provided or found
+ in application properties
+ type: string
+ type: object
+ gc:
+ description: The configuration of GC trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ discoveryCache:
+ description: Discovery client cache to be used, either
+ `disabled`, `disk` or `memory` (default `memory`)
+ type: string
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ type: object
+ health:
+ description: The configuration of Health trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ livenessFailureThreshold:
+ description: Minimum consecutive failures for the liveness
+ probe to be considered failed after having succeeded.
+ format: int32
+ type: integer
+ livenessInitialDelay:
+ description: Number of seconds after the container has
+ started before the liveness probe is initiated.
+ format: int32
+ type: integer
+ livenessPeriod:
+ description: How often to perform the liveness probe.
+ format: int32
+ type: integer
+ livenessProbeEnabled:
+ description: Configures the liveness probe for the integration
+ container (default `false`).
+ type: boolean
+ livenessScheme:
+ description: Scheme to use when connecting to the liveness
+ probe (default `HTTP`).
+ type: string
+ livenessSuccessThreshold:
+ description: Minimum consecutive successes for the liveness
+ probe to be considered successful after having failed.
+ format: int32
+ type: integer
+ livenessTimeout:
+ description: Number of seconds after which the liveness
+ probe times out.
+ format: int32
+ type: integer
+ readinessFailureThreshold:
+ description: Minimum consecutive failures for the readiness
+ probe to be considered failed after having succeeded.
+ format: int32
+ type: integer
+ readinessInitialDelay:
+ description: Number of seconds after the container has
+ started before the readiness probe is initiated.
+ format: int32
+ type: integer
+ readinessPeriod:
+ description: How often to perform the readiness probe.
+ format: int32
+ type: integer
+ readinessProbeEnabled:
+ description: Configures the readiness probe for the integration
+ container (default `true`).
+ type: boolean
+ readinessScheme:
+ description: Scheme to use when connecting to the readiness
+ probe (default `HTTP`).
+ type: string
+ readinessSuccessThreshold:
+ description: Minimum consecutive successes for the readiness
+ probe to be considered successful after having failed.
+ format: int32
+ type: integer
+ readinessTimeout:
+ description: Number of seconds after which the readiness
+ probe times out.
+ format: int32
+ type: integer
+ type: object
+ ingress:
+ description: The configuration of Ingress trait
+ properties:
+ auto:
+ description: To automatically add an ingress whenever
+ the integration uses a HTTP endpoint consumer.
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ host:
+ description: '**Required**. To configure the host exposed
+ by the ingress.'
+ type: string
+ type: object
+ istio:
+ description: The configuration of Istio trait
+ properties:
+ allow:
+ description: Configures a (comma-separated) list of CIDR
+ subnets that should not be intercepted by the Istio
+ proxy (`10.0.0.0/8,172.16.0.0/12,192.168.0.0/16` by
+ default).
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ inject:
+ description: Forces the value for labels `sidecar.istio.io/inject`.
+ By default the label is set to `true` on deployment
+ and not set on Knative Service.
+ type: boolean
+ type: object
+ jolokia:
+ description: The configuration of Jolokia trait
+ properties:
+ CACert:
+ description: The PEM encoded CA certification file path,
+ used to verify client certificates, applicable when
+ `protocol` is `https` and `use-ssl-client-authentication`
+ is `true` (default `/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt`
+ for OpenShift).
+ type: string
+ clientPrincipal:
+ description: The principal(s) which must be given in a
+ client certificate to allow access to the Jolokia endpoint,
+ applicable when `protocol` is `https` and `use-ssl-client-authentication`
+ is `true` (default `clientPrincipal=cn=system:master-proxy`,
+ `cn=hawtio-online.hawtio.svc` and `cn=fuse-console.fuse.svc`
+ for OpenShift).
+ items:
+ type: string
+ type: array
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ discoveryEnabled:
+ description: Listen for multicast requests (default `false`)
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ extendedClientCheck:
+ description: Mandate the client certificate contains a
+ client flag in the extended key usage section, applicable
+ when `protocol` is `https` and `use-ssl-client-authentication`
+ is `true` (default `true` for OpenShift).
+ type: boolean
+ host:
+ description: The Host address to which the Jolokia agent
+ should bind to. If `"\*"` or `"0.0.0.0"` is given, the
+ servers binds to every network interface (default `"*"`).
+ type: string
+ options:
+ description: A list of additional Jolokia options as defined
+ in https://jolokia.org/reference/html/agents.html#agent-jvm-config[JVM
+ agent configuration options]
+ items:
+ type: string
+ type: array
+ password:
+ description: The password used for authentication, applicable
+ when the `user` option is set.
+ type: string
+ port:
+ description: The Jolokia endpoint port (default `8778`).
+ type: integer
+ protocol:
+ description: The protocol to use, either `http` or `https`
+ (default `https` for OpenShift)
+ type: string
+ useSSLClientAuthentication:
+ description: Whether client certificates should be used
+ for authentication (default `true` for OpenShift).
+ type: boolean
+ user:
+ description: The user to be used for authentication
+ type: string
+ type: object
+ jvm:
+ description: The configuration of JVM trait
+ properties:
+ classpath:
+ description: Additional JVM classpath (use `Linux` classpath
+ separator)
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ debug:
+ description: Activates remote debugging, so that a debugger
+ can be attached to the JVM, e.g., using port-forwarding
+ type: boolean
+ debugAddress:
+ description: Transport address at which to listen for
+ the newly launched JVM (default `*:5005`)
+ type: string
+ debugSuspend:
+ description: Suspends the target JVM immediately before
+ the main class is loaded
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ options:
+ description: A list of JVM options
+ items:
+ type: string
+ type: array
+ printCommand:
+ description: Prints the command used the start the JVM
+ in the container logs (default `true`)
+ type: boolean
+ type: object
+ kamelets:
+ description: The configuration of Kamelets trait
+ properties:
+ auto:
+ description: Automatically inject all referenced Kamelets
+ and their default configuration (enabled by default)
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ list:
+ description: Comma separated list of Kamelet names to
+ load into the current integration
+ type: string
+ type: object
+ keda:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ knative:
+ description: The configuration of Knative trait
+ properties:
+ auto:
+ description: Enable automatic discovery of all trait properties.
+ type: boolean
+ channelSinks:
+ description: List of channels used as destination of integration
+ routes. Can contain simple channel names or full Camel
+ URIs.
+ items:
+ type: string
+ type: array
+ channelSources:
+ description: List of channels used as source of integration
+ routes. Can contain simple channel names or full Camel
+ URIs.
+ items:
+ type: string
+ type: array
+ config:
+ description: Can be used to inject a Knative complete
+ configuration in JSON format.
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ endpointSinks:
+ description: List of endpoints used as destination of
+ integration routes. Can contain simple endpoint names
+ or full Camel URIs.
+ items:
+ type: string
+ type: array
+ endpointSources:
+ description: List of channels used as source of integration
+ routes.
+ items:
+ type: string
+ type: array
+ eventSinks:
+ description: List of event types that the integration
+ will produce. Can contain simple event types or full
+ Camel URIs (to use a specific broker).
+ items:
+ type: string
+ type: array
+ eventSources:
+ description: List of event types that the integration
+ will be subscribed to. Can contain simple event types
+ or full Camel URIs (to use a specific broker different
+ from "default").
+ items:
+ type: string
+ type: array
+ filterSourceChannels:
+ description: Enables filtering on events based on the
+ header "ce-knativehistory". Since this header has been
+ removed in newer versions of Knative, filtering is disabled
+ by default.
+ type: boolean
+ sinkBinding:
+ description: Allows binding the integration to a sink
+ via a Knative SinkBinding resource. This can be used
+ when the integration targets a single sink. It's enabled
+ by default when the integration targets a single sink
+ (except when the integration is owned by a Knative source).
+ type: boolean
+ type: object
+ knative-service:
+ description: The configuration of Knative Service trait
+ properties:
+ auto:
+ description: "Automatically deploy the integration as
+ Knative service when all conditions hold: \n * Integration
+ is using the Knative profile * All routes are either
+ starting from a HTTP based consumer or a passive consumer
+ (e.g. `direct` is a passive consumer)"
+ type: boolean
+ autoscalingMetric:
+ description: "Configures the Knative autoscaling metric
+ property (e.g. to set `concurrency` based or `cpu` based
+ autoscaling). \n Refer to the Knative documentation
+ for more information."
+ type: string
+ autoscalingTarget:
+ description: "Sets the allowed concurrency level or CPU
+ percentage (depending on the autoscaling metric) for
+ each Pod. \n Refer to the Knative documentation for
+ more information."
+ type: integer
+ class:
+ description: "Configures the Knative autoscaling class
+ property (e.g. to set `hpa.autoscaling.knative.dev`
+ or `kpa.autoscaling.knative.dev` autoscaling). \n Refer
+ to the Knative documentation for more information."
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ maxScale:
+ description: "An upper bound for the number of Pods that
+ can be running in parallel for the integration. Knative
+ has its own cap value that depends on the installation.
+ \n Refer to the Knative documentation for more information."
+ type: integer
+ minScale:
+ description: "The minimum number of Pods that should be
+ running at any time for the integration. It's **zero**
+ by default, meaning that the integration is scaled down
+ to zero when not used for a configured amount of time.
+ \n Refer to the Knative documentation for more information."
+ type: integer
+ rolloutDuration:
+ description: Enables to gradually shift traffic to the
+ latest Revision and sets the rollout duration. It's
+ disabled by default and must be expressed as a Golang
+ `time.Duration` string representation, rounded to a
+ second precision.
+ type: string
+ type: object
+ logging:
+ description: The configuration of Logging trait
+ properties:
+ color:
+ description: Colorize the log output
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ format:
+ description: Logs message format
+ type: string
+ json:
+ description: Output the logs in JSON
+ type: boolean
+ jsonPrettyPrint:
+ description: Enable "pretty printing" of the JSON logs
+ type: boolean
+ level:
+ description: Adjust the logging level (defaults to INFO)
+ type: string
+ type: object
+ master:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ mount:
+ description: The configuration of Mount trait
+ properties:
+ configs:
+ description: 'A list of configuration pointing to configmap/secret.
+ The configuration are expected to be UTF-8 resources
+ as they are processed by runtime Camel Context and tried
+ to be parsed as property files. They are also made available
+ on the classpath in order to ease their usage directly
+ from the Route. Syntax: [configmap|secret]:name[/key],
+ where name represents the resource name and key optionally
+ represents the resource key to be filtered'
+ items:
+ type: string
+ type: array
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ resources:
+ description: 'A list of resources (text or binary content)
+ pointing to configmap/secret. The resources are expected
+ to be any resource type (text or binary content). The
+ destination path can be either a default location or
+ any path specified by the user. Syntax: [configmap|secret]:name[/key][@path],
+ where name represents the resource name, key optionally
+ represents the resource key to be filtered and path
+ represents the destination path'
+ items:
+ type: string
+ type: array
+ volumes:
+ description: 'A list of Persistent Volume Claims to be
+ mounted. Syntax: [pvcname:/container/path]'
+ items:
+ type: string
+ type: array
+ type: object
+ openapi:
+ description: The configuration of OpenAPI trait
+ properties:
+ configmaps:
+ description: The configmaps holding the spec of the OpenAPI
+ items:
+ type: string
+ type: array
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ type: object
+ owner:
+ description: The configuration of Owner trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ targetAnnotations:
+ description: The set of annotations to be transferred
+ items:
+ type: string
+ type: array
+ targetLabels:
+ description: The set of labels to be transferred
+ items:
+ type: string
+ type: array
+ type: object
+ pdb:
+ description: The configuration of PDB trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ maxUnavailable:
+ description: The number of pods for the Integration that
+ can be unavailable after an eviction. It can be either
+ an absolute number or a percentage (default `1` if `min-available`
+ is also not set). Only one of `max-unavailable` and
+ `min-available` can be specified.
+ type: string
+ minAvailable:
+ description: The number of pods for the Integration that
+ must still be available after an eviction. It can be
+ either an absolute number or a percentage. Only one
+ of `min-available` and `max-unavailable` can be specified.
+ type: string
+ type: object
+ platform:
+ description: The configuration of Platform trait
+ properties:
+ auto:
+ description: To automatically detect from the environment
+ if a default platform can be created (it will be created
+ on OpenShift only).
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ createDefault:
+ description: To create a default (empty) platform when
+ the platform is missing.
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ global:
+ description: Indicates if the platform should be created
+ globally in the case of global operator (default true).
+ type: boolean
+ type: object
+ pod:
+ description: The configuration of Pod trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ type: object
+ prometheus:
+ description: The configuration of Prometheus trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ podMonitor:
+ description: Whether a `PodMonitor` resource is created
+ (default `true`).
+ type: boolean
+ podMonitorLabels:
+ description: The `PodMonitor` resource labels, applicable
+ when `pod-monitor` is `true`.
+ items:
+ type: string
+ type: array
+ type: object
+ pull-secret:
+ description: The configuration of Pull Secret trait
+ properties:
+ auto:
+ description: Automatically configures the platform registry
+ secret on the pod if it is of type `kubernetes.io/dockerconfigjson`.
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ imagePullerDelegation:
+ description: When using a global operator with a shared
+ platform, this enables delegation of the `system:image-puller`
+ cluster role on the operator namespace to the integration
+ service account.
+ type: boolean
+ secretName:
+ description: The pull secret name to set on the Pod. If
+ left empty this is automatically taken from the `IntegrationPlatform`
+ registry configuration.
+ type: string
+ type: object
+ quarkus:
+ description: The configuration of Quarkus trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ packageTypes:
+ description: The Quarkus package types, either `fast-jar`
+ or `native` (default `fast-jar`). In case both `fast-jar`
+ and `native` are specified, two `IntegrationKit` resources
+ are created, with the `native` kit having precedence
+ over the `fast-jar` one once ready. The order influences
+ the resolution of the current kit for the integration.
+ The kit corresponding to the first package type will
+ be assigned to the integration in case no existing kit
+ that matches the integration exists.
+ items:
+ type: string
+ type: array
+ type: object
+ registry:
+ description: The configuration of Registry trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ type: object
+ route:
+ description: The configuration of Route trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ host:
+ description: To configure the host exposed by the route.
+ type: string
+ tlsCACertificate:
+ description: "The TLS CA certificate contents. \n Refer
+ to the OpenShift route documentation for additional
+ information."
+ type: string
+ tlsCACertificateSecret:
+ description: "The secret name and key reference to the
+ TLS CA certificate. The format is \"secret-name[/key-name]\",
+ the value represents the secret name, if there is only
+ one key in the secret it will be read, otherwise you
+ can set a key name separated with a \"/\". \n Refer
+ to the OpenShift route documentation for additional
+ information."
+ type: string
+ tlsCertificate:
+ description: "The TLS certificate contents. \n Refer to
+ the OpenShift route documentation for additional information."
+ type: string
+ tlsCertificateSecret:
+ description: "The secret name and key reference to the
+ TLS certificate. The format is \"secret-name[/key-name]\",
+ the value represents the secret name, if there is only
+ one key in the secret it will be read, otherwise you
+ can set a key name separated with a \"/\". \n Refer
+ to the OpenShift route documentation for additional
+ information."
+ type: string
+ tlsDestinationCACertificate:
+ description: "The destination CA certificate provides
+ the contents of the ca certificate of the final destination.
+ \ When using reencrypt termination this file should
+ be provided in order to have routers use it for health
+ checks on the secure connection. If this field is not
+ specified, the router may provide its own destination
+ CA and perform hostname validation using the short service
+ name (service.namespace.svc), which allows infrastructure
+ generated certificates to automatically verify. \n Refer
+ to the OpenShift route documentation for additional
+ information."
+ type: string
+ tlsDestinationCACertificateSecret:
+ description: "The secret name and key reference to the
+ destination CA certificate. The format is \"secret-name[/key-name]\",
+ the value represents the secret name, if there is only
+ one key in the secret it will be read, otherwise you
+ can set a key name separated with a \"/\". \n Refer
+ to the OpenShift route documentation for additional
+ information."
+ type: string
+ tlsInsecureEdgeTerminationPolicy:
+ description: "To configure how to deal with insecure traffic,
+ e.g. `Allow`, `Disable` or `Redirect` traffic. \n Refer
+ to the OpenShift route documentation for additional
+ information."
+ type: string
+ tlsKey:
+ description: "The TLS certificate key contents. \n Refer
+ to the OpenShift route documentation for additional
+ information."
+ type: string
+ tlsKeySecret:
+ description: "The secret name and key reference to the
+ TLS certificate key. The format is \"secret-name[/key-name]\",
+ the value represents the secret name, if there is only
+ one key in the secret it will be read, otherwise you
+ can set a key name separated with a \"/\". \n Refer
+ to the OpenShift route documentation for additional
+ information."
+ type: string
+ tlsTermination:
+ description: "The TLS termination type, like `edge`, `passthrough`
+ or `reencrypt`. \n Refer to the OpenShift route documentation
+ for additional information."
+ type: string
+ type: object
+ service:
+ description: The configuration of Service trait
+ properties:
+ auto:
+ description: To automatically detect from the code if
+ a Service needs to be created.
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ nodePort:
+ description: Enable Service to be exposed as NodePort
+ (default `false`).
+ type: boolean
+ type: object
+ service-binding:
+ description: The configuration of Service Binding trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ services:
+ description: List of Services in the form [[apigroup/]version:]kind:[namespace/]name
+ items:
+ type: string
+ type: array
+ type: object
+ strimzi:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ toleration:
+ description: The configuration of Toleration trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait.
+ All traits share this common property.
+ type: boolean
+ taints:
+ description: The list of taints to tolerate, in the form
+ `Key[=Value]:Effect[:Seconds]`
+ items:
+ type: string
+ type: array
+ type: object
+ tracing:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
type: object
type: object
replicas:
diff --git a/docs/modules/traits/pages/container.adoc b/docs/modules/traits/pages/container.adoc
index f5be96f2c..e2f6aa9bf 100755
--- a/docs/modules/traits/pages/container.adoc
+++ b/docs/modules/traits/pages/container.adoc
@@ -31,7 +31,7 @@ The following configuration options are available:
| container.auto
| bool
-|
+| To automatically enable the trait
| container.request-cpu
| string
diff --git a/docs/modules/traits/pages/gc.adoc b/docs/modules/traits/pages/gc.adoc
index c7a9ee825..88af7ba26 100755
--- a/docs/modules/traits/pages/gc.adoc
+++ b/docs/modules/traits/pages/gc.adoc
@@ -26,7 +26,7 @@ The following configuration options are available:
| Can be used to enable or disable a trait. All traits share this common property.
| gc.discovery-cache
-| github.com/apache/camel-k/pkg/trait.discoveryCacheType
+| github.com/apache/camel-k/pkg/apis/camel/v1/trait.DiscoveryCacheType
| Discovery client cache to be used, either `disabled`, `disk` or `memory` (default `memory`)
|===
diff --git a/docs/modules/traits/pages/quarkus.adoc b/docs/modules/traits/pages/quarkus.adoc
index e9d579e10..595572dd6 100755
--- a/docs/modules/traits/pages/quarkus.adoc
+++ b/docs/modules/traits/pages/quarkus.adoc
@@ -36,7 +36,7 @@ The following configuration options are available:
| Can be used to enable or disable a trait. All traits share this common property.
| quarkus.package-type
-| []github.com/apache/camel-k/pkg/trait.quarkusPackageType
+| []github.com/apache/camel-k/pkg/apis/camel/v1/trait.QuarkusPackageType
| The Quarkus package types, either `fast-jar` or `native` (default `fast-jar`).
In case both `fast-jar` and `native` are specified, two `IntegrationKit` resources are created,
with the `native` kit having precedence over the `fast-jar` one once ready.
diff --git a/docs/modules/traits/pages/service-binding.adoc b/docs/modules/traits/pages/service-binding.adoc
index 79a0b40fe..ac4e88cee 100755
--- a/docs/modules/traits/pages/service-binding.adoc
+++ b/docs/modules/traits/pages/service-binding.adoc
@@ -3,7 +3,8 @@
// Start of autogenerated code - DO NOT EDIT! (description)
The Service Binding trait allows users to connect to Services in Kubernetes:
https://github.com/k8s-service-bindings/spec#service-binding
-As the specification is still evolving this is subject to change
+As the specification is still evolving this is subject to change.
+
This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.
diff --git a/go.mod b/go.mod
index c28f89e8b..4ee008a89 100644
--- a/go.mod
+++ b/go.mod
@@ -57,7 +57,7 @@ require (
k8s.io/gengo v0.0.0-20211129171323-c02415ce4185
k8s.io/klog/v2 v2.40.1
k8s.io/kubectl v0.22.5
- k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9
+ k8s.io/utils v0.0.0-20211208161948-7d6a63dca704
knative.dev/eventing v0.29.0
knative.dev/pkg v0.0.0-20220118160532-77555ea48cd4
knative.dev/serving v0.29.0
diff --git a/go.sum b/go.sum
index 9783c2877..5bc79daf9 100644
--- a/go.sum
+++ b/go.sum
@@ -2134,9 +2134,8 @@ k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
+k8s.io/utils v0.0.0-20211208161948-7d6a63dca704 h1:ZKMMxTvduyf5WUtREOqg5LiXaN1KO/+0oOQPRFrClpo=
k8s.io/utils v0.0.0-20211208161948-7d6a63dca704/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
-k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc=
-k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
knative.dev/caching v0.0.0-20220118175933-0c1cc094a7f4/go.mod h1:OHsK3XaWmdi2/mPaNBiX8LbefbtM6TptnT90eVbYGSA=
knative.dev/eventing v0.29.0 h1:+AhcYEuuz37x1op71bknZ/lFgsvuZJl0AKFOOFiH03s=
knative.dev/eventing v0.29.0/go.mod h1:u5T5NZTDUsLR7yJwp5MDnBnDX5MhywD3yK3Rq+7gTtI=
diff --git a/helm/camel-k/crds/crd-integration-kit.yaml b/helm/camel-k/crds/crd-integration-kit.yaml
index ca5c8f90f..06e61aaf3 100644
--- a/helm/camel-k/crds/crd-integration-kit.yaml
+++ b/helm/camel-k/crds/crd-integration-kit.yaml
@@ -111,7 +111,7 @@ spec:
type: string
type: array
image:
- description: the container image as identify in the container registry
+ description: the container image as identified in the container registry
type: string
profile:
description: the profile which is expected by this kit
@@ -122,17 +122,73 @@ spec:
type: string
type: array
traits:
- additionalProperties:
- description: A TraitSpec contains the configuration of a trait
- properties:
- configuration:
- description: TraitConfiguration parameters configuration
+ description: traits that the kit will execute
+ properties:
+ addons:
+ additionalProperties:
+ description: AddonTrait represents the configuration of an addon
+ trait
type: object
x-kubernetes-preserve-unknown-fields: true
- required:
- - configuration
- type: object
- description: traits that the kit will execute
+ description: The collection of addon trait configurations
+ type: object
+ builder:
+ description: The builder trait is internally used to determine
+ the best strategy to build and configure IntegrationKits.
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ properties:
+ description: A list of properties to be provided to the build
+ task
+ items:
+ type: string
+ type: array
+ verbose:
+ description: Enable verbose logging on build components that
+ support it (e.g. Kaniko build pod).
+ type: boolean
+ type: object
+ quarkus:
+ description: 'The Quarkus trait configures the Quarkus runtime.
+ It''s enabled by default. NOTE: Compiling to a native executable,
+ i.e. when using `package-type=native`, is only supported for
+ kamelets, as well as YAML and XML integrations. It also requires
+ at least 4GiB of memory, so the Pod running the native build,
+ that is either the operator Pod, or the build Pod (depending
+ on the build strategy configured for the platform), must have
+ enough memory available.'
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ packageTypes:
+ description: The Quarkus package types, either `fast-jar`
+ or `native` (default `fast-jar`). In case both `fast-jar`
+ and `native` are specified, two `IntegrationKit` resources
+ are created, with the `native` kit having precedence over
+ the `fast-jar` one once ready. The order influences the
+ resolution of the current kit for the integration. The kit
+ corresponding to the first package type will be assigned
+ to the integration in case no existing kit that matches
+ the integration exists.
+ items:
+ type: string
+ type: array
+ type: object
type: object
type: object
status:
diff --git a/helm/camel-k/crds/crd-integration-platform.yaml b/helm/camel-k/crds/crd-integration-platform.yaml
index d83005fbe..716a18b7e 100644
--- a/helm/camel-k/crds/crd-integration-platform.yaml
+++ b/helm/camel-k/crds/crd-integration-platform.yaml
@@ -367,255 +367,1495 @@ spec:
description: 'Deprecated: not used'
type: object
traits:
- additionalProperties:
- description: A TraitSpec contains the configuration of a trait
- properties:
- configuration:
- description: TraitConfiguration parameters configuration
- type: object
- x-kubernetes-preserve-unknown-fields: true
- required:
- - configuration
- type: object
description: list of traits to be executed for all the Integration/IntegrationKits
built from this IntegrationPlatform
- type: object
- type: object
- status:
- description: IntegrationPlatformStatus defines the observed state of IntegrationPlatform
- properties:
- build:
- description: specify how to build the Integration/IntegrationKits
properties:
- PublishStrategyOptions:
+ 3scale:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ addons:
additionalProperties:
- type: string
+ description: AddonTrait represents the configuration of an addon
+ trait
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ description: The extension point with addon traits
type: object
- baseImage:
- description: a base image that can be used as base layer for all
- images. It can be useful if you want to provide some custom
- base image with further utility softwares
- type: string
- buildStrategy:
- description: the strategy to adopt for building an Integration
- base image
- enum:
- - routine
- - pod
- type: string
- kanikoBuildCache:
- description: 'Deprecated: Use PublishStrategyOptions instead enables
- Kaniko publish strategy cache'
- type: boolean
- maven:
- description: Maven configuration used to build the Camel/Camel-Quarkus
- applications
+ affinity:
+ description: The configuration of Affinity trait
properties:
- caSecret:
- description: 'Deprecated: use CASecrets The Secret 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.'
- 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
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
type: object
- caSecrets:
- description: 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.
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ nodeAffinityLabels:
+ description: Defines a set of nodes the integration pod(s)
+ are eligible to be scheduled on, based on labels on the
+ node.
items:
- description: SecretKeySelector 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: string
type: array
- cliOptions:
- description: 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.8.4/maven-embedder/cli.html.
+ podAffinity:
+ description: Always co-locates multiple replicas of the integration
+ in the same node (default *false*).
+ type: boolean
+ podAffinityLabels:
+ description: Defines a set of pods (namely those matching
+ the label selector, relative to the given namespace) that
+ the integration pod(s) should be co-located with.
items:
type: string
type: array
- extension:
- description: The Maven build extensions. See https://maven.apache.org/guides/mini/guide-using-extensions.html.
+ podAntiAffinity:
+ description: Never co-locates multiple replicas of the integration
+ in the same node (default *false*).
+ type: boolean
+ podAntiAffinityLabels:
+ description: Defines a set of pods (namely those matching
+ the label selector, relative to the given namespace) that
+ the integration pod(s) should not be co-located with.
items:
- description: MavenArtifact defines a GAV (Group:Artifact:Version)
- Maven artifact
- properties:
- artifactId:
- description: Maven Artifact
- type: string
- groupId:
- description: Maven Group
- type: string
- version:
- description: Maven Version
- type: string
- required:
- - artifactId
- - groupId
- type: object
+ type: string
type: array
- localRepository:
- description: The path of the local Maven repository.
- type: string
+ type: object
+ builder:
+ description: The configuration of Builder trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
properties:
- additionalProperties:
+ description: A list of properties to be provided to the build
+ task
+ items:
type: string
- description: The Maven properties.
- type: object
- settings:
- description: A reference to the ConfigMap or Secret key that
- contains the Maven settings.
- 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
- settingsSecurity:
- description: A reference to the ConfigMap or Secret key that
- contains the security of the Maven settings.
- 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: array
+ verbose:
+ description: Enable verbose logging on build components that
+ support it (e.g. Kaniko build pod).
+ type: boolean
+ type: object
+ camel:
+ description: The configuration of Camel trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ properties:
+ description: A list of properties to be provided to the Integration
+ runtime
+ items:
+ type: string
+ type: array
+ runtimeVersion:
+ description: The camel-k-runtime version to use for the integration.
+ It overrides the default version set in the Integration
+ Platform.
+ type: string
type: object
- persistentVolumeClaim:
- description: 'Deprecated: Use PublishStrategyOptions instead the
- Persistent Volume Claim used by Kaniko publish strategy, if
- cache is enabled'
- type: string
- publishStrategy:
- description: the strategy to adopt for publishing an Integration
- base image
- type: string
- registry:
- description: the image registry used to push/pull Integration
- images
+ container:
+ description: The configuration of Container trait
properties:
- address:
- description: the URI to access
+ auto:
+ description: To automatically enable the trait
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ expose:
+ description: Can be used to enable/disable exposure via kubernetes
+ Service.
+ type: boolean
+ image:
+ description: The main container image
type: string
- ca:
- description: the configmap which stores the Certificate Authority
+ imagePullPolicy:
+ description: 'The pull policy: Always|Never|IfNotPresent'
type: string
- insecure:
- description: if the container registry is insecure (ie, http
- only)
+ limitCPU:
+ description: The maximum amount of CPU required.
+ type: string
+ limitMemory:
+ description: The maximum amount of memory required.
+ type: string
+ livenessFailureThreshold:
+ description: 'Minimum consecutive failures for the probe to
+ be considered failed after having succeeded. Applies to
+ the liveness probe. Deprecated: replaced by the health trait.'
+ format: int32
+ type: integer
+ livenessInitialDelay:
+ description: 'Number of seconds after the container has started
+ before liveness probes are initiated. Deprecated: replaced
+ by the health trait.'
+ format: int32
+ type: integer
+ livenessPeriod:
+ description: 'How often to perform the probe. Applies to the
+ liveness probe. Deprecated: replaced by the health trait.'
+ format: int32
+ type: integer
+ livenessScheme:
+ description: 'Scheme to use when connecting. Defaults to HTTP.
+ Applies to the liveness probe. Deprecated: replaced by the
+ health trait.'
+ type: string
+ livenessSuccessThreshold:
+ description: 'Minimum consecutive successes for the probe
+ to be considered successful after having failed. Applies
+ to the liveness probe. Deprecated: replaced by the health
+ trait.'
+ format: int32
+ type: integer
+ livenessTimeout:
+ description: 'Number of seconds after which the probe times
+ out. Applies to the liveness probe. Deprecated: replaced
+ by the health trait.'
+ format: int32
+ type: integer
+ name:
+ description: The main container name. It's named `integration`
+ by default.
+ type: string
+ port:
+ description: To configure a different port exposed by the
+ container (default `8080`).
+ type: integer
+ portName:
+ description: To configure a different port name for the port
+ exposed by the container. It defaults to `http` only when
+ the `expose` parameter is true.
+ type: string
+ probesEnabled:
+ description: 'DeprecatedProbesEnabled enable/disable probes
+ on the container (default `false`) Deprecated: replaced
+ by the health trait.'
type: boolean
- organization:
- description: the registry organization
+ readinessFailureThreshold:
+ description: 'Minimum consecutive failures for the probe to
+ be considered failed after having succeeded. Applies to
+ the readiness probe. Deprecated: replaced by the health
+ trait.'
+ format: int32
+ type: integer
+ readinessInitialDelay:
+ description: 'Number of seconds after the container has started
+ before readiness probes are initiated. Deprecated: replaced
+ by the health trait.'
+ format: int32
+ type: integer
+ readinessPeriod:
+ description: 'How often to perform the probe. Applies to the
+ readiness probe. Deprecated: replaced by the health trait.'
+ format: int32
+ type: integer
+ readinessScheme:
+ description: 'Scheme to use when connecting. Defaults to HTTP.
+ Applies to the readiness probe. Deprecated: replaced by
+ the health trait.'
type: string
- secret:
- description: the secret where credentials are stored
+ readinessSuccessThreshold:
+ description: 'Minimum consecutive successes for the probe
+ to be considered successful after having failed. Applies
+ to the readiness probe. Deprecated: replaced by the health
+ trait.'
+ format: int32
+ type: integer
+ readinessTimeout:
+ description: 'Number of seconds after which the probe times
+ out. Applies to the readiness probe. Deprecated: replaced
+ by the health trait.'
+ format: int32
+ type: integer
+ requestCPU:
+ description: The minimum amount of CPU required.
+ type: string
+ requestMemory:
+ description: The minimum amount of memory required.
+ type: string
+ servicePort:
+ description: To configure under which service port the container
+ port is to be exposed (default `80`).
+ type: integer
+ servicePortName:
+ description: To configure under which service port name the
+ container port is to be exposed (default `http`).
type: string
type: object
- runtimeProvider:
- description: the runtime used. Likely Camel Quarkus (we used to
- have main runtime which has been discontinued since version
+ cron:
+ description: The configuration of Cron trait
+ properties:
+ activeDeadlineSeconds:
+ description: Specifies the duration in seconds, relative to
+ the start time, that the job may be continuously active
+ before it is considered to be failed. It defaults to 60s.
+ format: int64
+ type: integer
+ auto:
+ description: "Automatically deploy the integration as CronJob
+ when all routes are either starting from a periodic consumer
+ (only `cron`, `timer` and `quartz` are supported) or a passive
+ consumer (e.g. `direct` is a passive consumer). \n It's
+ required that all periodic consumers have the same period
+ and it can be expressed as cron schedule (e.g. `1m` can
+ be expressed as `0/1 * * * *`, while `35m` or `50s` cannot)."
+ type: boolean
+ backoffLimit:
+ description: Specifies the number of retries before marking
+ the job failed. It defaults to 2.
+ format: int32
+ type: integer
+ components:
+ description: "A comma separated list of the Camel components
+ that need to be customized in order for them to work when
+ the schedule is triggered externally by Kubernetes. A specific
+ customizer is activated for each specified component. E.g.
+ for the `timer` component, the `cron-timer` customizer is
+ activated (it's present in the `org.apache.camel.k:camel-k-cron`
+ library). \n Supported components are currently: `cron`,
+ `timer` and `quartz`."
+ type: string
+ concurrencyPolicy:
+ description: 'Specifies how to treat concurrent executions
+ of a Job. Valid values are: - "Allow": allows CronJobs to
+ run concurrently; - "Forbid" (default): forbids concurrent
+ runs, skipping next run if previous run hasn''t finished
+ yet; - "Replace": cancels currently running job and replaces
+ it with a new one'
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ fallback:
+ description: Use the default Camel implementation of the `cron`
+ endpoint (`quartz`) instead of trying to materialize the
+ integration as Kubernetes CronJob.
+ type: boolean
+ schedule:
+ description: The CronJob schedule for the whole integration.
+ If multiple routes are declared, they must have the same
+ schedule for this mechanism to work correctly.
+ type: string
+ startingDeadlineSeconds:
+ description: Optional deadline in seconds for starting the
+ job if it misses scheduled time for any reason. Missed
+ jobs executions will be counted as failed ones.
+ format: int64
+ type: integer
+ type: object
+ dependencies:
+ description: The configuration of Dependencies trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ deployer:
+ description: The configuration of Deployer trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ kind:
+ description: Allows to explicitly select the desired deployment
+ kind between `deployment`, `cron-job` or `knative-service`
+ when creating the resources for running the integration.
+ type: string
+ useSSA:
+ description: Use server-side apply to update the owned resources
+ (default `true`). Note that it automatically falls back
+ to client-side patching, if SSA is not available, e.g.,
+ on old Kubernetes clusters.
+ type: boolean
+ type: object
+ deployment:
+ description: The configuration of Deployment trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ progressDeadlineSeconds:
+ description: The maximum time in seconds for the deployment
+ to make progress before it is considered to be failed. It
+ defaults to 60s.
+ format: int32
+ type: integer
+ type: object
+ environment:
+ description: The configuration of Environment trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ containerMeta:
+ description: Enables injection of `NAMESPACE` and `POD_NAME`
+ environment variables (default `true`)
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ httpProxy:
+ description: Propagates the `HTTP_PROXY`, `HTTPS_PROXY` and
+ `NO_PROXY` environment variables (default `true`)
+ type: boolean
+ vars:
+ description: A list of environment variables to be added to
+ the integration container. The syntax is KEY=VALUE, e.g.,
+ `MY_VAR="my value"`. These take precedence over the previously
+ defined environment variables.
+ items:
+ type: string
+ type: array
+ type: object
+ error-handler:
+ description: The configuration of Error Handler trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ ref:
+ description: The error handler ref name provided or found
+ in application properties
+ type: string
+ type: object
+ gc:
+ description: The configuration of GC trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ discoveryCache:
+ description: Discovery client cache to be used, either `disabled`,
+ `disk` or `memory` (default `memory`)
+ type: string
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ health:
+ description: The configuration of Health trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ livenessFailureThreshold:
+ description: Minimum consecutive failures for the liveness
+ probe to be considered failed after having succeeded.
+ format: int32
+ type: integer
+ livenessInitialDelay:
+ description: Number of seconds after the container has started
+ before the liveness probe is initiated.
+ format: int32
+ type: integer
+ livenessPeriod:
+ description: How often to perform the liveness probe.
+ format: int32
+ type: integer
+ livenessProbeEnabled:
+ description: Configures the liveness probe for the integration
+ container (default `false`).
+ type: boolean
+ livenessScheme:
+ description: Scheme to use when connecting to the liveness
+ probe (default `HTTP`).
+ type: string
+ livenessSuccessThreshold:
+ description: Minimum consecutive successes for the liveness
+ probe to be considered successful after having failed.
+ format: int32
+ type: integer
+ livenessTimeout:
+ description: Number of seconds after which the liveness probe
+ times out.
+ format: int32
+ type: integer
+ readinessFailureThreshold:
+ description: Minimum consecutive failures for the readiness
+ probe to be considered failed after having succeeded.
+ format: int32
+ type: integer
+ readinessInitialDelay:
+ description: Number of seconds after the container has started
+ before the readiness probe is initiated.
+ format: int32
+ type: integer
+ readinessPeriod:
+ description: How often to perform the readiness probe.
+ format: int32
+ type: integer
+ readinessProbeEnabled:
+ description: Configures the readiness probe for the integration
+ container (default `true`).
+ type: boolean
+ readinessScheme:
+ description: Scheme to use when connecting to the readiness
+ probe (default `HTTP`).
+ type: string
+ readinessSuccessThreshold:
+ description: Minimum consecutive successes for the readiness
+ probe to be considered successful after having failed.
+ format: int32
+ type: integer
+ readinessTimeout:
+ description: Number of seconds after which the readiness probe
+ times out.
+ format: int32
+ type: integer
+ type: object
+ ingress:
+ description: The configuration of Ingress trait
+ properties:
+ auto:
+ description: To automatically add an ingress whenever the
+ integration uses a HTTP endpoint consumer.
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ host:
+ description: '**Required**. To configure the host exposed
+ by the ingress.'
+ type: string
+ type: object
+ istio:
+ description: The configuration of Istio trait
+ properties:
+ allow:
+ description: Configures a (comma-separated) list of CIDR subnets
+ that should not be intercepted by the Istio proxy (`10.0.0.0/8,172.16.0.0/12,192.168.0.0/16`
+ by default).
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ inject:
+ description: Forces the value for labels `sidecar.istio.io/inject`.
+ By default the label is set to `true` on deployment and
+ not set on Knative Service.
+ type: boolean
+ type: object
+ jolokia:
+ description: The configuration of Jolokia trait
+ properties:
+ CACert:
+ description: The PEM encoded CA certification file path, used
+ to verify client certificates, applicable when `protocol`
+ is `https` and `use-ssl-client-authentication` is `true`
+ (default `/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt`
+ for OpenShift).
+ type: string
+ clientPrincipal:
+ description: The principal(s) which must be given in a client
+ certificate to allow access to the Jolokia endpoint, applicable
+ when `protocol` is `https` and `use-ssl-client-authentication`
+ is `true` (default `clientPrincipal=cn=system:master-proxy`,
+ `cn=hawtio-online.hawtio.svc` and `cn=fuse-console.fuse.svc`
+ for OpenShift).
+ items:
+ type: string
+ type: array
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ discoveryEnabled:
+ description: Listen for multicast requests (default `false`)
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ extendedClientCheck:
+ description: Mandate the client certificate contains a client
+ flag in the extended key usage section, applicable when
+ `protocol` is `https` and `use-ssl-client-authentication`
+ is `true` (default `true` for OpenShift).
+ type: boolean
+ host:
+ description: The Host address to which the Jolokia agent should
+ bind to. If `"\*"` or `"0.0.0.0"` is given, the servers
+ binds to every network interface (default `"*"`).
+ type: string
+ options:
+ description: A list of additional Jolokia options as defined
+ in https://jolokia.org/reference/html/agents.html#agent-jvm-config[JVM
+ agent configuration options]
+ items:
+ type: string
+ type: array
+ password:
+ description: The password used for authentication, applicable
+ when the `user` option is set.
+ type: string
+ port:
+ description: The Jolokia endpoint port (default `8778`).
+ type: integer
+ protocol:
+ description: The protocol to use, either `http` or `https`
+ (default `https` for OpenShift)
+ type: string
+ useSSLClientAuthentication:
+ description: Whether client certificates should be used for
+ authentication (default `true` for OpenShift).
+ type: boolean
+ user:
+ description: The user to be used for authentication
+ type: string
+ type: object
+ jvm:
+ description: The configuration of JVM trait
+ properties:
+ classpath:
+ description: Additional JVM classpath (use `Linux` classpath
+ separator)
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ debug:
+ description: Activates remote debugging, so that a debugger
+ can be attached to the JVM, e.g., using port-forwarding
+ type: boolean
+ debugAddress:
+ description: Transport address at which to listen for the
+ newly launched JVM (default `*:5005`)
+ type: string
+ debugSuspend:
+ description: Suspends the target JVM immediately before the
+ main class is loaded
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ options:
+ description: A list of JVM options
+ items:
+ type: string
+ type: array
+ printCommand:
+ description: Prints the command used the start the JVM in
+ the container logs (default `true`)
+ type: boolean
+ type: object
+ kamelets:
+ description: The configuration of Kamelets trait
+ properties:
+ auto:
+ description: Automatically inject all referenced Kamelets
+ and their default configuration (enabled by default)
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ list:
+ description: Comma separated list of Kamelet names to load
+ into the current integration
+ type: string
+ type: object
+ keda:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ knative:
+ description: The configuration of Knative trait
+ properties:
+ auto:
+ description: Enable automatic discovery of all trait properties.
+ type: boolean
+ channelSinks:
+ description: List of channels used as destination of integration
+ routes. Can contain simple channel names or full Camel URIs.
+ items:
+ type: string
+ type: array
+ channelSources:
+ description: List of channels used as source of integration
+ routes. Can contain simple channel names or full Camel URIs.
+ items:
+ type: string
+ type: array
+ config:
+ description: Can be used to inject a Knative complete configuration
+ in JSON format.
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ endpointSinks:
+ description: List of endpoints used as destination of integration
+ routes. Can contain simple endpoint names or full Camel
+ URIs.
+ items:
+ type: string
+ type: array
+ endpointSources:
+ description: List of channels used as source of integration
+ routes.
+ items:
+ type: string
+ type: array
+ eventSinks:
+ description: List of event types that the integration will
+ produce. Can contain simple event types or full Camel URIs
+ (to use a specific broker).
+ items:
+ type: string
+ type: array
+ eventSources:
+ description: List of event types that the integration will
+ be subscribed to. Can contain simple event types or full
+ Camel URIs (to use a specific broker different from "default").
+ items:
+ type: string
+ type: array
+ filterSourceChannels:
+ description: Enables filtering on events based on the header
+ "ce-knativehistory". Since this header has been removed
+ in newer versions of Knative, filtering is disabled by default.
+ type: boolean
+ sinkBinding:
+ description: Allows binding the integration to a sink via
+ a Knative SinkBinding resource. This can be used when the
+ integration targets a single sink. It's enabled by default
+ when the integration targets a single sink (except when
+ the integration is owned by a Knative source).
+ type: boolean
+ type: object
+ knative-service:
+ description: The configuration of Knative Service trait
+ properties:
+ auto:
+ description: "Automatically deploy the integration as Knative
+ service when all conditions hold: \n * Integration is using
+ the Knative profile * All routes are either starting from
+ a HTTP based consumer or a passive consumer (e.g. `direct`
+ is a passive consumer)"
+ type: boolean
+ autoscalingMetric:
+ description: "Configures the Knative autoscaling metric property
+ (e.g. to set `concurrency` based or `cpu` based autoscaling).
+ \n Refer to the Knative documentation for more information."
+ type: string
+ autoscalingTarget:
+ description: "Sets the allowed concurrency level or CPU percentage
+ (depending on the autoscaling metric) for each Pod. \n Refer
+ to the Knative documentation for more information."
+ type: integer
+ class:
+ description: "Configures the Knative autoscaling class property
+ (e.g. to set `hpa.autoscaling.knative.dev` or `kpa.autoscaling.knative.dev`
+ autoscaling). \n Refer to the Knative documentation for
+ more information."
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ maxScale:
+ description: "An upper bound for the number of Pods that can
+ be running in parallel for the integration. Knative has
+ its own cap value that depends on the installation. \n Refer
+ to the Knative documentation for more information."
+ type: integer
+ minScale:
+ description: "The minimum number of Pods that should be running
+ at any time for the integration. It's **zero** by default,
+ meaning that the integration is scaled down to zero when
+ not used for a configured amount of time. \n Refer to the
+ Knative documentation for more information."
+ type: integer
+ rolloutDuration:
+ description: Enables to gradually shift traffic to the latest
+ Revision and sets the rollout duration. It's disabled by
+ default and must be expressed as a Golang `time.Duration`
+ string representation, rounded to a second precision.
+ type: string
+ type: object
+ logging:
+ description: The configuration of Logging trait
+ properties:
+ color:
+ description: Colorize the log output
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ format:
+ description: Logs message format
+ type: string
+ json:
+ description: Output the logs in JSON
+ type: boolean
+ jsonPrettyPrint:
+ description: Enable "pretty printing" of the JSON logs
+ type: boolean
+ level:
+ description: Adjust the logging level (defaults to INFO)
+ type: string
+ type: object
+ master:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ mount:
+ description: The configuration of Mount trait
+ properties:
+ configs:
+ description: 'A list of configuration pointing to configmap/secret.
+ The configuration are expected to be UTF-8 resources as
+ they are processed by runtime Camel Context and tried to
+ be parsed as property files. They are also made available
+ on the classpath in order to ease their usage directly from
+ the Route. Syntax: [configmap|secret]:name[/key], where
+ name represents the resource name and key optionally represents
+ the resource key to be filtered'
+ items:
+ type: string
+ type: array
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ resources:
+ description: 'A list of resources (text or binary content)
+ pointing to configmap/secret. The resources are expected
+ to be any resource type (text or binary content). The destination
+ path can be either a default location or any path specified
+ by the user. Syntax: [configmap|secret]:name[/key][@path],
+ where name represents the resource name, key optionally
+ represents the resource key to be filtered and path represents
+ the destination path'
+ items:
+ type: string
+ type: array
+ volumes:
+ description: 'A list of Persistent Volume Claims to be mounted.
+ Syntax: [pvcname:/container/path]'
+ items:
+ type: string
+ type: array
+ type: object
+ openapi:
+ description: The configuration of OpenAPI trait
+ properties:
+ configmaps:
+ description: The configmaps holding the spec of the OpenAPI
+ items:
+ type: string
+ type: array
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ owner:
+ description: The configuration of Owner trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ targetAnnotations:
+ description: The set of annotations to be transferred
+ items:
+ type: string
+ type: array
+ targetLabels:
+ description: The set of labels to be transferred
+ items:
+ type: string
+ type: array
+ type: object
+ pdb:
+ description: The configuration of PDB trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ maxUnavailable:
+ description: The number of pods for the Integration that can
+ be unavailable after an eviction. It can be either an absolute
+ number or a percentage (default `1` if `min-available` is
+ also not set). Only one of `max-unavailable` and `min-available`
+ can be specified.
+ type: string
+ minAvailable:
+ description: The number of pods for the Integration that must
+ still be available after an eviction. It can be either an
+ absolute number or a percentage. Only one of `min-available`
+ and `max-unavailable` can be specified.
+ type: string
+ type: object
+ platform:
+ description: The configuration of Platform trait
+ properties:
+ auto:
+ description: To automatically detect from the environment
+ if a default platform can be created (it will be created
+ on OpenShift only).
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ createDefault:
+ description: To create a default (empty) platform when the
+ platform is missing.
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ global:
+ description: Indicates if the platform should be created globally
+ in the case of global operator (default true).
+ type: boolean
+ type: object
+ pod:
+ description: The configuration of Pod trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ prometheus:
+ description: The configuration of Prometheus trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ podMonitor:
+ description: Whether a `PodMonitor` resource is created (default
+ `true`).
+ type: boolean
+ podMonitorLabels:
+ description: The `PodMonitor` resource labels, applicable
+ when `pod-monitor` is `true`.
+ items:
+ type: string
+ type: array
+ type: object
+ pull-secret:
+ description: The configuration of Pull Secret trait
+ properties:
+ auto:
+ description: Automatically configures the platform registry
+ secret on the pod if it is of type `kubernetes.io/dockerconfigjson`.
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ imagePullerDelegation:
+ description: When using a global operator with a shared platform,
+ this enables delegation of the `system:image-puller` cluster
+ role on the operator namespace to the integration service
+ account.
+ type: boolean
+ secretName:
+ description: The pull secret name to set on the Pod. If left
+ empty this is automatically taken from the `IntegrationPlatform`
+ registry configuration.
+ type: string
+ type: object
+ quarkus:
+ description: The configuration of Quarkus trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ packageTypes:
+ description: The Quarkus package types, either `fast-jar`
+ or `native` (default `fast-jar`). In case both `fast-jar`
+ and `native` are specified, two `IntegrationKit` resources
+ are created, with the `native` kit having precedence over
+ the `fast-jar` one once ready. The order influences the
+ resolution of the current kit for the integration. The kit
+ corresponding to the first package type will be assigned
+ to the integration in case no existing kit that matches
+ the integration exists.
+ items:
+ type: string
+ type: array
+ type: object
+ registry:
+ description: The configuration of Registry trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ route:
+ description: The configuration of Route trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ host:
+ description: To configure the host exposed by the route.
+ type: string
+ tlsCACertificate:
+ description: "The TLS CA certificate contents. \n Refer to
+ the OpenShift route documentation for additional information."
+ type: string
+ tlsCACertificateSecret:
+ description: "The secret name and key reference to the TLS
+ CA certificate. The format is \"secret-name[/key-name]\",
+ the value represents the secret name, if there is only one
+ key in the secret it will be read, otherwise you can set
+ a key name separated with a \"/\". \n Refer to the OpenShift
+ route documentation for additional information."
+ type: string
+ tlsCertificate:
+ description: "The TLS certificate contents. \n Refer to the
+ OpenShift route documentation for additional information."
+ type: string
+ tlsCertificateSecret:
+ description: "The secret name and key reference to the TLS
+ certificate. The format is \"secret-name[/key-name]\", the
+ value represents the secret name, if there is only one key
+ in the secret it will be read, otherwise you can set a key
+ name separated with a \"/\". \n Refer to the OpenShift route
+ documentation for additional information."
+ type: string
+ tlsDestinationCACertificate:
+ description: "The destination CA certificate provides the
+ contents of the ca certificate of the final destination.
+ \ When using reencrypt termination this file should be provided
+ in order to have routers use it for health checks on the
+ secure connection. If this field is not specified, the router
+ may provide its own destination CA and perform hostname
+ validation using the short service name (service.namespace.svc),
+ which allows infrastructure generated certificates to automatically
+ verify. \n Refer to the OpenShift route documentation for
+ additional information."
+ type: string
+ tlsDestinationCACertificateSecret:
+ description: "The secret name and key reference to the destination
+ CA certificate. The format is \"secret-name[/key-name]\",
+ the value represents the secret name, if there is only one
+ key in the secret it will be read, otherwise you can set
+ a key name separated with a \"/\". \n Refer to the OpenShift
+ route documentation for additional information."
+ type: string
+ tlsInsecureEdgeTerminationPolicy:
+ description: "To configure how to deal with insecure traffic,
+ e.g. `Allow`, `Disable` or `Redirect` traffic. \n Refer
+ to the OpenShift route documentation for additional information."
+ type: string
+ tlsKey:
+ description: "The TLS certificate key contents. \n Refer to
+ the OpenShift route documentation for additional information."
+ type: string
+ tlsKeySecret:
+ description: "The secret name and key reference to the TLS
+ certificate key. The format is \"secret-name[/key-name]\",
+ the value represents the secret name, if there is only one
+ key in the secret it will be read, otherwise you can set
+ a key name separated with a \"/\". \n Refer to the OpenShift
+ route documentation for additional information."
+ type: string
+ tlsTermination:
+ description: "The TLS termination type, like `edge`, `passthrough`
+ or `reencrypt`. \n Refer to the OpenShift route documentation
+ for additional information."
+ type: string
+ type: object
+ service:
+ description: The configuration of Service trait
+ properties:
+ auto:
+ description: To automatically detect from the code if a Service
+ needs to be created.
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ nodePort:
+ description: Enable Service to be exposed as NodePort (default
+ `false`).
+ type: boolean
+ type: object
+ service-binding:
+ description: The configuration of Service Binding trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ services:
+ description: List of Services in the form [[apigroup/]version:]kind:[namespace/]name
+ items:
+ type: string
+ type: array
+ type: object
+ strimzi:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ toleration:
+ description: The configuration of Toleration trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ taints:
+ description: The list of taints to tolerate, in the form `Key[=Value]:Effect[:Seconds]`
+ items:
+ type: string
+ type: array
+ type: object
+ tracing:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ type: object
+ type: object
+ status:
+ description: IntegrationPlatformStatus defines the observed state of IntegrationPlatform
+ properties:
+ build:
+ description: specify how to build the Integration/IntegrationKits
+ properties:
+ PublishStrategyOptions:
+ additionalProperties:
+ type: string
+ type: object
+ baseImage:
+ description: a base image that can be used as base layer for all
+ images. It can be useful if you want to provide some custom
+ base image with further utility softwares
+ type: string
+ buildStrategy:
+ description: the strategy to adopt for building an Integration
+ base image
+ enum:
+ - routine
+ - pod
+ type: string
+ kanikoBuildCache:
+ description: 'Deprecated: Use PublishStrategyOptions instead enables
+ Kaniko publish strategy cache'
+ type: boolean
+ maven:
+ description: Maven configuration used to build the Camel/Camel-Quarkus
+ applications
+ properties:
+ caSecret:
+ description: 'Deprecated: use CASecrets The Secret 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.'
+ 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
+ caSecrets:
+ description: 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.
+ items:
+ description: SecretKeySelector 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: array
+ cliOptions:
+ description: 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.8.4/maven-embedder/cli.html.
+ items:
+ type: string
+ type: array
+ extension:
+ description: The Maven build extensions. See https://maven.apache.org/guides/mini/guide-using-extensions.html.
+ items:
+ description: MavenArtifact defines a GAV (Group:Artifact:Version)
+ Maven artifact
+ properties:
+ artifactId:
+ description: Maven Artifact
+ type: string
+ groupId:
+ description: Maven Group
+ type: string
+ version:
+ description: Maven Version
+ type: string
+ required:
+ - artifactId
+ - groupId
+ type: object
+ type: array
+ localRepository:
+ description: The path of the local Maven repository.
+ type: string
+ properties:
+ additionalProperties:
+ type: string
+ description: The Maven properties.
+ type: object
+ settings:
+ description: A reference to the ConfigMap or Secret key that
+ contains the Maven settings.
+ 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
+ settingsSecurity:
+ description: A reference to the ConfigMap or Secret key that
+ contains the security of the Maven settings.
+ 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
+ type: object
+ persistentVolumeClaim:
+ description: 'Deprecated: Use PublishStrategyOptions instead the
+ Persistent Volume Claim used by Kaniko publish strategy, if
+ cache is enabled'
+ type: string
+ publishStrategy:
+ description: the strategy to adopt for publishing an Integration
+ base image
+ type: string
+ registry:
+ description: the image registry used to push/pull Integration
+ images
+ properties:
+ address:
+ description: the URI to access
+ type: string
+ ca:
+ description: the configmap which stores the Certificate Authority
+ type: string
+ insecure:
+ description: if the container registry is insecure (ie, http
+ only)
+ type: boolean
+ organization:
+ description: the registry organization
+ type: string
+ secret:
+ description: the secret where credentials are stored
+ type: string
+ type: object
+ runtimeProvider:
+ description: the runtime used. Likely Camel Quarkus (we used to
+ have main runtime which has been discontinued since version
1.5)
type: string
runtimeVersion:
@@ -711,39 +1951,1279 @@ spec:
uri:
description: the remote repository in the format github:ORG/REPO/PATH_TO_KAMELETS_FOLDER
type: string
- type: object
- type: array
- type: object
- observedGeneration:
- description: ObservedGeneration is the most recent generation observed
- for this IntegrationPlatform.
- format: int64
- type: integer
- phase:
- description: defines in what phase the IntegrationPlatform is found
- type: string
- profile:
- description: the profile you wish to use. It will apply certain traits
- which are required by the specific profile chosen. It usually relates
- the Cluster with the optional definition of special profiles (ie,
- Knative)
- type: string
- resources:
- description: 'Deprecated: not used'
- type: object
- traits:
- additionalProperties:
- description: A TraitSpec contains the configuration of a trait
- properties:
- configuration:
- description: TraitConfiguration parameters configuration
- type: object
- x-kubernetes-preserve-unknown-fields: true
- required:
- - configuration
- type: object
- description: list of traits to be executed for all the Integration/IntegrationKits
- built from this IntegrationPlatform
+ type: object
+ type: array
+ type: object
+ observedGeneration:
+ description: ObservedGeneration is the most recent generation observed
+ for this IntegrationPlatform.
+ format: int64
+ type: integer
+ phase:
+ description: defines in what phase the IntegrationPlatform is found
+ type: string
+ profile:
+ description: the profile you wish to use. It will apply certain traits
+ which are required by the specific profile chosen. It usually relates
+ the Cluster with the optional definition of special profiles (ie,
+ Knative)
+ type: string
+ resources:
+ description: 'Deprecated: not used'
+ type: object
+ traits:
+ description: list of traits to be executed for all the Integration/IntegrationKits
+ built from this IntegrationPlatform
+ properties:
+ 3scale:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ addons:
+ additionalProperties:
+ description: AddonTrait represents the configuration of an addon
+ trait
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ description: The extension point with addon traits
+ type: object
+ affinity:
+ description: The configuration of Affinity trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ nodeAffinityLabels:
+ description: Defines a set of nodes the integration pod(s)
+ are eligible to be scheduled on, based on labels on the
+ node.
+ items:
+ type: string
+ type: array
+ podAffinity:
+ description: Always co-locates multiple replicas of the integration
+ in the same node (default *false*).
+ type: boolean
+ podAffinityLabels:
+ description: Defines a set of pods (namely those matching
+ the label selector, relative to the given namespace) that
+ the integration pod(s) should be co-located with.
+ items:
+ type: string
+ type: array
+ podAntiAffinity:
+ description: Never co-locates multiple replicas of the integration
+ in the same node (default *false*).
+ type: boolean
+ podAntiAffinityLabels:
+ description: Defines a set of pods (namely those matching
+ the label selector, relative to the given namespace) that
+ the integration pod(s) should not be co-located with.
+ items:
+ type: string
+ type: array
+ type: object
+ builder:
+ description: The configuration of Builder trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ properties:
+ description: A list of properties to be provided to the build
+ task
+ items:
+ type: string
+ type: array
+ verbose:
+ description: Enable verbose logging on build components that
+ support it (e.g. Kaniko build pod).
+ type: boolean
+ type: object
+ camel:
+ description: The configuration of Camel trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ properties:
+ description: A list of properties to be provided to the Integration
+ runtime
+ items:
+ type: string
+ type: array
+ runtimeVersion:
+ description: The camel-k-runtime version to use for the integration.
+ It overrides the default version set in the Integration
+ Platform.
+ type: string
+ type: object
+ container:
+ description: The configuration of Container trait
+ properties:
+ auto:
+ description: To automatically enable the trait
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ expose:
+ description: Can be used to enable/disable exposure via kubernetes
+ Service.
+ type: boolean
+ image:
+ description: The main container image
+ type: string
+ imagePullPolicy:
+ description: 'The pull policy: Always|Never|IfNotPresent'
+ type: string
+ limitCPU:
+ description: The maximum amount of CPU required.
+ type: string
+ limitMemory:
+ description: The maximum amount of memory required.
+ type: string
+ livenessFailureThreshold:
+ description: 'Minimum consecutive failures for the probe to
+ be considered failed after having succeeded. Applies to
+ the liveness probe. Deprecated: replaced by the health trait.'
+ format: int32
+ type: integer
+ livenessInitialDelay:
+ description: 'Number of seconds after the container has started
+ before liveness probes are initiated. Deprecated: replaced
+ by the health trait.'
+ format: int32
+ type: integer
+ livenessPeriod:
+ description: 'How often to perform the probe. Applies to the
+ liveness probe. Deprecated: replaced by the health trait.'
+ format: int32
+ type: integer
+ livenessScheme:
+ description: 'Scheme to use when connecting. Defaults to HTTP.
+ Applies to the liveness probe. Deprecated: replaced by the
+ health trait.'
+ type: string
+ livenessSuccessThreshold:
+ description: 'Minimum consecutive successes for the probe
+ to be considered successful after having failed. Applies
+ to the liveness probe. Deprecated: replaced by the health
+ trait.'
+ format: int32
+ type: integer
+ livenessTimeout:
+ description: 'Number of seconds after which the probe times
+ out. Applies to the liveness probe. Deprecated: replaced
+ by the health trait.'
+ format: int32
+ type: integer
+ name:
+ description: The main container name. It's named `integration`
+ by default.
+ type: string
+ port:
+ description: To configure a different port exposed by the
+ container (default `8080`).
+ type: integer
+ portName:
+ description: To configure a different port name for the port
+ exposed by the container. It defaults to `http` only when
+ the `expose` parameter is true.
+ type: string
+ probesEnabled:
+ description: 'DeprecatedProbesEnabled enable/disable probes
+ on the container (default `false`) Deprecated: replaced
+ by the health trait.'
+ type: boolean
+ readinessFailureThreshold:
+ description: 'Minimum consecutive failures for the probe to
+ be considered failed after having succeeded. Applies to
+ the readiness probe. Deprecated: replaced by the health
+ trait.'
+ format: int32
+ type: integer
+ readinessInitialDelay:
+ description: 'Number of seconds after the container has started
+ before readiness probes are initiated. Deprecated: replaced
+ by the health trait.'
+ format: int32
+ type: integer
+ readinessPeriod:
+ description: 'How often to perform the probe. Applies to the
+ readiness probe. Deprecated: replaced by the health trait.'
+ format: int32
+ type: integer
+ readinessScheme:
+ description: 'Scheme to use when connecting. Defaults to HTTP.
+ Applies to the readiness probe. Deprecated: replaced by
+ the health trait.'
+ type: string
+ readinessSuccessThreshold:
+ description: 'Minimum consecutive successes for the probe
+ to be considered successful after having failed. Applies
+ to the readiness probe. Deprecated: replaced by the health
+ trait.'
+ format: int32
+ type: integer
+ readinessTimeout:
+ description: 'Number of seconds after which the probe times
+ out. Applies to the readiness probe. Deprecated: replaced
+ by the health trait.'
+ format: int32
+ type: integer
+ requestCPU:
+ description: The minimum amount of CPU required.
+ type: string
+ requestMemory:
+ description: The minimum amount of memory required.
+ type: string
+ servicePort:
+ description: To configure under which service port the container
+ port is to be exposed (default `80`).
+ type: integer
+ servicePortName:
+ description: To configure under which service port name the
+ container port is to be exposed (default `http`).
+ type: string
+ type: object
+ cron:
+ description: The configuration of Cron trait
+ properties:
+ activeDeadlineSeconds:
+ description: Specifies the duration in seconds, relative to
+ the start time, that the job may be continuously active
+ before it is considered to be failed. It defaults to 60s.
+ format: int64
+ type: integer
+ auto:
+ description: "Automatically deploy the integration as CronJob
+ when all routes are either starting from a periodic consumer
+ (only `cron`, `timer` and `quartz` are supported) or a passive
+ consumer (e.g. `direct` is a passive consumer). \n It's
+ required that all periodic consumers have the same period
+ and it can be expressed as cron schedule (e.g. `1m` can
+ be expressed as `0/1 * * * *`, while `35m` or `50s` cannot)."
+ type: boolean
+ backoffLimit:
+ description: Specifies the number of retries before marking
+ the job failed. It defaults to 2.
+ format: int32
+ type: integer
+ components:
+ description: "A comma separated list of the Camel components
+ that need to be customized in order for them to work when
+ the schedule is triggered externally by Kubernetes. A specific
+ customizer is activated for each specified component. E.g.
+ for the `timer` component, the `cron-timer` customizer is
+ activated (it's present in the `org.apache.camel.k:camel-k-cron`
+ library). \n Supported components are currently: `cron`,
+ `timer` and `quartz`."
+ type: string
+ concurrencyPolicy:
+ description: 'Specifies how to treat concurrent executions
+ of a Job. Valid values are: - "Allow": allows CronJobs to
+ run concurrently; - "Forbid" (default): forbids concurrent
+ runs, skipping next run if previous run hasn''t finished
+ yet; - "Replace": cancels currently running job and replaces
+ it with a new one'
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ fallback:
+ description: Use the default Camel implementation of the `cron`
+ endpoint (`quartz`) instead of trying to materialize the
+ integration as Kubernetes CronJob.
+ type: boolean
+ schedule:
+ description: The CronJob schedule for the whole integration.
+ If multiple routes are declared, they must have the same
+ schedule for this mechanism to work correctly.
+ type: string
+ startingDeadlineSeconds:
+ description: Optional deadline in seconds for starting the
+ job if it misses scheduled time for any reason. Missed
+ jobs executions will be counted as failed ones.
+ format: int64
+ type: integer
+ type: object
+ dependencies:
+ description: The configuration of Dependencies trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ deployer:
+ description: The configuration of Deployer trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ kind:
+ description: Allows to explicitly select the desired deployment
+ kind between `deployment`, `cron-job` or `knative-service`
+ when creating the resources for running the integration.
+ type: string
+ useSSA:
+ description: Use server-side apply to update the owned resources
+ (default `true`). Note that it automatically falls back
+ to client-side patching, if SSA is not available, e.g.,
+ on old Kubernetes clusters.
+ type: boolean
+ type: object
+ deployment:
+ description: The configuration of Deployment trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ progressDeadlineSeconds:
+ description: The maximum time in seconds for the deployment
+ to make progress before it is considered to be failed. It
+ defaults to 60s.
+ format: int32
+ type: integer
+ type: object
+ environment:
+ description: The configuration of Environment trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ containerMeta:
+ description: Enables injection of `NAMESPACE` and `POD_NAME`
+ environment variables (default `true`)
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ httpProxy:
+ description: Propagates the `HTTP_PROXY`, `HTTPS_PROXY` and
+ `NO_PROXY` environment variables (default `true`)
+ type: boolean
+ vars:
+ description: A list of environment variables to be added to
+ the integration container. The syntax is KEY=VALUE, e.g.,
+ `MY_VAR="my value"`. These take precedence over the previously
+ defined environment variables.
+ items:
+ type: string
+ type: array
+ type: object
+ error-handler:
+ description: The configuration of Error Handler trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ ref:
+ description: The error handler ref name provided or found
+ in application properties
+ type: string
+ type: object
+ gc:
+ description: The configuration of GC trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ discoveryCache:
+ description: Discovery client cache to be used, either `disabled`,
+ `disk` or `memory` (default `memory`)
+ type: string
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ health:
+ description: The configuration of Health trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ livenessFailureThreshold:
+ description: Minimum consecutive failures for the liveness
+ probe to be considered failed after having succeeded.
+ format: int32
+ type: integer
+ livenessInitialDelay:
+ description: Number of seconds after the container has started
+ before the liveness probe is initiated.
+ format: int32
+ type: integer
+ livenessPeriod:
+ description: How often to perform the liveness probe.
+ format: int32
+ type: integer
+ livenessProbeEnabled:
+ description: Configures the liveness probe for the integration
+ container (default `false`).
+ type: boolean
+ livenessScheme:
+ description: Scheme to use when connecting to the liveness
+ probe (default `HTTP`).
+ type: string
+ livenessSuccessThreshold:
+ description: Minimum consecutive successes for the liveness
+ probe to be considered successful after having failed.
+ format: int32
+ type: integer
+ livenessTimeout:
+ description: Number of seconds after which the liveness probe
+ times out.
+ format: int32
+ type: integer
+ readinessFailureThreshold:
+ description: Minimum consecutive failures for the readiness
+ probe to be considered failed after having succeeded.
+ format: int32
+ type: integer
+ readinessInitialDelay:
+ description: Number of seconds after the container has started
+ before the readiness probe is initiated.
+ format: int32
+ type: integer
+ readinessPeriod:
+ description: How often to perform the readiness probe.
+ format: int32
+ type: integer
+ readinessProbeEnabled:
+ description: Configures the readiness probe for the integration
+ container (default `true`).
+ type: boolean
+ readinessScheme:
+ description: Scheme to use when connecting to the readiness
+ probe (default `HTTP`).
+ type: string
+ readinessSuccessThreshold:
+ description: Minimum consecutive successes for the readiness
+ probe to be considered successful after having failed.
+ format: int32
+ type: integer
+ readinessTimeout:
+ description: Number of seconds after which the readiness probe
+ times out.
+ format: int32
+ type: integer
+ type: object
+ ingress:
+ description: The configuration of Ingress trait
+ properties:
+ auto:
+ description: To automatically add an ingress whenever the
+ integration uses a HTTP endpoint consumer.
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ host:
+ description: '**Required**. To configure the host exposed
+ by the ingress.'
+ type: string
+ type: object
+ istio:
+ description: The configuration of Istio trait
+ properties:
+ allow:
+ description: Configures a (comma-separated) list of CIDR subnets
+ that should not be intercepted by the Istio proxy (`10.0.0.0/8,172.16.0.0/12,192.168.0.0/16`
+ by default).
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ inject:
+ description: Forces the value for labels `sidecar.istio.io/inject`.
+ By default the label is set to `true` on deployment and
+ not set on Knative Service.
+ type: boolean
+ type: object
+ jolokia:
+ description: The configuration of Jolokia trait
+ properties:
+ CACert:
+ description: The PEM encoded CA certification file path, used
+ to verify client certificates, applicable when `protocol`
+ is `https` and `use-ssl-client-authentication` is `true`
+ (default `/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt`
+ for OpenShift).
+ type: string
+ clientPrincipal:
+ description: The principal(s) which must be given in a client
+ certificate to allow access to the Jolokia endpoint, applicable
+ when `protocol` is `https` and `use-ssl-client-authentication`
+ is `true` (default `clientPrincipal=cn=system:master-proxy`,
+ `cn=hawtio-online.hawtio.svc` and `cn=fuse-console.fuse.svc`
+ for OpenShift).
+ items:
+ type: string
+ type: array
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ discoveryEnabled:
+ description: Listen for multicast requests (default `false`)
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ extendedClientCheck:
+ description: Mandate the client certificate contains a client
+ flag in the extended key usage section, applicable when
+ `protocol` is `https` and `use-ssl-client-authentication`
+ is `true` (default `true` for OpenShift).
+ type: boolean
+ host:
+ description: The Host address to which the Jolokia agent should
+ bind to. If `"\*"` or `"0.0.0.0"` is given, the servers
+ binds to every network interface (default `"*"`).
+ type: string
+ options:
+ description: A list of additional Jolokia options as defined
+ in https://jolokia.org/reference/html/agents.html#agent-jvm-config[JVM
+ agent configuration options]
+ items:
+ type: string
+ type: array
+ password:
+ description: The password used for authentication, applicable
+ when the `user` option is set.
+ type: string
+ port:
+ description: The Jolokia endpoint port (default `8778`).
+ type: integer
+ protocol:
+ description: The protocol to use, either `http` or `https`
+ (default `https` for OpenShift)
+ type: string
+ useSSLClientAuthentication:
+ description: Whether client certificates should be used for
+ authentication (default `true` for OpenShift).
+ type: boolean
+ user:
+ description: The user to be used for authentication
+ type: string
+ type: object
+ jvm:
+ description: The configuration of JVM trait
+ properties:
+ classpath:
+ description: Additional JVM classpath (use `Linux` classpath
+ separator)
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ debug:
+ description: Activates remote debugging, so that a debugger
+ can be attached to the JVM, e.g., using port-forwarding
+ type: boolean
+ debugAddress:
+ description: Transport address at which to listen for the
+ newly launched JVM (default `*:5005`)
+ type: string
+ debugSuspend:
+ description: Suspends the target JVM immediately before the
+ main class is loaded
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ options:
+ description: A list of JVM options
+ items:
+ type: string
+ type: array
+ printCommand:
+ description: Prints the command used the start the JVM in
+ the container logs (default `true`)
+ type: boolean
+ type: object
+ kamelets:
+ description: The configuration of Kamelets trait
+ properties:
+ auto:
+ description: Automatically inject all referenced Kamelets
+ and their default configuration (enabled by default)
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ list:
+ description: Comma separated list of Kamelet names to load
+ into the current integration
+ type: string
+ type: object
+ keda:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ knative:
+ description: The configuration of Knative trait
+ properties:
+ auto:
+ description: Enable automatic discovery of all trait properties.
+ type: boolean
+ channelSinks:
+ description: List of channels used as destination of integration
+ routes. Can contain simple channel names or full Camel URIs.
+ items:
+ type: string
+ type: array
+ channelSources:
+ description: List of channels used as source of integration
+ routes. Can contain simple channel names or full Camel URIs.
+ items:
+ type: string
+ type: array
+ config:
+ description: Can be used to inject a Knative complete configuration
+ in JSON format.
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ endpointSinks:
+ description: List of endpoints used as destination of integration
+ routes. Can contain simple endpoint names or full Camel
+ URIs.
+ items:
+ type: string
+ type: array
+ endpointSources:
+ description: List of channels used as source of integration
+ routes.
+ items:
+ type: string
+ type: array
+ eventSinks:
+ description: List of event types that the integration will
+ produce. Can contain simple event types or full Camel URIs
+ (to use a specific broker).
+ items:
+ type: string
+ type: array
+ eventSources:
+ description: List of event types that the integration will
+ be subscribed to. Can contain simple event types or full
+ Camel URIs (to use a specific broker different from "default").
+ items:
+ type: string
+ type: array
+ filterSourceChannels:
+ description: Enables filtering on events based on the header
+ "ce-knativehistory". Since this header has been removed
+ in newer versions of Knative, filtering is disabled by default.
+ type: boolean
+ sinkBinding:
+ description: Allows binding the integration to a sink via
+ a Knative SinkBinding resource. This can be used when the
+ integration targets a single sink. It's enabled by default
+ when the integration targets a single sink (except when
+ the integration is owned by a Knative source).
+ type: boolean
+ type: object
+ knative-service:
+ description: The configuration of Knative Service trait
+ properties:
+ auto:
+ description: "Automatically deploy the integration as Knative
+ service when all conditions hold: \n * Integration is using
+ the Knative profile * All routes are either starting from
+ a HTTP based consumer or a passive consumer (e.g. `direct`
+ is a passive consumer)"
+ type: boolean
+ autoscalingMetric:
+ description: "Configures the Knative autoscaling metric property
+ (e.g. to set `concurrency` based or `cpu` based autoscaling).
+ \n Refer to the Knative documentation for more information."
+ type: string
+ autoscalingTarget:
+ description: "Sets the allowed concurrency level or CPU percentage
+ (depending on the autoscaling metric) for each Pod. \n Refer
+ to the Knative documentation for more information."
+ type: integer
+ class:
+ description: "Configures the Knative autoscaling class property
+ (e.g. to set `hpa.autoscaling.knative.dev` or `kpa.autoscaling.knative.dev`
+ autoscaling). \n Refer to the Knative documentation for
+ more information."
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ maxScale:
+ description: "An upper bound for the number of Pods that can
+ be running in parallel for the integration. Knative has
+ its own cap value that depends on the installation. \n Refer
+ to the Knative documentation for more information."
+ type: integer
+ minScale:
+ description: "The minimum number of Pods that should be running
+ at any time for the integration. It's **zero** by default,
+ meaning that the integration is scaled down to zero when
+ not used for a configured amount of time. \n Refer to the
+ Knative documentation for more information."
+ type: integer
+ rolloutDuration:
+ description: Enables to gradually shift traffic to the latest
+ Revision and sets the rollout duration. It's disabled by
+ default and must be expressed as a Golang `time.Duration`
+ string representation, rounded to a second precision.
+ type: string
+ type: object
+ logging:
+ description: The configuration of Logging trait
+ properties:
+ color:
+ description: Colorize the log output
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ format:
+ description: Logs message format
+ type: string
+ json:
+ description: Output the logs in JSON
+ type: boolean
+ jsonPrettyPrint:
+ description: Enable "pretty printing" of the JSON logs
+ type: boolean
+ level:
+ description: Adjust the logging level (defaults to INFO)
+ type: string
+ type: object
+ master:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ mount:
+ description: The configuration of Mount trait
+ properties:
+ configs:
+ description: 'A list of configuration pointing to configmap/secret.
+ The configuration are expected to be UTF-8 resources as
+ they are processed by runtime Camel Context and tried to
+ be parsed as property files. They are also made available
+ on the classpath in order to ease their usage directly from
+ the Route. Syntax: [configmap|secret]:name[/key], where
+ name represents the resource name and key optionally represents
+ the resource key to be filtered'
+ items:
+ type: string
+ type: array
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ resources:
+ description: 'A list of resources (text or binary content)
+ pointing to configmap/secret. The resources are expected
+ to be any resource type (text or binary content). The destination
+ path can be either a default location or any path specified
+ by the user. Syntax: [configmap|secret]:name[/key][@path],
+ where name represents the resource name, key optionally
+ represents the resource key to be filtered and path represents
+ the destination path'
+ items:
+ type: string
+ type: array
+ volumes:
+ description: 'A list of Persistent Volume Claims to be mounted.
+ Syntax: [pvcname:/container/path]'
+ items:
+ type: string
+ type: array
+ type: object
+ openapi:
+ description: The configuration of OpenAPI trait
+ properties:
+ configmaps:
+ description: The configmaps holding the spec of the OpenAPI
+ items:
+ type: string
+ type: array
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ owner:
+ description: The configuration of Owner trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ targetAnnotations:
+ description: The set of annotations to be transferred
+ items:
+ type: string
+ type: array
+ targetLabels:
+ description: The set of labels to be transferred
+ items:
+ type: string
+ type: array
+ type: object
+ pdb:
+ description: The configuration of PDB trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ maxUnavailable:
+ description: The number of pods for the Integration that can
+ be unavailable after an eviction. It can be either an absolute
+ number or a percentage (default `1` if `min-available` is
+ also not set). Only one of `max-unavailable` and `min-available`
+ can be specified.
+ type: string
+ minAvailable:
+ description: The number of pods for the Integration that must
+ still be available after an eviction. It can be either an
+ absolute number or a percentage. Only one of `min-available`
+ and `max-unavailable` can be specified.
+ type: string
+ type: object
+ platform:
+ description: The configuration of Platform trait
+ properties:
+ auto:
+ description: To automatically detect from the environment
+ if a default platform can be created (it will be created
+ on OpenShift only).
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ createDefault:
+ description: To create a default (empty) platform when the
+ platform is missing.
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ global:
+ description: Indicates if the platform should be created globally
+ in the case of global operator (default true).
+ type: boolean
+ type: object
+ pod:
+ description: The configuration of Pod trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ prometheus:
+ description: The configuration of Prometheus trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ podMonitor:
+ description: Whether a `PodMonitor` resource is created (default
+ `true`).
+ type: boolean
+ podMonitorLabels:
+ description: The `PodMonitor` resource labels, applicable
+ when `pod-monitor` is `true`.
+ items:
+ type: string
+ type: array
+ type: object
+ pull-secret:
+ description: The configuration of Pull Secret trait
+ properties:
+ auto:
+ description: Automatically configures the platform registry
+ secret on the pod if it is of type `kubernetes.io/dockerconfigjson`.
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ imagePullerDelegation:
+ description: When using a global operator with a shared platform,
+ this enables delegation of the `system:image-puller` cluster
+ role on the operator namespace to the integration service
+ account.
+ type: boolean
+ secretName:
+ description: The pull secret name to set on the Pod. If left
+ empty this is automatically taken from the `IntegrationPlatform`
+ registry configuration.
+ type: string
+ type: object
+ quarkus:
+ description: The configuration of Quarkus trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ packageTypes:
+ description: The Quarkus package types, either `fast-jar`
+ or `native` (default `fast-jar`). In case both `fast-jar`
+ and `native` are specified, two `IntegrationKit` resources
+ are created, with the `native` kit having precedence over
+ the `fast-jar` one once ready. The order influences the
+ resolution of the current kit for the integration. The kit
+ corresponding to the first package type will be assigned
+ to the integration in case no existing kit that matches
+ the integration exists.
+ items:
+ type: string
+ type: array
+ type: object
+ registry:
+ description: The configuration of Registry trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ route:
+ description: The configuration of Route trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ host:
+ description: To configure the host exposed by the route.
+ type: string
+ tlsCACertificate:
+ description: "The TLS CA certificate contents. \n Refer to
+ the OpenShift route documentation for additional information."
+ type: string
+ tlsCACertificateSecret:
+ description: "The secret name and key reference to the TLS
+ CA certificate. The format is \"secret-name[/key-name]\",
+ the value represents the secret name, if there is only one
+ key in the secret it will be read, otherwise you can set
+ a key name separated with a \"/\". \n Refer to the OpenShift
+ route documentation for additional information."
+ type: string
+ tlsCertificate:
+ description: "The TLS certificate contents. \n Refer to the
+ OpenShift route documentation for additional information."
+ type: string
+ tlsCertificateSecret:
+ description: "The secret name and key reference to the TLS
+ certificate. The format is \"secret-name[/key-name]\", the
+ value represents the secret name, if there is only one key
+ in the secret it will be read, otherwise you can set a key
+ name separated with a \"/\". \n Refer to the OpenShift route
+ documentation for additional information."
+ type: string
+ tlsDestinationCACertificate:
+ description: "The destination CA certificate provides the
+ contents of the ca certificate of the final destination.
+ \ When using reencrypt termination this file should be provided
+ in order to have routers use it for health checks on the
+ secure connection. If this field is not specified, the router
+ may provide its own destination CA and perform hostname
+ validation using the short service name (service.namespace.svc),
+ which allows infrastructure generated certificates to automatically
+ verify. \n Refer to the OpenShift route documentation for
+ additional information."
+ type: string
+ tlsDestinationCACertificateSecret:
+ description: "The secret name and key reference to the destination
+ CA certificate. The format is \"secret-name[/key-name]\",
+ the value represents the secret name, if there is only one
+ key in the secret it will be read, otherwise you can set
+ a key name separated with a \"/\". \n Refer to the OpenShift
+ route documentation for additional information."
+ type: string
+ tlsInsecureEdgeTerminationPolicy:
+ description: "To configure how to deal with insecure traffic,
+ e.g. `Allow`, `Disable` or `Redirect` traffic. \n Refer
+ to the OpenShift route documentation for additional information."
+ type: string
+ tlsKey:
+ description: "The TLS certificate key contents. \n Refer to
+ the OpenShift route documentation for additional information."
+ type: string
+ tlsKeySecret:
+ description: "The secret name and key reference to the TLS
+ certificate key. The format is \"secret-name[/key-name]\",
+ the value represents the secret name, if there is only one
+ key in the secret it will be read, otherwise you can set
+ a key name separated with a \"/\". \n Refer to the OpenShift
+ route documentation for additional information."
+ type: string
+ tlsTermination:
+ description: "The TLS termination type, like `edge`, `passthrough`
+ or `reencrypt`. \n Refer to the OpenShift route documentation
+ for additional information."
+ type: string
+ type: object
+ service:
+ description: The configuration of Service trait
+ properties:
+ auto:
+ description: To automatically detect from the code if a Service
+ needs to be created.
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ nodePort:
+ description: Enable Service to be exposed as NodePort (default
+ `false`).
+ type: boolean
+ type: object
+ service-binding:
+ description: The configuration of Service Binding trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ services:
+ description: List of Services in the form [[apigroup/]version:]kind:[namespace/]name
+ items:
+ type: string
+ type: array
+ type: object
+ strimzi:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ toleration:
+ description: The configuration of Toleration trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ taints:
+ description: The list of taints to tolerate, in the form `Key[=Value]:Effect[:Seconds]`
+ items:
+ type: string
+ type: array
+ type: object
+ tracing:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
type: object
version:
description: the Camel K operator version controlling this IntegrationPlatform
diff --git a/helm/camel-k/crds/crd-integration.yaml b/helm/camel-k/crds/crd-integration.yaml
index 764a2e332..e0cc1dbae 100644
--- a/helm/camel-k/crds/crd-integration.yaml
+++ b/helm/camel-k/crds/crd-integration.yaml
@@ -5845,17 +5845,1257 @@ spec:
type: object
type: object
traits:
- additionalProperties:
- description: A TraitSpec contains the configuration of a trait
- properties:
- configuration:
- description: TraitConfiguration parameters configuration
+ description: the traits needed to run this Integration
+ properties:
+ 3scale:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ addons:
+ additionalProperties:
+ description: AddonTrait represents the configuration of an addon
+ trait
type: object
x-kubernetes-preserve-unknown-fields: true
- required:
- - configuration
- type: object
- description: the traits needed to run this Integration
+ description: The extension point with addon traits
+ type: object
+ affinity:
+ description: The configuration of Affinity trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ nodeAffinityLabels:
+ description: Defines a set of nodes the integration pod(s)
+ are eligible to be scheduled on, based on labels on the
+ node.
+ items:
+ type: string
+ type: array
+ podAffinity:
+ description: Always co-locates multiple replicas of the integration
+ in the same node (default *false*).
+ type: boolean
+ podAffinityLabels:
+ description: Defines a set of pods (namely those matching
+ the label selector, relative to the given namespace) that
+ the integration pod(s) should be co-located with.
+ items:
+ type: string
+ type: array
+ podAntiAffinity:
+ description: Never co-locates multiple replicas of the integration
+ in the same node (default *false*).
+ type: boolean
+ podAntiAffinityLabels:
+ description: Defines a set of pods (namely those matching
+ the label selector, relative to the given namespace) that
+ the integration pod(s) should not be co-located with.
+ items:
+ type: string
+ type: array
+ type: object
+ builder:
+ description: The configuration of Builder trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ properties:
+ description: A list of properties to be provided to the build
+ task
+ items:
+ type: string
+ type: array
+ verbose:
+ description: Enable verbose logging on build components that
+ support it (e.g. Kaniko build pod).
+ type: boolean
+ type: object
+ camel:
+ description: The configuration of Camel trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ properties:
+ description: A list of properties to be provided to the Integration
+ runtime
+ items:
+ type: string
+ type: array
+ runtimeVersion:
+ description: The camel-k-runtime version to use for the integration.
+ It overrides the default version set in the Integration
+ Platform.
+ type: string
+ type: object
+ container:
+ description: The configuration of Container trait
+ properties:
+ auto:
+ description: To automatically enable the trait
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ expose:
+ description: Can be used to enable/disable exposure via kubernetes
+ Service.
+ type: boolean
+ image:
+ description: The main container image
+ type: string
+ imagePullPolicy:
+ description: 'The pull policy: Always|Never|IfNotPresent'
+ type: string
+ limitCPU:
+ description: The maximum amount of CPU required.
+ type: string
+ limitMemory:
+ description: The maximum amount of memory required.
+ type: string
+ livenessFailureThreshold:
+ description: 'Minimum consecutive failures for the probe to
+ be considered failed after having succeeded. Applies to
+ the liveness probe. Deprecated: replaced by the health trait.'
+ format: int32
+ type: integer
+ livenessInitialDelay:
+ description: 'Number of seconds after the container has started
+ before liveness probes are initiated. Deprecated: replaced
+ by the health trait.'
+ format: int32
+ type: integer
+ livenessPeriod:
+ description: 'How often to perform the probe. Applies to the
+ liveness probe. Deprecated: replaced by the health trait.'
+ format: int32
+ type: integer
+ livenessScheme:
+ description: 'Scheme to use when connecting. Defaults to HTTP.
+ Applies to the liveness probe. Deprecated: replaced by the
+ health trait.'
+ type: string
+ livenessSuccessThreshold:
+ description: 'Minimum consecutive successes for the probe
+ to be considered successful after having failed. Applies
+ to the liveness probe. Deprecated: replaced by the health
+ trait.'
+ format: int32
+ type: integer
+ livenessTimeout:
+ description: 'Number of seconds after which the probe times
+ out. Applies to the liveness probe. Deprecated: replaced
+ by the health trait.'
+ format: int32
+ type: integer
+ name:
+ description: The main container name. It's named `integration`
+ by default.
+ type: string
+ port:
+ description: To configure a different port exposed by the
+ container (default `8080`).
+ type: integer
+ portName:
+ description: To configure a different port name for the port
+ exposed by the container. It defaults to `http` only when
+ the `expose` parameter is true.
+ type: string
+ probesEnabled:
+ description: 'DeprecatedProbesEnabled enable/disable probes
+ on the container (default `false`) Deprecated: replaced
+ by the health trait.'
+ type: boolean
+ readinessFailureThreshold:
+ description: 'Minimum consecutive failures for the probe to
+ be considered failed after having succeeded. Applies to
+ the readiness probe. Deprecated: replaced by the health
+ trait.'
+ format: int32
+ type: integer
+ readinessInitialDelay:
+ description: 'Number of seconds after the container has started
+ before readiness probes are initiated. Deprecated: replaced
+ by the health trait.'
+ format: int32
+ type: integer
+ readinessPeriod:
+ description: 'How often to perform the probe. Applies to the
+ readiness probe. Deprecated: replaced by the health trait.'
+ format: int32
+ type: integer
+ readinessScheme:
+ description: 'Scheme to use when connecting. Defaults to HTTP.
+ Applies to the readiness probe. Deprecated: replaced by
+ the health trait.'
+ type: string
+ readinessSuccessThreshold:
+ description: 'Minimum consecutive successes for the probe
+ to be considered successful after having failed. Applies
+ to the readiness probe. Deprecated: replaced by the health
+ trait.'
+ format: int32
+ type: integer
+ readinessTimeout:
+ description: 'Number of seconds after which the probe times
+ out. Applies to the readiness probe. Deprecated: replaced
+ by the health trait.'
+ format: int32
+ type: integer
+ requestCPU:
+ description: The minimum amount of CPU required.
+ type: string
+ requestMemory:
+ description: The minimum amount of memory required.
+ type: string
+ servicePort:
+ description: To configure under which service port the container
+ port is to be exposed (default `80`).
+ type: integer
+ servicePortName:
+ description: To configure under which service port name the
+ container port is to be exposed (default `http`).
+ type: string
+ type: object
+ cron:
+ description: The configuration of Cron trait
+ properties:
+ activeDeadlineSeconds:
+ description: Specifies the duration in seconds, relative to
+ the start time, that the job may be continuously active
+ before it is considered to be failed. It defaults to 60s.
+ format: int64
+ type: integer
+ auto:
+ description: "Automatically deploy the integration as CronJob
+ when all routes are either starting from a periodic consumer
+ (only `cron`, `timer` and `quartz` are supported) or a passive
+ consumer (e.g. `direct` is a passive consumer). \n It's
+ required that all periodic consumers have the same period
+ and it can be expressed as cron schedule (e.g. `1m` can
+ be expressed as `0/1 * * * *`, while `35m` or `50s` cannot)."
+ type: boolean
+ backoffLimit:
+ description: Specifies the number of retries before marking
+ the job failed. It defaults to 2.
+ format: int32
+ type: integer
+ components:
+ description: "A comma separated list of the Camel components
+ that need to be customized in order for them to work when
+ the schedule is triggered externally by Kubernetes. A specific
+ customizer is activated for each specified component. E.g.
+ for the `timer` component, the `cron-timer` customizer is
+ activated (it's present in the `org.apache.camel.k:camel-k-cron`
+ library). \n Supported components are currently: `cron`,
+ `timer` and `quartz`."
+ type: string
+ concurrencyPolicy:
+ description: 'Specifies how to treat concurrent executions
+ of a Job. Valid values are: - "Allow": allows CronJobs to
+ run concurrently; - "Forbid" (default): forbids concurrent
+ runs, skipping next run if previous run hasn''t finished
+ yet; - "Replace": cancels currently running job and replaces
+ it with a new one'
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ fallback:
+ description: Use the default Camel implementation of the `cron`
+ endpoint (`quartz`) instead of trying to materialize the
+ integration as Kubernetes CronJob.
+ type: boolean
+ schedule:
+ description: The CronJob schedule for the whole integration.
+ If multiple routes are declared, they must have the same
+ schedule for this mechanism to work correctly.
+ type: string
+ startingDeadlineSeconds:
+ description: Optional deadline in seconds for starting the
+ job if it misses scheduled time for any reason. Missed
+ jobs executions will be counted as failed ones.
+ format: int64
+ type: integer
+ type: object
+ dependencies:
+ description: The configuration of Dependencies trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ deployer:
+ description: The configuration of Deployer trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ kind:
+ description: Allows to explicitly select the desired deployment
+ kind between `deployment`, `cron-job` or `knative-service`
+ when creating the resources for running the integration.
+ type: string
+ useSSA:
+ description: Use server-side apply to update the owned resources
+ (default `true`). Note that it automatically falls back
+ to client-side patching, if SSA is not available, e.g.,
+ on old Kubernetes clusters.
+ type: boolean
+ type: object
+ deployment:
+ description: The configuration of Deployment trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ progressDeadlineSeconds:
+ description: The maximum time in seconds for the deployment
+ to make progress before it is considered to be failed. It
+ defaults to 60s.
+ format: int32
+ type: integer
+ type: object
+ environment:
+ description: The configuration of Environment trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ containerMeta:
+ description: Enables injection of `NAMESPACE` and `POD_NAME`
+ environment variables (default `true`)
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ httpProxy:
+ description: Propagates the `HTTP_PROXY`, `HTTPS_PROXY` and
+ `NO_PROXY` environment variables (default `true`)
+ type: boolean
+ vars:
+ description: A list of environment variables to be added to
+ the integration container. The syntax is KEY=VALUE, e.g.,
+ `MY_VAR="my value"`. These take precedence over the previously
+ defined environment variables.
+ items:
+ type: string
+ type: array
+ type: object
+ error-handler:
+ description: The configuration of Error Handler trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ ref:
+ description: The error handler ref name provided or found
+ in application properties
+ type: string
+ type: object
+ gc:
+ description: The configuration of GC trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ discoveryCache:
+ description: Discovery client cache to be used, either `disabled`,
+ `disk` or `memory` (default `memory`)
+ type: string
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ health:
+ description: The configuration of Health trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ livenessFailureThreshold:
+ description: Minimum consecutive failures for the liveness
+ probe to be considered failed after having succeeded.
+ format: int32
+ type: integer
+ livenessInitialDelay:
+ description: Number of seconds after the container has started
+ before the liveness probe is initiated.
+ format: int32
+ type: integer
+ livenessPeriod:
+ description: How often to perform the liveness probe.
+ format: int32
+ type: integer
+ livenessProbeEnabled:
+ description: Configures the liveness probe for the integration
+ container (default `false`).
+ type: boolean
+ livenessScheme:
+ description: Scheme to use when connecting to the liveness
+ probe (default `HTTP`).
+ type: string
+ livenessSuccessThreshold:
+ description: Minimum consecutive successes for the liveness
+ probe to be considered successful after having failed.
+ format: int32
+ type: integer
+ livenessTimeout:
+ description: Number of seconds after which the liveness probe
+ times out.
+ format: int32
+ type: integer
+ readinessFailureThreshold:
+ description: Minimum consecutive failures for the readiness
+ probe to be considered failed after having succeeded.
+ format: int32
+ type: integer
+ readinessInitialDelay:
+ description: Number of seconds after the container has started
+ before the readiness probe is initiated.
+ format: int32
+ type: integer
+ readinessPeriod:
+ description: How often to perform the readiness probe.
+ format: int32
+ type: integer
+ readinessProbeEnabled:
+ description: Configures the readiness probe for the integration
+ container (default `true`).
+ type: boolean
+ readinessScheme:
+ description: Scheme to use when connecting to the readiness
+ probe (default `HTTP`).
+ type: string
+ readinessSuccessThreshold:
+ description: Minimum consecutive successes for the readiness
+ probe to be considered successful after having failed.
+ format: int32
+ type: integer
+ readinessTimeout:
+ description: Number of seconds after which the readiness probe
+ times out.
+ format: int32
+ type: integer
+ type: object
+ ingress:
+ description: The configuration of Ingress trait
+ properties:
+ auto:
+ description: To automatically add an ingress whenever the
+ integration uses a HTTP endpoint consumer.
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ host:
+ description: '**Required**. To configure the host exposed
+ by the ingress.'
+ type: string
+ type: object
+ istio:
+ description: The configuration of Istio trait
+ properties:
+ allow:
+ description: Configures a (comma-separated) list of CIDR subnets
+ that should not be intercepted by the Istio proxy (`10.0.0.0/8,172.16.0.0/12,192.168.0.0/16`
+ by default).
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ inject:
+ description: Forces the value for labels `sidecar.istio.io/inject`.
+ By default the label is set to `true` on deployment and
+ not set on Knative Service.
+ type: boolean
+ type: object
+ jolokia:
+ description: The configuration of Jolokia trait
+ properties:
+ CACert:
+ description: The PEM encoded CA certification file path, used
+ to verify client certificates, applicable when `protocol`
+ is `https` and `use-ssl-client-authentication` is `true`
+ (default `/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt`
+ for OpenShift).
+ type: string
+ clientPrincipal:
+ description: The principal(s) which must be given in a client
+ certificate to allow access to the Jolokia endpoint, applicable
+ when `protocol` is `https` and `use-ssl-client-authentication`
+ is `true` (default `clientPrincipal=cn=system:master-proxy`,
+ `cn=hawtio-online.hawtio.svc` and `cn=fuse-console.fuse.svc`
+ for OpenShift).
+ items:
+ type: string
+ type: array
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ discoveryEnabled:
+ description: Listen for multicast requests (default `false`)
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ extendedClientCheck:
+ description: Mandate the client certificate contains a client
+ flag in the extended key usage section, applicable when
+ `protocol` is `https` and `use-ssl-client-authentication`
+ is `true` (default `true` for OpenShift).
+ type: boolean
+ host:
+ description: The Host address to which the Jolokia agent should
+ bind to. If `"\*"` or `"0.0.0.0"` is given, the servers
+ binds to every network interface (default `"*"`).
+ type: string
+ options:
+ description: A list of additional Jolokia options as defined
+ in https://jolokia.org/reference/html/agents.html#agent-jvm-config[JVM
+ agent configuration options]
+ items:
+ type: string
+ type: array
+ password:
+ description: The password used for authentication, applicable
+ when the `user` option is set.
+ type: string
+ port:
+ description: The Jolokia endpoint port (default `8778`).
+ type: integer
+ protocol:
+ description: The protocol to use, either `http` or `https`
+ (default `https` for OpenShift)
+ type: string
+ useSSLClientAuthentication:
+ description: Whether client certificates should be used for
+ authentication (default `true` for OpenShift).
+ type: boolean
+ user:
+ description: The user to be used for authentication
+ type: string
+ type: object
+ jvm:
+ description: The configuration of JVM trait
+ properties:
+ classpath:
+ description: Additional JVM classpath (use `Linux` classpath
+ separator)
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ debug:
+ description: Activates remote debugging, so that a debugger
+ can be attached to the JVM, e.g., using port-forwarding
+ type: boolean
+ debugAddress:
+ description: Transport address at which to listen for the
+ newly launched JVM (default `*:5005`)
+ type: string
+ debugSuspend:
+ description: Suspends the target JVM immediately before the
+ main class is loaded
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ options:
+ description: A list of JVM options
+ items:
+ type: string
+ type: array
+ printCommand:
+ description: Prints the command used the start the JVM in
+ the container logs (default `true`)
+ type: boolean
+ type: object
+ kamelets:
+ description: The configuration of Kamelets trait
+ properties:
+ auto:
+ description: Automatically inject all referenced Kamelets
+ and their default configuration (enabled by default)
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ list:
+ description: Comma separated list of Kamelet names to load
+ into the current integration
+ type: string
+ type: object
+ keda:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ knative:
+ description: The configuration of Knative trait
+ properties:
+ auto:
+ description: Enable automatic discovery of all trait properties.
+ type: boolean
+ channelSinks:
+ description: List of channels used as destination of integration
+ routes. Can contain simple channel names or full Camel URIs.
+ items:
+ type: string
+ type: array
+ channelSources:
+ description: List of channels used as source of integration
+ routes. Can contain simple channel names or full Camel URIs.
+ items:
+ type: string
+ type: array
+ config:
+ description: Can be used to inject a Knative complete configuration
+ in JSON format.
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ endpointSinks:
+ description: List of endpoints used as destination of integration
+ routes. Can contain simple endpoint names or full Camel
+ URIs.
+ items:
+ type: string
+ type: array
+ endpointSources:
+ description: List of channels used as source of integration
+ routes.
+ items:
+ type: string
+ type: array
+ eventSinks:
+ description: List of event types that the integration will
+ produce. Can contain simple event types or full Camel URIs
+ (to use a specific broker).
+ items:
+ type: string
+ type: array
+ eventSources:
+ description: List of event types that the integration will
+ be subscribed to. Can contain simple event types or full
+ Camel URIs (to use a specific broker different from "default").
+ items:
+ type: string
+ type: array
+ filterSourceChannels:
+ description: Enables filtering on events based on the header
+ "ce-knativehistory". Since this header has been removed
+ in newer versions of Knative, filtering is disabled by default.
+ type: boolean
+ sinkBinding:
+ description: Allows binding the integration to a sink via
+ a Knative SinkBinding resource. This can be used when the
+ integration targets a single sink. It's enabled by default
+ when the integration targets a single sink (except when
+ the integration is owned by a Knative source).
+ type: boolean
+ type: object
+ knative-service:
+ description: The configuration of Knative Service trait
+ properties:
+ auto:
+ description: "Automatically deploy the integration as Knative
+ service when all conditions hold: \n * Integration is using
+ the Knative profile * All routes are either starting from
+ a HTTP based consumer or a passive consumer (e.g. `direct`
+ is a passive consumer)"
+ type: boolean
+ autoscalingMetric:
+ description: "Configures the Knative autoscaling metric property
+ (e.g. to set `concurrency` based or `cpu` based autoscaling).
+ \n Refer to the Knative documentation for more information."
+ type: string
+ autoscalingTarget:
+ description: "Sets the allowed concurrency level or CPU percentage
+ (depending on the autoscaling metric) for each Pod. \n Refer
+ to the Knative documentation for more information."
+ type: integer
+ class:
+ description: "Configures the Knative autoscaling class property
+ (e.g. to set `hpa.autoscaling.knative.dev` or `kpa.autoscaling.knative.dev`
+ autoscaling). \n Refer to the Knative documentation for
+ more information."
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ maxScale:
+ description: "An upper bound for the number of Pods that can
+ be running in parallel for the integration. Knative has
+ its own cap value that depends on the installation. \n Refer
+ to the Knative documentation for more information."
+ type: integer
+ minScale:
+ description: "The minimum number of Pods that should be running
+ at any time for the integration. It's **zero** by default,
+ meaning that the integration is scaled down to zero when
+ not used for a configured amount of time. \n Refer to the
+ Knative documentation for more information."
+ type: integer
+ rolloutDuration:
+ description: Enables to gradually shift traffic to the latest
+ Revision and sets the rollout duration. It's disabled by
+ default and must be expressed as a Golang `time.Duration`
+ string representation, rounded to a second precision.
+ type: string
+ type: object
+ logging:
+ description: The configuration of Logging trait
+ properties:
+ color:
+ description: Colorize the log output
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ format:
+ description: Logs message format
+ type: string
+ json:
+ description: Output the logs in JSON
+ type: boolean
+ jsonPrettyPrint:
+ description: Enable "pretty printing" of the JSON logs
+ type: boolean
+ level:
+ description: Adjust the logging level (defaults to INFO)
+ type: string
+ type: object
+ master:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ mount:
+ description: The configuration of Mount trait
+ properties:
+ configs:
+ description: 'A list of configuration pointing to configmap/secret.
+ The configuration are expected to be UTF-8 resources as
+ they are processed by runtime Camel Context and tried to
+ be parsed as property files. They are also made available
+ on the classpath in order to ease their usage directly from
+ the Route. Syntax: [configmap|secret]:name[/key], where
+ name represents the resource name and key optionally represents
+ the resource key to be filtered'
+ items:
+ type: string
+ type: array
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ resources:
+ description: 'A list of resources (text or binary content)
+ pointing to configmap/secret. The resources are expected
+ to be any resource type (text or binary content). The destination
+ path can be either a default location or any path specified
+ by the user. Syntax: [configmap|secret]:name[/key][@path],
+ where name represents the resource name, key optionally
+ represents the resource key to be filtered and path represents
+ the destination path'
+ items:
+ type: string
+ type: array
+ volumes:
+ description: 'A list of Persistent Volume Claims to be mounted.
+ Syntax: [pvcname:/container/path]'
+ items:
+ type: string
+ type: array
+ type: object
+ openapi:
+ description: The configuration of OpenAPI trait
+ properties:
+ configmaps:
+ description: The configmaps holding the spec of the OpenAPI
+ items:
+ type: string
+ type: array
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ owner:
+ description: The configuration of Owner trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ targetAnnotations:
+ description: The set of annotations to be transferred
+ items:
+ type: string
+ type: array
+ targetLabels:
+ description: The set of labels to be transferred
+ items:
+ type: string
+ type: array
+ type: object
+ pdb:
+ description: The configuration of PDB trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ maxUnavailable:
+ description: The number of pods for the Integration that can
+ be unavailable after an eviction. It can be either an absolute
+ number or a percentage (default `1` if `min-available` is
+ also not set). Only one of `max-unavailable` and `min-available`
+ can be specified.
+ type: string
+ minAvailable:
+ description: The number of pods for the Integration that must
+ still be available after an eviction. It can be either an
+ absolute number or a percentage. Only one of `min-available`
+ and `max-unavailable` can be specified.
+ type: string
+ type: object
+ platform:
+ description: The configuration of Platform trait
+ properties:
+ auto:
+ description: To automatically detect from the environment
+ if a default platform can be created (it will be created
+ on OpenShift only).
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ createDefault:
+ description: To create a default (empty) platform when the
+ platform is missing.
+ type: boolean
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ global:
+ description: Indicates if the platform should be created globally
+ in the case of global operator (default true).
+ type: boolean
+ type: object
+ pod:
+ description: The configuration of Pod trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ type: object
+ prometheus:
+ description: The configuration of Prometheus trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ podMonitor:
+ description: Whether a `PodMonitor` resource is created (default
+ `true`).
+ type: boolean
+ podMonitorLabels:
+ description: The `PodMonitor` resource labels, applicable
+ when `pod-monitor` is `true`.
+ items:
+ type: string
+ type: array
+ type: object
+ pull-secret:
+ description: The configuration of Pull Secret trait
+ properties:
+ auto:
+ description: Automatically configures the platform registry
+ secret on the pod if it is of type `kubernetes.io/dockerconfigjson`.
+ type: boolean
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ imagePullerDelegation:
+ description: When using a global operator with a shared platform,
+ this enables delegation of the `system:image-puller` cluster
+ role on the operator namespace to the integration service
... 2002 lines suppressed ...
[camel-k] 03/14: chore(trait): move traits to a dedicated API pkg
Posted by ts...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tsato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit c959a3f17431ad61cad84df58b20247d7dc3692b
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Tue Apr 26 23:51:37 2022 +0900
chore(trait): move traits to a dedicated API pkg
---
addons/keda/keda.go | 3 +-
addons/master/master.go | 3 +-
addons/threescale/3scale.go | 4 +-
addons/tracing/tracing.go | 3 +-
pkg/apis/camel/v1/common_types.go | 70 +-
pkg/apis/camel/v1/integrationkit_types.go | 10 +-
.../v1/{trait_affinity.go => trait/affinity.go} | 2 +-
pkg/apis/camel/v1/{trait_base.go => trait/base.go} | 2 +-
.../v1/{trait_builder.go => trait/builder.go} | 2 +-
.../camel/v1/{trait_camel.go => trait/camel.go} | 2 +-
.../v1/{trait_container.go => trait/container.go} | 2 +-
pkg/apis/camel/v1/{trait_cron.go => trait/cron.go} | 2 +-
.../dependencies.go} | 2 +-
.../v1/{trait_deployer.go => trait/deployer.go} | 2 +-
.../{trait_deployment.go => trait/deployment.go} | 2 +-
.../camel/v1/{trait_registry.go => trait/doc.go} | 13 +-
.../{trait_environment.go => trait/environment.go} | 2 +-
.../error_handler.go} | 2 +-
pkg/apis/camel/v1/{trait_gc.go => trait/gc.go} | 2 +-
.../camel/v1/{trait_health.go => trait/health.go} | 2 +-
.../v1/{trait_ingress.go => trait/ingress.go} | 2 +-
.../camel/v1/{trait_istio.go => trait/istio.go} | 2 +-
.../v1/{trait_jolokia.go => trait/jolokia.go} | 2 +-
pkg/apis/camel/v1/{trait_jvm.go => trait/jvm.go} | 2 +-
.../v1/{trait_kamelets.go => trait/kamelets.go} | 2 +-
.../v1/{trait_knative.go => trait/knative.go} | 2 +-
.../knative_service.go} | 2 +-
.../v1/{trait_logging.go => trait/logging.go} | 2 +-
.../camel/v1/{trait_mount.go => trait/mount.go} | 2 +-
.../v1/{trait_openapi.go => trait/openapi.go} | 2 +-
.../camel/v1/{trait_owner.go => trait/owner.go} | 2 +-
pkg/apis/camel/v1/{trait_pdb.go => trait/pdb.go} | 2 +-
.../v1/{trait_platform.go => trait/platform.go} | 2 +-
pkg/apis/camel/v1/{trait_pod.go => trait/pod.go} | 2 +-
.../{trait_prometheus.go => trait/prometheus.go} | 2 +-
.../{trait_pull_secret.go => trait/pull_secret.go} | 2 +-
.../v1/{trait_quarkus.go => trait/quarkus.go} | 2 +-
.../v1/{trait_registry.go => trait/registry.go} | 2 +-
.../camel/v1/{trait_route.go => trait/route.go} | 2 +-
.../v1/{trait_service.go => trait/service.go} | 2 +-
.../service_binding.go} | 2 +-
.../{trait_toleration.go => trait/toleration.go} | 2 +-
pkg/apis/camel/v1/trait/zz_generated.deepcopy.go | 941 ++++++++++++++++++
pkg/apis/camel/v1/zz_generated.deepcopy.go | 1049 ++------------------
pkg/cmd/debug.go | 3 +-
pkg/cmd/run_test.go | 13 +-
pkg/controller/integration/kits_test.go | 25 +-
pkg/trait/affinity.go | 5 +-
pkg/trait/builder.go | 3 +-
pkg/trait/camel.go | 3 +-
pkg/trait/container.go | 5 +-
pkg/trait/container_probes_test.go | 13 +-
pkg/trait/container_test.go | 9 +-
pkg/trait/cron.go | 3 +-
pkg/trait/cron_test.go | 7 +-
pkg/trait/dependencies.go | 3 +-
pkg/trait/deployer.go | 4 +-
pkg/trait/deployment.go | 3 +-
pkg/trait/environment.go | 6 +-
pkg/trait/environment_test.go | 7 +-
pkg/trait/error_handler.go | 3 +-
pkg/trait/gc.go | 11 +-
pkg/trait/health.go | 5 +-
pkg/trait/ingress.go | 5 +-
pkg/trait/init.go | 3 +-
pkg/trait/istio.go | 7 +-
pkg/trait/istio_test.go | 5 +-
pkg/trait/jolokia.go | 5 +-
pkg/trait/jvm.go | 5 +-
pkg/trait/kamelets.go | 3 +-
pkg/trait/knative.go | 3 +-
pkg/trait/knative_service.go | 3 +-
pkg/trait/knative_service_test.go | 15 +-
pkg/trait/knative_test.go | 13 +-
pkg/trait/logging.go | 6 +-
pkg/trait/logging_test.go | 3 +-
pkg/trait/mount.go | 3 +-
pkg/trait/mount_test.go | 3 +-
pkg/trait/openapi.go | 3 +-
pkg/trait/owner.go | 3 +-
pkg/trait/owner_test.go | 3 +-
pkg/trait/pdb.go | 3 +-
pkg/trait/platform.go | 3 +-
pkg/trait/pod.go | 3 +-
pkg/trait/prometheus.go | 5 +-
pkg/trait/pull_secret.go | 4 +-
pkg/trait/quarkus.go | 31 +-
pkg/trait/registry.go | 3 +-
pkg/trait/route.go | 5 +-
pkg/trait/route_test.go | 23 +-
pkg/trait/service.go | 3 +-
pkg/trait/service_binding.go | 3 +-
pkg/trait/service_test.go | 23 +-
pkg/trait/toleration.go | 4 +-
pkg/trait/trait_configure_test.go | 9 +-
pkg/trait/trait_test.go | 17 +-
pkg/util/bindings/bindings_test.go | 3 +-
pkg/util/bindings/knative_uri.go | 3 +-
98 files changed, 1299 insertions(+), 1234 deletions(-)
diff --git a/addons/keda/keda.go b/addons/keda/keda.go
index a556cc575..4d04fdd18 100644
--- a/addons/keda/keda.go
+++ b/addons/keda/keda.go
@@ -27,6 +27,7 @@ import (
kedav1alpha1 "github.com/apache/camel-k/addons/keda/duck/v1alpha1"
camelv1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
camelv1alpha1 "github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
"github.com/apache/camel-k/pkg/kamelet/repository"
"github.com/apache/camel-k/pkg/metadata"
@@ -73,7 +74,7 @@ const (
//
// +camel-k:trait=keda.
type Trait struct {
- camelv1.Trait `property:",squash" json:",inline"`
+ traitv1.Trait `property:",squash" json:",inline"`
// Enables automatic configuration of the trait. Allows the trait to infer KEDA triggers from the Kamelets.
Auto *bool `property:"auto" json:"auto,omitempty"`
// Set the spec->replicas field on the top level controller to an explicit value if missing, to allow KEDA to recognize it as a scalable resource.
diff --git a/addons/master/master.go b/addons/master/master.go
index ddb2e06ec..7c002b539 100644
--- a/addons/master/master.go
+++ b/addons/master/master.go
@@ -24,6 +24,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime/pkg/client"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/metadata"
"github.com/apache/camel-k/pkg/resources"
"github.com/apache/camel-k/pkg/trait"
@@ -42,7 +43,7 @@ import (
//
// +camel-k:trait=master.
type Trait struct {
- v1.Trait `property:",squash" json:",inline"`
+ traitv1.Trait `property:",squash" json:",inline"`
// Enables automatic configuration of the trait.
Auto *bool `property:"auto" json:"auto,omitempty"`
// When this flag is active, the operator analyzes the source code to add dependencies required by delegate endpoints.
diff --git a/addons/threescale/3scale.go b/addons/threescale/3scale.go
index 7f11cd585..85e8c08a0 100644
--- a/addons/threescale/3scale.go
+++ b/addons/threescale/3scale.go
@@ -22,7 +22,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/trait"
)
@@ -33,7 +33,7 @@ import (
//
// +camel-k:trait=3scale.
type Trait struct {
- v1.Trait `property:",squash" json:",inline"`
+ traitv1.Trait `property:",squash" json:",inline"`
// Enables automatic configuration of the trait.
Auto *bool `property:"auto" json:"auto,omitempty"`
// The scheme to use to contact the service (default `http`)
diff --git a/addons/tracing/tracing.go b/addons/tracing/tracing.go
index f43f5e88b..1fffd3dc8 100644
--- a/addons/tracing/tracing.go
+++ b/addons/tracing/tracing.go
@@ -22,6 +22,7 @@ import (
"github.com/apache/camel-k/addons/tracing/discovery"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/trait"
"github.com/apache/camel-k/pkg/util"
)
@@ -35,7 +36,7 @@ import (
//
// +camel-k:trait=tracing.
type Trait struct {
- v1.Trait `property:",squash" json:",inline"`
+ traitv1.Trait `property:",squash" json:",inline"`
// Enables automatic configuration of the trait, including automatic discovery of the tracing endpoint.
Auto *bool `property:"auto" json:"auto,omitempty"`
// The name of the service that publishes tracing data (defaults to the integration name)
diff --git a/pkg/apis/camel/v1/common_types.go b/pkg/apis/camel/v1/common_types.go
index 04e822224..83d95c93e 100644
--- a/pkg/apis/camel/v1/common_types.go
+++ b/pkg/apis/camel/v1/common_types.go
@@ -20,6 +20,8 @@ package v1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
)
const (
@@ -104,73 +106,73 @@ type FailureRecovery struct {
// Traits represents the collection of trait configurations
type Traits struct {
// The configuration of Affinity trait
- Affinity *AffinityTrait `property:"affinity" json:"affinity,omitempty"`
+ Affinity *trait.AffinityTrait `property:"affinity" json:"affinity,omitempty"`
// The configuration of Builder trait
- Builder *BuilderTrait `property:"builder" json:"builder,omitempty"`
+ Builder *trait.BuilderTrait `property:"builder" json:"builder,omitempty"`
// The configuration of Camel trait
- Camel *CamelTrait `property:"camel" json:"camel,omitempty"`
+ Camel *trait.CamelTrait `property:"camel" json:"camel,omitempty"`
// The configuration of Container trait
- Container *ContainerTrait `property:"container" json:"container,omitempty"`
+ Container *trait.ContainerTrait `property:"container" json:"container,omitempty"`
// The configuration of Cron trait
- Cron *CronTrait `property:"cron" json:"cron,omitempty"`
+ Cron *trait.CronTrait `property:"cron" json:"cron,omitempty"`
// The configuration of Dependencies trait
- Dependencies *DependenciesTrait `property:"dependencies" json:"dependencies,omitempty"`
+ Dependencies *trait.DependenciesTrait `property:"dependencies" json:"dependencies,omitempty"`
// The configuration of Deployer trait
- Deployer *DeployerTrait `property:"deployer" json:"deployer,omitempty"`
+ Deployer *trait.DeployerTrait `property:"deployer" json:"deployer,omitempty"`
// The configuration of Deployment trait
- Deployment *DeploymentTrait `property:"deployment" json:"deployment,omitempty"`
+ Deployment *trait.DeploymentTrait `property:"deployment" json:"deployment,omitempty"`
// The configuration of Environment trait
- Environment *EnvironmentTrait `property:"environment" json:"environment,omitempty"`
+ Environment *trait.EnvironmentTrait `property:"environment" json:"environment,omitempty"`
// The configuration of Error Handler trait
- ErrorHandler *ErrorHandlerTrait `property:"error-handler" json:"error-handler,omitempty"`
+ ErrorHandler *trait.ErrorHandlerTrait `property:"error-handler" json:"error-handler,omitempty"`
// The configuration of GC trait
- GC *GCTrait `property:"gc" json:"gc,omitempty"`
+ GC *trait.GCTrait `property:"gc" json:"gc,omitempty"`
// The configuration of Health trait
- Health *HealthTrait `property:"health" json:"health,omitempty"`
+ Health *trait.HealthTrait `property:"health" json:"health,omitempty"`
// The configuration of Ingress trait
- Ingress *IngressTrait `property:"ingress" json:"ingress,omitempty"`
+ Ingress *trait.IngressTrait `property:"ingress" json:"ingress,omitempty"`
// The configuration of Istio trait
- Istio *IstioTrait `property:"istio" json:"istio,omitempty"`
+ Istio *trait.IstioTrait `property:"istio" json:"istio,omitempty"`
// The configuration of Jolokia trait
- Jolokia *JolokiaTrait `property:"jolokia" json:"jolokia,omitempty"`
+ Jolokia *trait.JolokiaTrait `property:"jolokia" json:"jolokia,omitempty"`
// The configuration of JVM trait
- JVM *JVMTrait `property:"jvm" json:"jvm,omitempty"`
+ JVM *trait.JVMTrait `property:"jvm" json:"jvm,omitempty"`
// The configuration of Kamelets trait
- Kamelets *KameletsTrait `property:"kamelets" json:"kamelets,omitempty"`
+ Kamelets *trait.KameletsTrait `property:"kamelets" json:"kamelets,omitempty"`
// The configuration of Knative trait
- Knative *KnativeTrait `property:"knative" json:"knative,omitempty"`
+ Knative *trait.KnativeTrait `property:"knative" json:"knative,omitempty"`
// The configuration of Knative Service trait
- KnativeService *KnativeServiceTrait `property:"knative-service" json:"knative-service,omitempty"`
+ KnativeService *trait.KnativeServiceTrait `property:"knative-service" json:"knative-service,omitempty"`
// The configuration of Logging trait
- Logging *LoggingTrait `property:"logging" json:"logging,omitempty"`
+ Logging *trait.LoggingTrait `property:"logging" json:"logging,omitempty"`
// The configuration of Mount trait
- Mount *MountTrait `property:"mount" json:"mount,omitempty"`
+ Mount *trait.MountTrait `property:"mount" json:"mount,omitempty"`
// The configuration of OpenAPI trait
- OpenAPI *OpenAPITrait `property:"openapi" json:"openapi,omitempty"`
+ OpenAPI *trait.OpenAPITrait `property:"openapi" json:"openapi,omitempty"`
// The configuration of Owner trait
- Owner *OwnerTrait `property:"owner" json:"owner,omitempty"`
+ Owner *trait.OwnerTrait `property:"owner" json:"owner,omitempty"`
// The configuration of PDB trait
- PDB *PDBTrait `property:"pdb" json:"pdb,omitempty"`
+ PDB *trait.PDBTrait `property:"pdb" json:"pdb,omitempty"`
// The configuration of Platform trait
- Platform *PlatformTrait `property:"platform" json:"platform,omitempty"`
+ Platform *trait.PlatformTrait `property:"platform" json:"platform,omitempty"`
// The configuration of Pod trait
- Pod *PodTrait `property:"pod" json:"pod,omitempty"`
+ Pod *trait.PodTrait `property:"pod" json:"pod,omitempty"`
// The configuration of Prometheus trait
- Prometheus *PrometheusTrait `property:"prometheus" json:"prometheus,omitempty"`
+ Prometheus *trait.PrometheusTrait `property:"prometheus" json:"prometheus,omitempty"`
// The configuration of Pull Secret trait
- PullSecret *PullSecretTrait `property:"pull-secret" json:"pull-secret,omitempty"`
+ PullSecret *trait.PullSecretTrait `property:"pull-secret" json:"pull-secret,omitempty"`
// The configuration of Quarkus trait
- Quarkus *QuarkusTrait `property:"quarkus" json:"quarkus,omitempty"`
+ Quarkus *trait.QuarkusTrait `property:"quarkus" json:"quarkus,omitempty"`
// The configuration of Registry trait
- Registry *RegistryTrait `property:"registry" json:"registry,omitempty"`
+ Registry *trait.RegistryTrait `property:"registry" json:"registry,omitempty"`
// The configuration of Route trait
- Route *RouteTrait `property:"route" json:"route,omitempty"`
+ Route *trait.RouteTrait `property:"route" json:"route,omitempty"`
// The configuration of Service trait
- Service *ServiceTrait `property:"service" json:"service,omitempty"`
+ Service *trait.ServiceTrait `property:"service" json:"service,omitempty"`
// The configuration of Service Binding trait
- ServiceBinding *ServiceBindingTrait `property:"service-binding" json:"service-binding,omitempty"`
+ ServiceBinding *trait.ServiceBindingTrait `property:"service-binding" json:"service-binding,omitempty"`
// The configuration of Toleration trait
- Toleration *TolerationTrait `property:"toleration" json:"toleration,omitempty"`
+ Toleration *trait.TolerationTrait `property:"toleration" json:"toleration,omitempty"`
}
// +kubebuilder:validation:Type=object
diff --git a/pkg/apis/camel/v1/integrationkit_types.go b/pkg/apis/camel/v1/integrationkit_types.go
index b3865ff57..e31e8c6c7 100644
--- a/pkg/apis/camel/v1/integrationkit_types.go
+++ b/pkg/apis/camel/v1/integrationkit_types.go
@@ -20,6 +20,8 @@ package v1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
@@ -67,8 +69,12 @@ type IntegrationKitSpec struct {
// IntegrationKitTraits defines traits assigned to an `IntegrationKit`
type IntegrationKitTraits struct {
- Builder *BuilderTrait `property:"builder" json:"builder,omitempty"`
- Quarkus *QuarkusTrait `property:"quarkus" json:"quarkus,omitempty"`
+ // The builder trait is internally used to determine the best strategy to build and configure IntegrationKits.
+ Builder *trait.BuilderTrait `property:"builder" json:"builder,omitempty"`
+ // The Quarkus trait configures the Quarkus runtime.
+ // It's enabled by default.
+ // NOTE: Compiling to a native executable, i.e. when using `package-type=native`, is only supported for kamelets, as well as YAML and XML integrations. It also requires at least 4GiB of memory, so the Pod running the native build, that is either the operator Pod, or the build Pod (depending on the build strategy configured for the platform), must have enough memory available.
+ Quarkus *trait.QuarkusTrait `property:"quarkus" json:"quarkus,omitempty"`
}
// IntegrationKitStatus defines the observed state of IntegrationKit
diff --git a/pkg/apis/camel/v1/trait_affinity.go b/pkg/apis/camel/v1/trait/affinity.go
similarity index 99%
rename from pkg/apis/camel/v1/trait_affinity.go
rename to pkg/apis/camel/v1/trait/affinity.go
index c710c86cf..a62a27f44 100644
--- a/pkg/apis/camel/v1/trait_affinity.go
+++ b/pkg/apis/camel/v1/trait/affinity.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// Allows constraining which nodes the integration pod(s) are eligible to be scheduled on, based on labels on the node,
// or with inter-pod affinity and anti-affinity, based on labels on pods that are already running on the nodes.
diff --git a/pkg/apis/camel/v1/trait_base.go b/pkg/apis/camel/v1/trait/base.go
similarity index 98%
rename from pkg/apis/camel/v1/trait_base.go
rename to pkg/apis/camel/v1/trait/base.go
index 8cb984830..863d17a2f 100644
--- a/pkg/apis/camel/v1/trait_base.go
+++ b/pkg/apis/camel/v1/trait/base.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// Base type for all traits.
type Trait struct {
diff --git a/pkg/apis/camel/v1/trait_builder.go b/pkg/apis/camel/v1/trait/builder.go
similarity index 98%
rename from pkg/apis/camel/v1/trait_builder.go
rename to pkg/apis/camel/v1/trait/builder.go
index c619284b2..69e9c0d9a 100644
--- a/pkg/apis/camel/v1/trait_builder.go
+++ b/pkg/apis/camel/v1/trait/builder.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The builder trait is internally used to determine the best strategy to
// build and configure IntegrationKits.
diff --git a/pkg/apis/camel/v1/trait_camel.go b/pkg/apis/camel/v1/trait/camel.go
similarity index 98%
rename from pkg/apis/camel/v1/trait_camel.go
rename to pkg/apis/camel/v1/trait/camel.go
index 55a63f665..565b63752 100644
--- a/pkg/apis/camel/v1/trait_camel.go
+++ b/pkg/apis/camel/v1/trait/camel.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The Camel trait can be used to configure versions of Apache Camel K runtime and related libraries, it cannot be disabled.
//
diff --git a/pkg/apis/camel/v1/trait_container.go b/pkg/apis/camel/v1/trait/container.go
similarity index 99%
rename from pkg/apis/camel/v1/trait_container.go
rename to pkg/apis/camel/v1/trait/container.go
index 9d4ed991d..bec7008e8 100644
--- a/pkg/apis/camel/v1/trait_container.go
+++ b/pkg/apis/camel/v1/trait/container.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
import corev1 "k8s.io/api/core/v1"
diff --git a/pkg/apis/camel/v1/trait_cron.go b/pkg/apis/camel/v1/trait/cron.go
similarity index 99%
rename from pkg/apis/camel/v1/trait_cron.go
rename to pkg/apis/camel/v1/trait/cron.go
index 3f0578c71..84bd87c90 100644
--- a/pkg/apis/camel/v1/trait_cron.go
+++ b/pkg/apis/camel/v1/trait/cron.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The Cron trait can be used to customize the behaviour of periodic timer/cron based integrations.
//
diff --git a/pkg/apis/camel/v1/trait_dependencies.go b/pkg/apis/camel/v1/trait/dependencies.go
similarity index 98%
rename from pkg/apis/camel/v1/trait_dependencies.go
rename to pkg/apis/camel/v1/trait/dependencies.go
index 07a639ae8..7ea9772d6 100644
--- a/pkg/apis/camel/v1/trait_dependencies.go
+++ b/pkg/apis/camel/v1/trait/dependencies.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The Dependencies trait is internally used to automatically add runtime dependencies based on the
// integration that the user wants to run.
diff --git a/pkg/apis/camel/v1/trait_deployer.go b/pkg/apis/camel/v1/trait/deployer.go
similarity index 99%
rename from pkg/apis/camel/v1/trait_deployer.go
rename to pkg/apis/camel/v1/trait/deployer.go
index a651d5ead..f26f72bed 100644
--- a/pkg/apis/camel/v1/trait_deployer.go
+++ b/pkg/apis/camel/v1/trait/deployer.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The deployer trait is responsible for deploying the resources owned by the integration, and can be used
// to explicitly select the underlying controller that will manage the integration pods.
diff --git a/pkg/apis/camel/v1/trait_deployment.go b/pkg/apis/camel/v1/trait/deployment.go
similarity index 98%
rename from pkg/apis/camel/v1/trait_deployment.go
rename to pkg/apis/camel/v1/trait/deployment.go
index e1df04b16..f862c66f9 100644
--- a/pkg/apis/camel/v1/trait_deployment.go
+++ b/pkg/apis/camel/v1/trait/deployment.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The Deployment trait is responsible for generating the Kubernetes deployment that will make sure
// the integration will run in the cluster.
diff --git a/pkg/apis/camel/v1/trait_registry.go b/pkg/apis/camel/v1/trait/doc.go
similarity index 78%
copy from pkg/apis/camel/v1/trait_registry.go
copy to pkg/apis/camel/v1/trait/doc.go
index 939cf01c7..4a5a388d0 100644
--- a/pkg/apis/camel/v1/trait_registry.go
+++ b/pkg/apis/camel/v1/trait/doc.go
@@ -15,12 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
-
-// The Registry trait sets up Maven to use the Image registry
-// as a Maven repository.
-//
-// +camel-k:trait=registry.
-type RegistryTrait struct {
- Trait `property:",squash" json:",inline"`
-}
+// Package trait contains Trait API Schema definitions for the camel v1 API group
+// +kubebuilder:object:generate=true
+// +groupName=camel.apache.org
+package trait
diff --git a/pkg/apis/camel/v1/trait_environment.go b/pkg/apis/camel/v1/trait/environment.go
similarity index 99%
rename from pkg/apis/camel/v1/trait_environment.go
rename to pkg/apis/camel/v1/trait/environment.go
index e7d7c8055..c0411a44e 100644
--- a/pkg/apis/camel/v1/trait_environment.go
+++ b/pkg/apis/camel/v1/trait/environment.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The environment trait is used internally to inject standard environment variables in the integration container,
// such as `NAMESPACE`, `POD_NAME` and others.
diff --git a/pkg/apis/camel/v1/trait_error_handler.go b/pkg/apis/camel/v1/trait/error_handler.go
similarity index 98%
rename from pkg/apis/camel/v1/trait_error_handler.go
rename to pkg/apis/camel/v1/trait/error_handler.go
index 1638a1b9f..f8d393323 100644
--- a/pkg/apis/camel/v1/trait_error_handler.go
+++ b/pkg/apis/camel/v1/trait/error_handler.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The error-handler is a platform trait used to inject Error Handler source into the integration runtime.
//
diff --git a/pkg/apis/camel/v1/trait_gc.go b/pkg/apis/camel/v1/trait/gc.go
similarity index 98%
rename from pkg/apis/camel/v1/trait_gc.go
rename to pkg/apis/camel/v1/trait/gc.go
index c371952fe..89d277a94 100644
--- a/pkg/apis/camel/v1/trait_gc.go
+++ b/pkg/apis/camel/v1/trait/gc.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The GC Trait garbage-collects all resources that are no longer necessary upon integration updates.
//
diff --git a/pkg/apis/camel/v1/trait_health.go b/pkg/apis/camel/v1/trait/health.go
similarity index 99%
rename from pkg/apis/camel/v1/trait_health.go
rename to pkg/apis/camel/v1/trait/health.go
index be7ae169d..8d4ddf02b 100644
--- a/pkg/apis/camel/v1/trait_health.go
+++ b/pkg/apis/camel/v1/trait/health.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The health trait is responsible for configuring the health probes on the integration container.
//
diff --git a/pkg/apis/camel/v1/trait_ingress.go b/pkg/apis/camel/v1/trait/ingress.go
similarity index 98%
rename from pkg/apis/camel/v1/trait_ingress.go
rename to pkg/apis/camel/v1/trait/ingress.go
index db841d929..1fef97707 100644
--- a/pkg/apis/camel/v1/trait_ingress.go
+++ b/pkg/apis/camel/v1/trait/ingress.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The Ingress trait can be used to expose the service associated with the integration
// to the outside world with a Kubernetes Ingress.
diff --git a/pkg/apis/camel/v1/trait_istio.go b/pkg/apis/camel/v1/trait/istio.go
similarity index 99%
rename from pkg/apis/camel/v1/trait_istio.go
rename to pkg/apis/camel/v1/trait/istio.go
index 6c19af1f8..b7dbba574 100644
--- a/pkg/apis/camel/v1/trait_istio.go
+++ b/pkg/apis/camel/v1/trait/istio.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The Istio trait allows configuring properties related to the Istio service mesh,
// such as sidecar injection and outbound IP ranges.
diff --git a/pkg/apis/camel/v1/trait_jolokia.go b/pkg/apis/camel/v1/trait/jolokia.go
similarity index 99%
rename from pkg/apis/camel/v1/trait_jolokia.go
rename to pkg/apis/camel/v1/trait/jolokia.go
index 62f0b4b29..af8188825 100644
--- a/pkg/apis/camel/v1/trait_jolokia.go
+++ b/pkg/apis/camel/v1/trait/jolokia.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The Jolokia trait activates and configures the Jolokia Java agent.
//
diff --git a/pkg/apis/camel/v1/trait_jvm.go b/pkg/apis/camel/v1/trait/jvm.go
similarity index 99%
rename from pkg/apis/camel/v1/trait_jvm.go
rename to pkg/apis/camel/v1/trait/jvm.go
index 16d304033..70bb3b7de 100644
--- a/pkg/apis/camel/v1/trait_jvm.go
+++ b/pkg/apis/camel/v1/trait/jvm.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The JVM trait is used to configure the JVM that runs the integration.
//
diff --git a/pkg/apis/camel/v1/trait_kamelets.go b/pkg/apis/camel/v1/trait/kamelets.go
similarity index 98%
rename from pkg/apis/camel/v1/trait_kamelets.go
rename to pkg/apis/camel/v1/trait/kamelets.go
index 80d8e0b5e..9467b4883 100644
--- a/pkg/apis/camel/v1/trait_kamelets.go
+++ b/pkg/apis/camel/v1/trait/kamelets.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The kamelets trait is a platform trait used to inject Kamelets into the integration runtime.
//
diff --git a/pkg/apis/camel/v1/trait_knative.go b/pkg/apis/camel/v1/trait/knative.go
similarity index 99%
rename from pkg/apis/camel/v1/trait_knative.go
rename to pkg/apis/camel/v1/trait/knative.go
index 00ac879e0..13590557a 100644
--- a/pkg/apis/camel/v1/trait_knative.go
+++ b/pkg/apis/camel/v1/trait/knative.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The Knative trait automatically discovers addresses of Knative resources and inject them into the
// running integration.
diff --git a/pkg/apis/camel/v1/trait_knative_service.go b/pkg/apis/camel/v1/trait/knative_service.go
similarity index 99%
rename from pkg/apis/camel/v1/trait_knative_service.go
rename to pkg/apis/camel/v1/trait/knative_service.go
index 1bf07343d..3c1e83d56 100644
--- a/pkg/apis/camel/v1/trait_knative_service.go
+++ b/pkg/apis/camel/v1/trait/knative_service.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The Knative Service trait allows configuring options when running the Integration as a Knative service, instead of
// a standard Kubernetes Deployment.
diff --git a/pkg/apis/camel/v1/trait_logging.go b/pkg/apis/camel/v1/trait/logging.go
similarity index 99%
rename from pkg/apis/camel/v1/trait_logging.go
rename to pkg/apis/camel/v1/trait/logging.go
index 1f8946e27..ea0c466c3 100644
--- a/pkg/apis/camel/v1/trait_logging.go
+++ b/pkg/apis/camel/v1/trait/logging.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The Logging trait is used to configure Integration runtime logging options (such as color and format).
// The logging backend is provided by Quarkus, whose configuration is documented at https://quarkus.io/guides/logging.
diff --git a/pkg/apis/camel/v1/trait_mount.go b/pkg/apis/camel/v1/trait/mount.go
similarity index 99%
rename from pkg/apis/camel/v1/trait_mount.go
rename to pkg/apis/camel/v1/trait/mount.go
index 1a498e406..284debb8a 100644
--- a/pkg/apis/camel/v1/trait_mount.go
+++ b/pkg/apis/camel/v1/trait/mount.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The Mount trait can be used to configure volumes mounted on the Integration Pods.
//
diff --git a/pkg/apis/camel/v1/trait_openapi.go b/pkg/apis/camel/v1/trait/openapi.go
similarity index 98%
rename from pkg/apis/camel/v1/trait_openapi.go
rename to pkg/apis/camel/v1/trait/openapi.go
index e9bbf1fa7..8c5b5ded1 100644
--- a/pkg/apis/camel/v1/trait_openapi.go
+++ b/pkg/apis/camel/v1/trait/openapi.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The OpenAPI DSL trait is internally used to allow creating integrations from a OpenAPI specs.
//
diff --git a/pkg/apis/camel/v1/trait_owner.go b/pkg/apis/camel/v1/trait/owner.go
similarity index 98%
rename from pkg/apis/camel/v1/trait_owner.go
rename to pkg/apis/camel/v1/trait/owner.go
index 7791aec31..9d863fcbe 100644
--- a/pkg/apis/camel/v1/trait_owner.go
+++ b/pkg/apis/camel/v1/trait/owner.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The Owner trait ensures that all created resources belong to the integration being created
// and transfers annotations and labels on the integration onto these owned resources.
diff --git a/pkg/apis/camel/v1/trait_pdb.go b/pkg/apis/camel/v1/trait/pdb.go
similarity index 99%
rename from pkg/apis/camel/v1/trait_pdb.go
rename to pkg/apis/camel/v1/trait/pdb.go
index d99bd23b0..4c230683a 100644
--- a/pkg/apis/camel/v1/trait_pdb.go
+++ b/pkg/apis/camel/v1/trait/pdb.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The PDB trait allows to configure the PodDisruptionBudget resource for the Integration pods.
//
diff --git a/pkg/apis/camel/v1/trait_platform.go b/pkg/apis/camel/v1/trait/platform.go
similarity index 99%
rename from pkg/apis/camel/v1/trait_platform.go
rename to pkg/apis/camel/v1/trait/platform.go
index b16199478..a74a23f5c 100644
--- a/pkg/apis/camel/v1/trait_platform.go
+++ b/pkg/apis/camel/v1/trait/platform.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The platform trait is a base trait that is used to assign an integration platform to an integration.
//
diff --git a/pkg/apis/camel/v1/trait_pod.go b/pkg/apis/camel/v1/trait/pod.go
similarity index 98%
rename from pkg/apis/camel/v1/trait_pod.go
rename to pkg/apis/camel/v1/trait/pod.go
index fe41bc552..f6d26bc67 100644
--- a/pkg/apis/camel/v1/trait_pod.go
+++ b/pkg/apis/camel/v1/trait/pod.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The pod trait allows the customization of the Integration pods.
// It applies the `PodSpecTemplate` struct contained in the Integration `.spec.podTemplate` field,
diff --git a/pkg/apis/camel/v1/trait_prometheus.go b/pkg/apis/camel/v1/trait/prometheus.go
similarity index 99%
rename from pkg/apis/camel/v1/trait_prometheus.go
rename to pkg/apis/camel/v1/trait/prometheus.go
index 75054c5d1..416cfa7f9 100644
--- a/pkg/apis/camel/v1/trait_prometheus.go
+++ b/pkg/apis/camel/v1/trait/prometheus.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The Prometheus trait configures a Prometheus-compatible endpoint. It also creates a `PodMonitor` resource,
// so that the endpoint can be scraped automatically, when using the Prometheus operator.
diff --git a/pkg/apis/camel/v1/trait_pull_secret.go b/pkg/apis/camel/v1/trait/pull_secret.go
similarity index 99%
rename from pkg/apis/camel/v1/trait_pull_secret.go
rename to pkg/apis/camel/v1/trait/pull_secret.go
index e80d8adf7..ba7844441 100644
--- a/pkg/apis/camel/v1/trait_pull_secret.go
+++ b/pkg/apis/camel/v1/trait/pull_secret.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The Pull Secret trait sets a pull secret on the pod,
// to allow Kubernetes to retrieve the container image from an external registry.
diff --git a/pkg/apis/camel/v1/trait_quarkus.go b/pkg/apis/camel/v1/trait/quarkus.go
similarity index 99%
rename from pkg/apis/camel/v1/trait_quarkus.go
rename to pkg/apis/camel/v1/trait/quarkus.go
index 6e2560278..8432e68f9 100644
--- a/pkg/apis/camel/v1/trait_quarkus.go
+++ b/pkg/apis/camel/v1/trait/quarkus.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The Quarkus trait configures the Quarkus runtime.
//
diff --git a/pkg/apis/camel/v1/trait_registry.go b/pkg/apis/camel/v1/trait/registry.go
similarity index 98%
rename from pkg/apis/camel/v1/trait_registry.go
rename to pkg/apis/camel/v1/trait/registry.go
index 939cf01c7..2f9db1b0c 100644
--- a/pkg/apis/camel/v1/trait_registry.go
+++ b/pkg/apis/camel/v1/trait/registry.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The Registry trait sets up Maven to use the Image registry
// as a Maven repository.
diff --git a/pkg/apis/camel/v1/trait_route.go b/pkg/apis/camel/v1/trait/route.go
similarity index 99%
rename from pkg/apis/camel/v1/trait_route.go
rename to pkg/apis/camel/v1/trait/route.go
index 4276a39c3..a25ac8171 100644
--- a/pkg/apis/camel/v1/trait_route.go
+++ b/pkg/apis/camel/v1/trait/route.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The Route trait can be used to configure the creation of OpenShift routes for the integration.
//
diff --git a/pkg/apis/camel/v1/trait_service.go b/pkg/apis/camel/v1/trait/service.go
similarity index 99%
rename from pkg/apis/camel/v1/trait_service.go
rename to pkg/apis/camel/v1/trait/service.go
index 19e9951e1..83feadd2c 100644
--- a/pkg/apis/camel/v1/trait_service.go
+++ b/pkg/apis/camel/v1/trait/service.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The Service trait exposes the integration with a Service resource so that it can be accessed by other applications
// (or integrations) in the same namespace.
diff --git a/pkg/apis/camel/v1/trait_service_binding.go b/pkg/apis/camel/v1/trait/service_binding.go
similarity index 98%
rename from pkg/apis/camel/v1/trait_service_binding.go
rename to pkg/apis/camel/v1/trait/service_binding.go
index 55d533735..97e758fe4 100644
--- a/pkg/apis/camel/v1/trait_service_binding.go
+++ b/pkg/apis/camel/v1/trait/service_binding.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// The Service Binding trait allows users to connect to Services in Kubernetes:
// https://github.com/k8s-service-bindings/spec#service-binding
diff --git a/pkg/apis/camel/v1/trait_toleration.go b/pkg/apis/camel/v1/trait/toleration.go
similarity index 99%
rename from pkg/apis/camel/v1/trait_toleration.go
rename to pkg/apis/camel/v1/trait/toleration.go
index 839ee2755..bbc1d2e54 100644
--- a/pkg/apis/camel/v1/trait_toleration.go
+++ b/pkg/apis/camel/v1/trait/toleration.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1
+package trait
// This trait sets Tolerations over Integration pods. Tolerations allow (but do not require) the pods to schedule onto nodes with matching taints.
// See https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ for more details.
diff --git a/pkg/apis/camel/v1/trait/zz_generated.deepcopy.go b/pkg/apis/camel/v1/trait/zz_generated.deepcopy.go
new file mode 100644
index 000000000..f5d4d636b
--- /dev/null
+++ b/pkg/apis/camel/v1/trait/zz_generated.deepcopy.go
@@ -0,0 +1,941 @@
+// +build !ignore_autogenerated
+
+// Code generated by controller-gen. DO NOT EDIT.
+
+package trait
+
+import ()
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AffinityTrait) DeepCopyInto(out *AffinityTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.PodAffinity != nil {
+ in, out := &in.PodAffinity, &out.PodAffinity
+ *out = new(bool)
+ **out = **in
+ }
+ if in.PodAntiAffinity != nil {
+ in, out := &in.PodAntiAffinity, &out.PodAntiAffinity
+ *out = new(bool)
+ **out = **in
+ }
+ if in.NodeAffinityLabels != nil {
+ in, out := &in.NodeAffinityLabels, &out.NodeAffinityLabels
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.PodAffinityLabels != nil {
+ in, out := &in.PodAffinityLabels, &out.PodAffinityLabels
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.PodAntiAffinityLabels != nil {
+ in, out := &in.PodAntiAffinityLabels, &out.PodAntiAffinityLabels
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AffinityTrait.
+func (in *AffinityTrait) DeepCopy() *AffinityTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(AffinityTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *BuilderTrait) DeepCopyInto(out *BuilderTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Verbose != nil {
+ in, out := &in.Verbose, &out.Verbose
+ *out = new(bool)
+ **out = **in
+ }
+ if in.Properties != nil {
+ in, out := &in.Properties, &out.Properties
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BuilderTrait.
+func (in *BuilderTrait) DeepCopy() *BuilderTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(BuilderTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *CamelTrait) DeepCopyInto(out *CamelTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Properties != nil {
+ in, out := &in.Properties, &out.Properties
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CamelTrait.
+func (in *CamelTrait) DeepCopy() *CamelTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(CamelTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ContainerTrait) DeepCopyInto(out *ContainerTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Auto != nil {
+ in, out := &in.Auto, &out.Auto
+ *out = new(bool)
+ **out = **in
+ }
+ if in.Expose != nil {
+ in, out := &in.Expose, &out.Expose
+ *out = new(bool)
+ **out = **in
+ }
+ if in.DeprecatedProbesEnabled != nil {
+ in, out := &in.DeprecatedProbesEnabled, &out.DeprecatedProbesEnabled
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerTrait.
+func (in *ContainerTrait) DeepCopy() *ContainerTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(ContainerTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *CronTrait) DeepCopyInto(out *CronTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Fallback != nil {
+ in, out := &in.Fallback, &out.Fallback
+ *out = new(bool)
+ **out = **in
+ }
+ if in.Auto != nil {
+ in, out := &in.Auto, &out.Auto
+ *out = new(bool)
+ **out = **in
+ }
+ if in.StartingDeadlineSeconds != nil {
+ in, out := &in.StartingDeadlineSeconds, &out.StartingDeadlineSeconds
+ *out = new(int64)
+ **out = **in
+ }
+ if in.ActiveDeadlineSeconds != nil {
+ in, out := &in.ActiveDeadlineSeconds, &out.ActiveDeadlineSeconds
+ *out = new(int64)
+ **out = **in
+ }
+ if in.BackoffLimit != nil {
+ in, out := &in.BackoffLimit, &out.BackoffLimit
+ *out = new(int32)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CronTrait.
+func (in *CronTrait) DeepCopy() *CronTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(CronTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *DependenciesTrait) DeepCopyInto(out *DependenciesTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DependenciesTrait.
+func (in *DependenciesTrait) DeepCopy() *DependenciesTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(DependenciesTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *DeployerTrait) DeepCopyInto(out *DeployerTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeployerTrait.
+func (in *DeployerTrait) DeepCopy() *DeployerTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(DeployerTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *DeploymentTrait) DeepCopyInto(out *DeploymentTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.ProgressDeadlineSeconds != nil {
+ in, out := &in.ProgressDeadlineSeconds, &out.ProgressDeadlineSeconds
+ *out = new(int32)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentTrait.
+func (in *DeploymentTrait) DeepCopy() *DeploymentTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(DeploymentTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *EnvironmentTrait) DeepCopyInto(out *EnvironmentTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.ContainerMeta != nil {
+ in, out := &in.ContainerMeta, &out.ContainerMeta
+ *out = new(bool)
+ **out = **in
+ }
+ if in.HTTPProxy != nil {
+ in, out := &in.HTTPProxy, &out.HTTPProxy
+ *out = new(bool)
+ **out = **in
+ }
+ if in.Vars != nil {
+ in, out := &in.Vars, &out.Vars
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentTrait.
+func (in *EnvironmentTrait) DeepCopy() *EnvironmentTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(EnvironmentTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ErrorHandlerTrait) DeepCopyInto(out *ErrorHandlerTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorHandlerTrait.
+func (in *ErrorHandlerTrait) DeepCopy() *ErrorHandlerTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(ErrorHandlerTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *GCTrait) DeepCopyInto(out *GCTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.DiscoveryCache != nil {
+ in, out := &in.DiscoveryCache, &out.DiscoveryCache
+ *out = new(DiscoveryCacheType)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCTrait.
+func (in *GCTrait) DeepCopy() *GCTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(GCTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *HealthTrait) DeepCopyInto(out *HealthTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.LivenessProbeEnabled != nil {
+ in, out := &in.LivenessProbeEnabled, &out.LivenessProbeEnabled
+ *out = new(bool)
+ **out = **in
+ }
+ if in.ReadinessProbeEnabled != nil {
+ in, out := &in.ReadinessProbeEnabled, &out.ReadinessProbeEnabled
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthTrait.
+func (in *HealthTrait) DeepCopy() *HealthTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(HealthTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *IngressTrait) DeepCopyInto(out *IngressTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Auto != nil {
+ in, out := &in.Auto, &out.Auto
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressTrait.
+func (in *IngressTrait) DeepCopy() *IngressTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(IngressTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *IstioTrait) DeepCopyInto(out *IstioTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Inject != nil {
+ in, out := &in.Inject, &out.Inject
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IstioTrait.
+func (in *IstioTrait) DeepCopy() *IstioTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(IstioTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *JVMTrait) DeepCopyInto(out *JVMTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Debug != nil {
+ in, out := &in.Debug, &out.Debug
+ *out = new(bool)
+ **out = **in
+ }
+ if in.DebugSuspend != nil {
+ in, out := &in.DebugSuspend, &out.DebugSuspend
+ *out = new(bool)
+ **out = **in
+ }
+ if in.PrintCommand != nil {
+ in, out := &in.PrintCommand, &out.PrintCommand
+ *out = new(bool)
+ **out = **in
+ }
+ if in.Options != nil {
+ in, out := &in.Options, &out.Options
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JVMTrait.
+func (in *JVMTrait) DeepCopy() *JVMTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(JVMTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *JolokiaTrait) DeepCopyInto(out *JolokiaTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.CaCert != nil {
+ in, out := &in.CaCert, &out.CaCert
+ *out = new(string)
+ **out = **in
+ }
+ if in.ClientPrincipal != nil {
+ in, out := &in.ClientPrincipal, &out.ClientPrincipal
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.DiscoveryEnabled != nil {
+ in, out := &in.DiscoveryEnabled, &out.DiscoveryEnabled
+ *out = new(bool)
+ **out = **in
+ }
+ if in.ExtendedClientCheck != nil {
+ in, out := &in.ExtendedClientCheck, &out.ExtendedClientCheck
+ *out = new(bool)
+ **out = **in
+ }
+ if in.Host != nil {
+ in, out := &in.Host, &out.Host
+ *out = new(string)
+ **out = **in
+ }
+ if in.Password != nil {
+ in, out := &in.Password, &out.Password
+ *out = new(string)
+ **out = **in
+ }
+ if in.Protocol != nil {
+ in, out := &in.Protocol, &out.Protocol
+ *out = new(string)
+ **out = **in
+ }
+ if in.User != nil {
+ in, out := &in.User, &out.User
+ *out = new(string)
+ **out = **in
+ }
+ if in.UseSslClientAuthentication != nil {
+ in, out := &in.UseSslClientAuthentication, &out.UseSslClientAuthentication
+ *out = new(bool)
+ **out = **in
+ }
+ if in.Options != nil {
+ in, out := &in.Options, &out.Options
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JolokiaTrait.
+func (in *JolokiaTrait) DeepCopy() *JolokiaTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(JolokiaTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *KameletsTrait) DeepCopyInto(out *KameletsTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Auto != nil {
+ in, out := &in.Auto, &out.Auto
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KameletsTrait.
+func (in *KameletsTrait) DeepCopy() *KameletsTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(KameletsTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *KnativeServiceTrait) DeepCopyInto(out *KnativeServiceTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Target != nil {
+ in, out := &in.Target, &out.Target
+ *out = new(int)
+ **out = **in
+ }
+ if in.MinScale != nil {
+ in, out := &in.MinScale, &out.MinScale
+ *out = new(int)
+ **out = **in
+ }
+ if in.MaxScale != nil {
+ in, out := &in.MaxScale, &out.MaxScale
+ *out = new(int)
+ **out = **in
+ }
+ if in.Auto != nil {
+ in, out := &in.Auto, &out.Auto
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KnativeServiceTrait.
+func (in *KnativeServiceTrait) DeepCopy() *KnativeServiceTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(KnativeServiceTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *KnativeTrait) DeepCopyInto(out *KnativeTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.ChannelSources != nil {
+ in, out := &in.ChannelSources, &out.ChannelSources
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.ChannelSinks != nil {
+ in, out := &in.ChannelSinks, &out.ChannelSinks
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.EndpointSources != nil {
+ in, out := &in.EndpointSources, &out.EndpointSources
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.EndpointSinks != nil {
+ in, out := &in.EndpointSinks, &out.EndpointSinks
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.EventSources != nil {
+ in, out := &in.EventSources, &out.EventSources
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.EventSinks != nil {
+ in, out := &in.EventSinks, &out.EventSinks
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.FilterSourceChannels != nil {
+ in, out := &in.FilterSourceChannels, &out.FilterSourceChannels
+ *out = new(bool)
+ **out = **in
+ }
+ if in.SinkBinding != nil {
+ in, out := &in.SinkBinding, &out.SinkBinding
+ *out = new(bool)
+ **out = **in
+ }
+ if in.Auto != nil {
+ in, out := &in.Auto, &out.Auto
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KnativeTrait.
+func (in *KnativeTrait) DeepCopy() *KnativeTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(KnativeTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *LoggingTrait) DeepCopyInto(out *LoggingTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Color != nil {
+ in, out := &in.Color, &out.Color
+ *out = new(bool)
+ **out = **in
+ }
+ if in.JSON != nil {
+ in, out := &in.JSON, &out.JSON
+ *out = new(bool)
+ **out = **in
+ }
+ if in.JSONPrettyPrint != nil {
+ in, out := &in.JSONPrettyPrint, &out.JSONPrettyPrint
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoggingTrait.
+func (in *LoggingTrait) DeepCopy() *LoggingTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(LoggingTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MountTrait) DeepCopyInto(out *MountTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Configs != nil {
+ in, out := &in.Configs, &out.Configs
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.Resources != nil {
+ in, out := &in.Resources, &out.Resources
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.Volumes != nil {
+ in, out := &in.Volumes, &out.Volumes
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MountTrait.
+func (in *MountTrait) DeepCopy() *MountTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(MountTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *OpenAPITrait) DeepCopyInto(out *OpenAPITrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Configmaps != nil {
+ in, out := &in.Configmaps, &out.Configmaps
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenAPITrait.
+func (in *OpenAPITrait) DeepCopy() *OpenAPITrait {
+ if in == nil {
+ return nil
+ }
+ out := new(OpenAPITrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *OwnerTrait) DeepCopyInto(out *OwnerTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.TargetAnnotations != nil {
+ in, out := &in.TargetAnnotations, &out.TargetAnnotations
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.TargetLabels != nil {
+ in, out := &in.TargetLabels, &out.TargetLabels
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OwnerTrait.
+func (in *OwnerTrait) DeepCopy() *OwnerTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(OwnerTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PDBTrait) DeepCopyInto(out *PDBTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDBTrait.
+func (in *PDBTrait) DeepCopy() *PDBTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(PDBTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PlatformTrait) DeepCopyInto(out *PlatformTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.CreateDefault != nil {
+ in, out := &in.CreateDefault, &out.CreateDefault
+ *out = new(bool)
+ **out = **in
+ }
+ if in.Global != nil {
+ in, out := &in.Global, &out.Global
+ *out = new(bool)
+ **out = **in
+ }
+ if in.Auto != nil {
+ in, out := &in.Auto, &out.Auto
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlatformTrait.
+func (in *PlatformTrait) DeepCopy() *PlatformTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(PlatformTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PodTrait) DeepCopyInto(out *PodTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodTrait.
+func (in *PodTrait) DeepCopy() *PodTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(PodTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PrometheusTrait) DeepCopyInto(out *PrometheusTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.PodMonitor != nil {
+ in, out := &in.PodMonitor, &out.PodMonitor
+ *out = new(bool)
+ **out = **in
+ }
+ if in.PodMonitorLabels != nil {
+ in, out := &in.PodMonitorLabels, &out.PodMonitorLabels
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusTrait.
+func (in *PrometheusTrait) DeepCopy() *PrometheusTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(PrometheusTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PullSecretTrait) DeepCopyInto(out *PullSecretTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.ImagePullerDelegation != nil {
+ in, out := &in.ImagePullerDelegation, &out.ImagePullerDelegation
+ *out = new(bool)
+ **out = **in
+ }
+ if in.Auto != nil {
+ in, out := &in.Auto, &out.Auto
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PullSecretTrait.
+func (in *PullSecretTrait) DeepCopy() *PullSecretTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(PullSecretTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *QuarkusTrait) DeepCopyInto(out *QuarkusTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.PackageTypes != nil {
+ in, out := &in.PackageTypes, &out.PackageTypes
+ *out = make([]QuarkusPackageType, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QuarkusTrait.
+func (in *QuarkusTrait) DeepCopy() *QuarkusTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(QuarkusTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *RegistryTrait) DeepCopyInto(out *RegistryTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistryTrait.
+func (in *RegistryTrait) DeepCopy() *RegistryTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(RegistryTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *RouteTrait) DeepCopyInto(out *RouteTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteTrait.
+func (in *RouteTrait) DeepCopy() *RouteTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(RouteTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ServiceBindingTrait) DeepCopyInto(out *ServiceBindingTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Services != nil {
+ in, out := &in.Services, &out.Services
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceBindingTrait.
+func (in *ServiceBindingTrait) DeepCopy() *ServiceBindingTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(ServiceBindingTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ServiceTrait) DeepCopyInto(out *ServiceTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Auto != nil {
+ in, out := &in.Auto, &out.Auto
+ *out = new(bool)
+ **out = **in
+ }
+ if in.NodePort != nil {
+ in, out := &in.NodePort, &out.NodePort
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceTrait.
+func (in *ServiceTrait) DeepCopy() *ServiceTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(ServiceTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *TolerationTrait) DeepCopyInto(out *TolerationTrait) {
+ *out = *in
+ in.Trait.DeepCopyInto(&out.Trait)
+ if in.Taints != nil {
+ in, out := &in.Taints, &out.Taints
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TolerationTrait.
+func (in *TolerationTrait) DeepCopy() *TolerationTrait {
+ if in == nil {
+ return nil
+ }
+ out := new(TolerationTrait)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Trait) DeepCopyInto(out *Trait) {
+ *out = *in
+ if in.Enabled != nil {
+ in, out := &in.Enabled, &out.Enabled
+ *out = new(bool)
+ **out = **in
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Trait.
+func (in *Trait) DeepCopy() *Trait {
+ if in == nil {
+ return nil
+ }
+ out := new(Trait)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/pkg/apis/camel/v1/zz_generated.deepcopy.go b/pkg/apis/camel/v1/zz_generated.deepcopy.go
index 683a3c02b..c039f8e06 100644
--- a/pkg/apis/camel/v1/zz_generated.deepcopy.go
+++ b/pkg/apis/camel/v1/zz_generated.deepcopy.go
@@ -6,52 +6,12 @@
package v1
import (
+ "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *AffinityTrait) DeepCopyInto(out *AffinityTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.PodAffinity != nil {
- in, out := &in.PodAffinity, &out.PodAffinity
- *out = new(bool)
- **out = **in
- }
- if in.PodAntiAffinity != nil {
- in, out := &in.PodAntiAffinity, &out.PodAntiAffinity
- *out = new(bool)
- **out = **in
- }
- if in.NodeAffinityLabels != nil {
- in, out := &in.NodeAffinityLabels, &out.NodeAffinityLabels
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
- if in.PodAffinityLabels != nil {
- in, out := &in.PodAffinityLabels, &out.PodAffinityLabels
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
- if in.PodAntiAffinityLabels != nil {
- in, out := &in.PodAntiAffinityLabels, &out.PodAntiAffinityLabels
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AffinityTrait.
-func (in *AffinityTrait) DeepCopy() *AffinityTrait {
- if in == nil {
- return nil
- }
- out := new(AffinityTrait)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Artifact) DeepCopyInto(out *Artifact) {
*out = *in
@@ -281,32 +241,6 @@ func (in *BuilderTask) DeepCopy() *BuilderTask {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *BuilderTrait) DeepCopyInto(out *BuilderTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.Verbose != nil {
- in, out := &in.Verbose, &out.Verbose
- *out = new(bool)
- **out = **in
- }
- if in.Properties != nil {
- in, out := &in.Properties, &out.Properties
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BuilderTrait.
-func (in *BuilderTrait) DeepCopy() *BuilderTrait {
- if in == nil {
- return nil
- }
- out := new(BuilderTrait)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CamelArtifact) DeepCopyInto(out *CamelArtifact) {
*out = *in
@@ -564,27 +498,6 @@ func (in *CamelSchemeScope) DeepCopy() *CamelSchemeScope {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *CamelTrait) DeepCopyInto(out *CamelTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.Properties != nil {
- in, out := &in.Properties, &out.Properties
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CamelTrait.
-func (in *CamelTrait) DeepCopy() *CamelTrait {
- if in == nil {
- return nil
- }
- out := new(CamelTrait)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Capability) DeepCopyInto(out *Capability) {
*out = *in
@@ -627,78 +540,6 @@ func (in *ConfigurationSpec) DeepCopy() *ConfigurationSpec {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ContainerTrait) DeepCopyInto(out *ContainerTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.Auto != nil {
- in, out := &in.Auto, &out.Auto
- *out = new(bool)
- **out = **in
- }
- if in.Expose != nil {
- in, out := &in.Expose, &out.Expose
- *out = new(bool)
- **out = **in
- }
- if in.DeprecatedProbesEnabled != nil {
- in, out := &in.DeprecatedProbesEnabled, &out.DeprecatedProbesEnabled
- *out = new(bool)
- **out = **in
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerTrait.
-func (in *ContainerTrait) DeepCopy() *ContainerTrait {
- if in == nil {
- return nil
- }
- out := new(ContainerTrait)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *CronTrait) DeepCopyInto(out *CronTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.Fallback != nil {
- in, out := &in.Fallback, &out.Fallback
- *out = new(bool)
- **out = **in
- }
- if in.Auto != nil {
- in, out := &in.Auto, &out.Auto
- *out = new(bool)
- **out = **in
- }
- if in.StartingDeadlineSeconds != nil {
- in, out := &in.StartingDeadlineSeconds, &out.StartingDeadlineSeconds
- *out = new(int64)
- **out = **in
- }
- if in.ActiveDeadlineSeconds != nil {
- in, out := &in.ActiveDeadlineSeconds, &out.ActiveDeadlineSeconds
- *out = new(int64)
- **out = **in
- }
- if in.BackoffLimit != nil {
- in, out := &in.BackoffLimit, &out.BackoffLimit
- *out = new(int32)
- **out = **in
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CronTrait.
-func (in *CronTrait) DeepCopy() *CronTrait {
- if in == nil {
- return nil
- }
- out := new(CronTrait)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DataSpec) DeepCopyInto(out *DataSpec) {
*out = *in
@@ -719,106 +560,6 @@ func (in *DataSpec) DeepCopy() *DataSpec {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *DependenciesTrait) DeepCopyInto(out *DependenciesTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DependenciesTrait.
-func (in *DependenciesTrait) DeepCopy() *DependenciesTrait {
- if in == nil {
- return nil
- }
- out := new(DependenciesTrait)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *DeployerTrait) DeepCopyInto(out *DeployerTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeployerTrait.
-func (in *DeployerTrait) DeepCopy() *DeployerTrait {
- if in == nil {
- return nil
- }
- out := new(DeployerTrait)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *DeploymentTrait) DeepCopyInto(out *DeploymentTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.ProgressDeadlineSeconds != nil {
- in, out := &in.ProgressDeadlineSeconds, &out.ProgressDeadlineSeconds
- *out = new(int32)
- **out = **in
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentTrait.
-func (in *DeploymentTrait) DeepCopy() *DeploymentTrait {
- if in == nil {
- return nil
- }
- out := new(DeploymentTrait)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *EnvironmentTrait) DeepCopyInto(out *EnvironmentTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.ContainerMeta != nil {
- in, out := &in.ContainerMeta, &out.ContainerMeta
- *out = new(bool)
- **out = **in
- }
- if in.HTTPProxy != nil {
- in, out := &in.HTTPProxy, &out.HTTPProxy
- *out = new(bool)
- **out = **in
- }
- if in.Vars != nil {
- in, out := &in.Vars, &out.Vars
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentTrait.
-func (in *EnvironmentTrait) DeepCopy() *EnvironmentTrait {
- if in == nil {
- return nil
- }
- out := new(EnvironmentTrait)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ErrorHandlerTrait) DeepCopyInto(out *ErrorHandlerTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorHandlerTrait.
-func (in *ErrorHandlerTrait) DeepCopy() *ErrorHandlerTrait {
- if in == nil {
- return nil
- }
- out := new(ErrorHandlerTrait)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Failure) DeepCopyInto(out *Failure) {
*out = *in
@@ -872,74 +613,6 @@ func (in *Flow) DeepCopy() *Flow {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *GCTrait) DeepCopyInto(out *GCTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.DiscoveryCache != nil {
- in, out := &in.DiscoveryCache, &out.DiscoveryCache
- *out = new(DiscoveryCacheType)
- **out = **in
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCTrait.
-func (in *GCTrait) DeepCopy() *GCTrait {
- if in == nil {
- return nil
- }
- out := new(GCTrait)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *HealthTrait) DeepCopyInto(out *HealthTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.LivenessProbeEnabled != nil {
- in, out := &in.LivenessProbeEnabled, &out.LivenessProbeEnabled
- *out = new(bool)
- **out = **in
- }
- if in.ReadinessProbeEnabled != nil {
- in, out := &in.ReadinessProbeEnabled, &out.ReadinessProbeEnabled
- *out = new(bool)
- **out = **in
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthTrait.
-func (in *HealthTrait) DeepCopy() *HealthTrait {
- if in == nil {
- return nil
- }
- out := new(HealthTrait)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *IngressTrait) DeepCopyInto(out *IngressTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.Auto != nil {
- in, out := &in.Auto, &out.Auto
- *out = new(bool)
- **out = **in
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressTrait.
-func (in *IngressTrait) DeepCopy() *IngressTrait {
- if in == nil {
- return nil
- }
- out := new(IngressTrait)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Integration) DeepCopyInto(out *Integration) {
*out = *in
@@ -1132,12 +805,12 @@ func (in *IntegrationKitTraits) DeepCopyInto(out *IntegrationKitTraits) {
*out = *in
if in.Builder != nil {
in, out := &in.Builder, &out.Builder
- *out = new(BuilderTrait)
+ *out = new(trait.BuilderTrait)
(*in).DeepCopyInto(*out)
}
if in.Quarkus != nil {
in, out := &in.Quarkus, &out.Quarkus
- *out = new(QuarkusTrait)
+ *out = new(trait.QuarkusTrait)
(*in).DeepCopyInto(*out)
}
}
@@ -1531,329 +1204,57 @@ func (in *IntegrationStatus) DeepCopy() *IntegrationStatus {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *IstioTrait) DeepCopyInto(out *IstioTrait) {
+func (in *KanikoTask) DeepCopyInto(out *KanikoTask) {
*out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.Inject != nil {
- in, out := &in.Inject, &out.Inject
+ out.BaseTask = in.BaseTask
+ out.PublishTask = in.PublishTask
+ if in.Verbose != nil {
+ in, out := &in.Verbose, &out.Verbose
*out = new(bool)
**out = **in
}
+ in.Cache.DeepCopyInto(&out.Cache)
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IstioTrait.
-func (in *IstioTrait) DeepCopy() *IstioTrait {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KanikoTask.
+func (in *KanikoTask) DeepCopy() *KanikoTask {
if in == nil {
return nil
}
- out := new(IstioTrait)
+ out := new(KanikoTask)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *JVMTrait) DeepCopyInto(out *JVMTrait) {
+func (in *KanikoTaskCache) DeepCopyInto(out *KanikoTaskCache) {
*out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.Debug != nil {
- in, out := &in.Debug, &out.Debug
- *out = new(bool)
- **out = **in
- }
- if in.DebugSuspend != nil {
- in, out := &in.DebugSuspend, &out.DebugSuspend
- *out = new(bool)
- **out = **in
- }
- if in.PrintCommand != nil {
- in, out := &in.PrintCommand, &out.PrintCommand
+ if in.Enabled != nil {
+ in, out := &in.Enabled, &out.Enabled
*out = new(bool)
**out = **in
}
- if in.Options != nil {
- in, out := &in.Options, &out.Options
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JVMTrait.
-func (in *JVMTrait) DeepCopy() *JVMTrait {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KanikoTaskCache.
+func (in *KanikoTaskCache) DeepCopy() *KanikoTaskCache {
if in == nil {
return nil
}
- out := new(JVMTrait)
+ out := new(KanikoTaskCache)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *JolokiaTrait) DeepCopyInto(out *JolokiaTrait) {
+func (in *MavenArtifact) DeepCopyInto(out *MavenArtifact) {
*out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.CaCert != nil {
- in, out := &in.CaCert, &out.CaCert
- *out = new(string)
- **out = **in
- }
- if in.ClientPrincipal != nil {
- in, out := &in.ClientPrincipal, &out.ClientPrincipal
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
- if in.DiscoveryEnabled != nil {
- in, out := &in.DiscoveryEnabled, &out.DiscoveryEnabled
- *out = new(bool)
- **out = **in
- }
- if in.ExtendedClientCheck != nil {
- in, out := &in.ExtendedClientCheck, &out.ExtendedClientCheck
- *out = new(bool)
- **out = **in
- }
- if in.Host != nil {
- in, out := &in.Host, &out.Host
- *out = new(string)
- **out = **in
- }
- if in.Password != nil {
- in, out := &in.Password, &out.Password
- *out = new(string)
- **out = **in
- }
- if in.Protocol != nil {
- in, out := &in.Protocol, &out.Protocol
- *out = new(string)
- **out = **in
- }
- if in.User != nil {
- in, out := &in.User, &out.User
- *out = new(string)
- **out = **in
- }
- if in.UseSslClientAuthentication != nil {
- in, out := &in.UseSslClientAuthentication, &out.UseSslClientAuthentication
- *out = new(bool)
- **out = **in
- }
- if in.Options != nil {
- in, out := &in.Options, &out.Options
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JolokiaTrait.
-func (in *JolokiaTrait) DeepCopy() *JolokiaTrait {
- if in == nil {
- return nil
- }
- out := new(JolokiaTrait)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *KameletsTrait) DeepCopyInto(out *KameletsTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.Auto != nil {
- in, out := &in.Auto, &out.Auto
- *out = new(bool)
- **out = **in
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KameletsTrait.
-func (in *KameletsTrait) DeepCopy() *KameletsTrait {
- if in == nil {
- return nil
- }
- out := new(KameletsTrait)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *KanikoTask) DeepCopyInto(out *KanikoTask) {
- *out = *in
- out.BaseTask = in.BaseTask
- out.PublishTask = in.PublishTask
- if in.Verbose != nil {
- in, out := &in.Verbose, &out.Verbose
- *out = new(bool)
- **out = **in
- }
- in.Cache.DeepCopyInto(&out.Cache)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KanikoTask.
-func (in *KanikoTask) DeepCopy() *KanikoTask {
- if in == nil {
- return nil
- }
- out := new(KanikoTask)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *KanikoTaskCache) DeepCopyInto(out *KanikoTaskCache) {
- *out = *in
- if in.Enabled != nil {
- in, out := &in.Enabled, &out.Enabled
- *out = new(bool)
- **out = **in
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KanikoTaskCache.
-func (in *KanikoTaskCache) DeepCopy() *KanikoTaskCache {
- if in == nil {
- return nil
- }
- out := new(KanikoTaskCache)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *KnativeServiceTrait) DeepCopyInto(out *KnativeServiceTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.Target != nil {
- in, out := &in.Target, &out.Target
- *out = new(int)
- **out = **in
- }
- if in.MinScale != nil {
- in, out := &in.MinScale, &out.MinScale
- *out = new(int)
- **out = **in
- }
- if in.MaxScale != nil {
- in, out := &in.MaxScale, &out.MaxScale
- *out = new(int)
- **out = **in
- }
- if in.Auto != nil {
- in, out := &in.Auto, &out.Auto
- *out = new(bool)
- **out = **in
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KnativeServiceTrait.
-func (in *KnativeServiceTrait) DeepCopy() *KnativeServiceTrait {
- if in == nil {
- return nil
- }
- out := new(KnativeServiceTrait)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *KnativeTrait) DeepCopyInto(out *KnativeTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.ChannelSources != nil {
- in, out := &in.ChannelSources, &out.ChannelSources
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
- if in.ChannelSinks != nil {
- in, out := &in.ChannelSinks, &out.ChannelSinks
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
- if in.EndpointSources != nil {
- in, out := &in.EndpointSources, &out.EndpointSources
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
- if in.EndpointSinks != nil {
- in, out := &in.EndpointSinks, &out.EndpointSinks
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
- if in.EventSources != nil {
- in, out := &in.EventSources, &out.EventSources
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
- if in.EventSinks != nil {
- in, out := &in.EventSinks, &out.EventSinks
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
- if in.FilterSourceChannels != nil {
- in, out := &in.FilterSourceChannels, &out.FilterSourceChannels
- *out = new(bool)
- **out = **in
- }
- if in.SinkBinding != nil {
- in, out := &in.SinkBinding, &out.SinkBinding
- *out = new(bool)
- **out = **in
- }
- if in.Auto != nil {
- in, out := &in.Auto, &out.Auto
- *out = new(bool)
- **out = **in
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KnativeTrait.
-func (in *KnativeTrait) DeepCopy() *KnativeTrait {
- if in == nil {
- return nil
- }
- out := new(KnativeTrait)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *LoggingTrait) DeepCopyInto(out *LoggingTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.Color != nil {
- in, out := &in.Color, &out.Color
- *out = new(bool)
- **out = **in
- }
- if in.JSON != nil {
- in, out := &in.JSON, &out.JSON
- *out = new(bool)
- **out = **in
- }
- if in.JSONPrettyPrint != nil {
- in, out := &in.JSONPrettyPrint, &out.JSONPrettyPrint
- *out = new(bool)
- **out = **in
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoggingTrait.
-func (in *LoggingTrait) DeepCopy() *LoggingTrait {
- if in == nil {
- return nil
- }
- out := new(LoggingTrait)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *MavenArtifact) DeepCopyInto(out *MavenArtifact) {
- *out = *in
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MavenArtifact.
-func (in *MavenArtifact) DeepCopy() *MavenArtifact {
- if in == nil {
- return nil
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MavenArtifact.
+func (in *MavenArtifact) DeepCopy() *MavenArtifact {
+ if in == nil {
+ return nil
}
out := new(MavenArtifact)
in.DeepCopyInto(out)
@@ -1934,131 +1335,6 @@ func (in *MavenSpec) DeepCopy() *MavenSpec {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *MountTrait) DeepCopyInto(out *MountTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.Configs != nil {
- in, out := &in.Configs, &out.Configs
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
- if in.Resources != nil {
- in, out := &in.Resources, &out.Resources
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
- if in.Volumes != nil {
- in, out := &in.Volumes, &out.Volumes
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MountTrait.
-func (in *MountTrait) DeepCopy() *MountTrait {
- if in == nil {
- return nil
- }
- out := new(MountTrait)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *OpenAPITrait) DeepCopyInto(out *OpenAPITrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.Configmaps != nil {
- in, out := &in.Configmaps, &out.Configmaps
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenAPITrait.
-func (in *OpenAPITrait) DeepCopy() *OpenAPITrait {
- if in == nil {
- return nil
- }
- out := new(OpenAPITrait)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *OwnerTrait) DeepCopyInto(out *OwnerTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.TargetAnnotations != nil {
- in, out := &in.TargetAnnotations, &out.TargetAnnotations
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
- if in.TargetLabels != nil {
- in, out := &in.TargetLabels, &out.TargetLabels
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OwnerTrait.
-func (in *OwnerTrait) DeepCopy() *OwnerTrait {
- if in == nil {
- return nil
- }
- out := new(OwnerTrait)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *PDBTrait) DeepCopyInto(out *PDBTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PDBTrait.
-func (in *PDBTrait) DeepCopy() *PDBTrait {
- if in == nil {
- return nil
- }
- out := new(PDBTrait)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *PlatformTrait) DeepCopyInto(out *PlatformTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.CreateDefault != nil {
- in, out := &in.CreateDefault, &out.CreateDefault
- *out = new(bool)
- **out = **in
- }
- if in.Global != nil {
- in, out := &in.Global, &out.Global
- *out = new(bool)
- **out = **in
- }
- if in.Auto != nil {
- in, out := &in.Auto, &out.Auto
- *out = new(bool)
- **out = **in
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlatformTrait.
-func (in *PlatformTrait) DeepCopy() *PlatformTrait {
- if in == nil {
- return nil
- }
- out := new(PlatformTrait)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PodSpec) DeepCopyInto(out *PodSpec) {
*out = *in
@@ -2143,48 +1419,6 @@ func (in *PodSpecTemplate) DeepCopy() *PodSpecTemplate {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *PodTrait) DeepCopyInto(out *PodTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodTrait.
-func (in *PodTrait) DeepCopy() *PodTrait {
- if in == nil {
- return nil
- }
- out := new(PodTrait)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *PrometheusTrait) DeepCopyInto(out *PrometheusTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.PodMonitor != nil {
- in, out := &in.PodMonitor, &out.PodMonitor
- *out = new(bool)
- **out = **in
- }
- if in.PodMonitorLabels != nil {
- in, out := &in.PodMonitorLabels, &out.PodMonitorLabels
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusTrait.
-func (in *PrometheusTrait) DeepCopy() *PrometheusTrait {
- if in == nil {
- return nil
- }
- out := new(PrometheusTrait)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in Properties) DeepCopyInto(out *Properties) {
{
@@ -2222,53 +1456,6 @@ func (in *PublishTask) DeepCopy() *PublishTask {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *PullSecretTrait) DeepCopyInto(out *PullSecretTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.ImagePullerDelegation != nil {
- in, out := &in.ImagePullerDelegation, &out.ImagePullerDelegation
- *out = new(bool)
- **out = **in
- }
- if in.Auto != nil {
- in, out := &in.Auto, &out.Auto
- *out = new(bool)
- **out = **in
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PullSecretTrait.
-func (in *PullSecretTrait) DeepCopy() *PullSecretTrait {
- if in == nil {
- return nil
- }
- out := new(PullSecretTrait)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *QuarkusTrait) DeepCopyInto(out *QuarkusTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.PackageTypes != nil {
- in, out := &in.PackageTypes, &out.PackageTypes
- *out = make([]QuarkusPackageType, len(*in))
- copy(*out, *in)
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QuarkusTrait.
-func (in *QuarkusTrait) DeepCopy() *QuarkusTrait {
- if in == nil {
- return nil
- }
- out := new(QuarkusTrait)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in RawMessage) DeepCopyInto(out *RawMessage) {
{
@@ -2303,22 +1490,6 @@ func (in *RegistrySpec) DeepCopy() *RegistrySpec {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *RegistryTrait) DeepCopyInto(out *RegistryTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistryTrait.
-func (in *RegistryTrait) DeepCopy() *RegistryTrait {
- if in == nil {
- return nil
- }
- out := new(RegistryTrait)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Repository) DeepCopyInto(out *Repository) {
*out = *in
@@ -2367,22 +1538,6 @@ func (in *ResourceSpec) DeepCopy() *ResourceSpec {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *RouteTrait) DeepCopyInto(out *RouteTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteTrait.
-func (in *RouteTrait) DeepCopy() *RouteTrait {
- if in == nil {
- return nil
- }
- out := new(RouteTrait)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RuntimeSpec) DeepCopyInto(out *RuntimeSpec) {
*out = *in
@@ -2456,53 +1611,6 @@ func (in *Server) DeepCopy() *Server {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ServiceBindingTrait) DeepCopyInto(out *ServiceBindingTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.Services != nil {
- in, out := &in.Services, &out.Services
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceBindingTrait.
-func (in *ServiceBindingTrait) DeepCopy() *ServiceBindingTrait {
- if in == nil {
- return nil
- }
- out := new(ServiceBindingTrait)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ServiceTrait) DeepCopyInto(out *ServiceTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.Auto != nil {
- in, out := &in.Auto, &out.Auto
- *out = new(bool)
- **out = **in
- }
- if in.NodePort != nil {
- in, out := &in.NodePort, &out.NodePort
- *out = new(bool)
- **out = **in
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceTrait.
-func (in *ServiceTrait) DeepCopy() *ServiceTrait {
- if in == nil {
- return nil
- }
- out := new(ServiceTrait)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SourceSpec) DeepCopyInto(out *SourceSpec) {
*out = *in
@@ -2586,213 +1694,172 @@ func (in *Task) DeepCopy() *Task {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *TolerationTrait) DeepCopyInto(out *TolerationTrait) {
- *out = *in
- in.Trait.DeepCopyInto(&out.Trait)
- if in.Taints != nil {
- in, out := &in.Taints, &out.Taints
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TolerationTrait.
-func (in *TolerationTrait) DeepCopy() *TolerationTrait {
- if in == nil {
- return nil
- }
- out := new(TolerationTrait)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *Trait) DeepCopyInto(out *Trait) {
- *out = *in
- if in.Enabled != nil {
- in, out := &in.Enabled, &out.Enabled
- *out = new(bool)
- **out = **in
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Trait.
-func (in *Trait) DeepCopy() *Trait {
- if in == nil {
- return nil
- }
- out := new(Trait)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Traits) DeepCopyInto(out *Traits) {
*out = *in
if in.Affinity != nil {
in, out := &in.Affinity, &out.Affinity
- *out = new(AffinityTrait)
+ *out = new(trait.AffinityTrait)
(*in).DeepCopyInto(*out)
}
if in.Builder != nil {
in, out := &in.Builder, &out.Builder
- *out = new(BuilderTrait)
+ *out = new(trait.BuilderTrait)
(*in).DeepCopyInto(*out)
}
if in.Camel != nil {
in, out := &in.Camel, &out.Camel
- *out = new(CamelTrait)
+ *out = new(trait.CamelTrait)
(*in).DeepCopyInto(*out)
}
if in.Container != nil {
in, out := &in.Container, &out.Container
- *out = new(ContainerTrait)
+ *out = new(trait.ContainerTrait)
(*in).DeepCopyInto(*out)
}
if in.Cron != nil {
in, out := &in.Cron, &out.Cron
- *out = new(CronTrait)
+ *out = new(trait.CronTrait)
(*in).DeepCopyInto(*out)
}
if in.Dependencies != nil {
in, out := &in.Dependencies, &out.Dependencies
- *out = new(DependenciesTrait)
+ *out = new(trait.DependenciesTrait)
(*in).DeepCopyInto(*out)
}
if in.Deployer != nil {
in, out := &in.Deployer, &out.Deployer
- *out = new(DeployerTrait)
+ *out = new(trait.DeployerTrait)
(*in).DeepCopyInto(*out)
}
if in.Deployment != nil {
in, out := &in.Deployment, &out.Deployment
- *out = new(DeploymentTrait)
+ *out = new(trait.DeploymentTrait)
(*in).DeepCopyInto(*out)
}
if in.Environment != nil {
in, out := &in.Environment, &out.Environment
- *out = new(EnvironmentTrait)
+ *out = new(trait.EnvironmentTrait)
(*in).DeepCopyInto(*out)
}
if in.ErrorHandler != nil {
in, out := &in.ErrorHandler, &out.ErrorHandler
- *out = new(ErrorHandlerTrait)
+ *out = new(trait.ErrorHandlerTrait)
(*in).DeepCopyInto(*out)
}
if in.GC != nil {
in, out := &in.GC, &out.GC
- *out = new(GCTrait)
+ *out = new(trait.GCTrait)
(*in).DeepCopyInto(*out)
}
if in.Health != nil {
in, out := &in.Health, &out.Health
- *out = new(HealthTrait)
+ *out = new(trait.HealthTrait)
(*in).DeepCopyInto(*out)
}
if in.Ingress != nil {
in, out := &in.Ingress, &out.Ingress
- *out = new(IngressTrait)
+ *out = new(trait.IngressTrait)
(*in).DeepCopyInto(*out)
}
if in.Istio != nil {
in, out := &in.Istio, &out.Istio
- *out = new(IstioTrait)
+ *out = new(trait.IstioTrait)
(*in).DeepCopyInto(*out)
}
if in.Jolokia != nil {
in, out := &in.Jolokia, &out.Jolokia
- *out = new(JolokiaTrait)
+ *out = new(trait.JolokiaTrait)
(*in).DeepCopyInto(*out)
}
if in.JVM != nil {
in, out := &in.JVM, &out.JVM
- *out = new(JVMTrait)
+ *out = new(trait.JVMTrait)
(*in).DeepCopyInto(*out)
}
if in.Knative != nil {
in, out := &in.Knative, &out.Knative
- *out = new(KnativeTrait)
+ *out = new(trait.KnativeTrait)
(*in).DeepCopyInto(*out)
}
if in.KnativeService != nil {
in, out := &in.KnativeService, &out.KnativeService
- *out = new(KnativeServiceTrait)
+ *out = new(trait.KnativeServiceTrait)
(*in).DeepCopyInto(*out)
}
if in.Logging != nil {
in, out := &in.Logging, &out.Logging
- *out = new(LoggingTrait)
+ *out = new(trait.LoggingTrait)
(*in).DeepCopyInto(*out)
}
if in.Mount != nil {
in, out := &in.Mount, &out.Mount
- *out = new(MountTrait)
+ *out = new(trait.MountTrait)
(*in).DeepCopyInto(*out)
}
if in.OpenAPI != nil {
in, out := &in.OpenAPI, &out.OpenAPI
- *out = new(OpenAPITrait)
+ *out = new(trait.OpenAPITrait)
(*in).DeepCopyInto(*out)
}
if in.Owner != nil {
in, out := &in.Owner, &out.Owner
- *out = new(OwnerTrait)
+ *out = new(trait.OwnerTrait)
(*in).DeepCopyInto(*out)
}
if in.PDB != nil {
in, out := &in.PDB, &out.PDB
- *out = new(PDBTrait)
+ *out = new(trait.PDBTrait)
(*in).DeepCopyInto(*out)
}
if in.Platform != nil {
in, out := &in.Platform, &out.Platform
- *out = new(PlatformTrait)
+ *out = new(trait.PlatformTrait)
(*in).DeepCopyInto(*out)
}
if in.Pod != nil {
in, out := &in.Pod, &out.Pod
- *out = new(PodTrait)
+ *out = new(trait.PodTrait)
(*in).DeepCopyInto(*out)
}
if in.Prometheus != nil {
in, out := &in.Prometheus, &out.Prometheus
- *out = new(PrometheusTrait)
+ *out = new(trait.PrometheusTrait)
(*in).DeepCopyInto(*out)
}
if in.PullSecret != nil {
in, out := &in.PullSecret, &out.PullSecret
- *out = new(PullSecretTrait)
+ *out = new(trait.PullSecretTrait)
(*in).DeepCopyInto(*out)
}
if in.Quarkus != nil {
in, out := &in.Quarkus, &out.Quarkus
- *out = new(QuarkusTrait)
+ *out = new(trait.QuarkusTrait)
(*in).DeepCopyInto(*out)
}
if in.Registry != nil {
in, out := &in.Registry, &out.Registry
- *out = new(RegistryTrait)
+ *out = new(trait.RegistryTrait)
(*in).DeepCopyInto(*out)
}
if in.Route != nil {
in, out := &in.Route, &out.Route
- *out = new(RouteTrait)
+ *out = new(trait.RouteTrait)
(*in).DeepCopyInto(*out)
}
if in.Service != nil {
in, out := &in.Service, &out.Service
- *out = new(ServiceTrait)
+ *out = new(trait.ServiceTrait)
(*in).DeepCopyInto(*out)
}
if in.ServiceBinding != nil {
in, out := &in.ServiceBinding, &out.ServiceBinding
- *out = new(ServiceBindingTrait)
+ *out = new(trait.ServiceBindingTrait)
(*in).DeepCopyInto(*out)
}
if in.Toleration != nil {
in, out := &in.Toleration, &out.Toleration
- *out = new(TolerationTrait)
+ *out = new(trait.TolerationTrait)
(*in).DeepCopyInto(*out)
}
}
diff --git a/pkg/cmd/debug.go b/pkg/cmd/debug.go
index c1d67c34d..2913bacae 100644
--- a/pkg/cmd/debug.go
+++ b/pkg/cmd/debug.go
@@ -24,6 +24,7 @@ import (
"syscall"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
camelv1 "github.com/apache/camel-k/pkg/client/camel/clientset/versioned/typed/camel/v1"
"github.com/apache/camel-k/pkg/util/kubernetes"
k8slog "github.com/apache/camel-k/pkg/util/kubernetes/log"
@@ -133,7 +134,7 @@ func (o *debugCmdOptions) run(cmd *cobra.Command, args []string) error {
func (o *debugCmdOptions) toggleDebug(c camelv1.IntegrationsGetter, it *v1.Integration, active bool) (*v1.Integration, error) {
if it.Spec.Traits.JVM == nil {
- it.Spec.Traits.JVM = &v1.JVMTrait{}
+ it.Spec.Traits.JVM = &traitv1.JVMTrait{}
}
jvmTrait := it.Spec.Traits.JVM
diff --git a/pkg/cmd/run_test.go b/pkg/cmd/run_test.go
index a1543b64c..a3a43aa3d 100644
--- a/pkg/cmd/run_test.go
+++ b/pkg/cmd/run_test.go
@@ -26,10 +26,13 @@ import (
"testing"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/trait"
"github.com/apache/camel-k/pkg/util/test"
+
"github.com/spf13/cobra"
"github.com/stretchr/testify/assert"
+ "k8s.io/utils/pointer"
)
const (
@@ -368,11 +371,11 @@ func TestConfigureTraits(t *testing.T) {
traitsMap, err := trait.ToMap(traits)
assert.Nil(t, err)
assert.Len(t, traitsMap, 5)
- assertTraitConfiguration(t, traits.Affinity, &v1.AffinityTrait{PodAffinity: pointer.Bool(false)})
- assertTraitConfiguration(t, traits.Container, &v1.ContainerTrait{DeprecatedProbesEnabled: pointer.Bool(false)})
- assertTraitConfiguration(t, traits.Environment, &v1.EnvironmentTrait{ContainerMeta: pointer.Bool(false)})
- assertTraitConfiguration(t, traits.JVM, &v1.JVMTrait{PrintCommand: pointer.Bool(false)})
- assertTraitConfiguration(t, traits.Prometheus, &v1.PrometheusTrait{PodMonitor: pointer.Bool(false)})
+ assertTraitConfiguration(t, traits.Affinity, &traitv1.AffinityTrait{PodAffinity: pointer.Bool(false)})
+ assertTraitConfiguration(t, traits.Container, &traitv1.ContainerTrait{DeprecatedProbesEnabled: pointer.Bool(false)})
+ assertTraitConfiguration(t, traits.Environment, &traitv1.EnvironmentTrait{ContainerMeta: pointer.Bool(false)})
+ assertTraitConfiguration(t, traits.JVM, &traitv1.JVMTrait{PrintCommand: pointer.Bool(false)})
+ assertTraitConfiguration(t, traits.Prometheus, &traitv1.PrometheusTrait{PodMonitor: pointer.Bool(false)})
}
func assertTraitConfiguration(t *testing.T, trait interface{}, expected interface{}) {
diff --git a/pkg/controller/integration/kits_test.go b/pkg/controller/integration/kits_test.go
index 86ed58de4..506d26f96 100644
--- a/pkg/controller/integration/kits_test.go
+++ b/pkg/controller/integration/kits_test.go
@@ -27,6 +27,7 @@ import (
"k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util/log"
"github.com/apache/camel-k/pkg/util/test"
)
@@ -153,8 +154,8 @@ func TestLookupKitForIntegration_DiscardKitsWithIncompatibleTraits(t *testing.T)
"camel-irc",
},
Traits: v1.IntegrationKitTraits{
- Builder: &v1.BuilderTrait{
- Trait: v1.Trait{
+ Builder: &traitv1.BuilderTrait{
+ Trait: traitv1.Trait{
Enabled: pointer.Bool(false),
},
},
@@ -184,8 +185,8 @@ func TestLookupKitForIntegration_DiscardKitsWithIncompatibleTraits(t *testing.T)
"camel-irc",
},
Traits: v1.IntegrationKitTraits{
- Builder: &v1.BuilderTrait{
- Trait: v1.Trait{
+ Builder: &traitv1.BuilderTrait{
+ Trait: traitv1.Trait{
Enabled: pointer.Bool(true),
},
Properties: []string{
@@ -217,8 +218,8 @@ func TestLookupKitForIntegration_DiscardKitsWithIncompatibleTraits(t *testing.T)
},
Spec: v1.IntegrationSpec{
Traits: v1.Traits{
- Builder: &v1.BuilderTrait{
- Trait: v1.Trait{
+ Builder: &traitv1.BuilderTrait{
+ Trait: traitv1.Trait{
Enabled: pointer.Bool(true),
},
Properties: []string{
@@ -253,8 +254,8 @@ func TestHasMatchingTraits_KitNoTraitShouldNotBePicked(t *testing.T) {
},
Spec: v1.IntegrationSpec{
Traits: v1.Traits{
- Builder: &v1.BuilderTrait{
- Trait: v1.Trait{
+ Builder: &traitv1.BuilderTrait{
+ Trait: traitv1.Trait{
Enabled: pointer.Bool(true),
},
},
@@ -293,8 +294,8 @@ func TestHasMatchingTraits_KitSameTraitShouldBePicked(t *testing.T) {
},
Spec: v1.IntegrationSpec{
Traits: v1.Traits{
- Builder: &v1.BuilderTrait{
- Trait: v1.Trait{
+ Builder: &traitv1.BuilderTrait{
+ Trait: traitv1.Trait{
Enabled: pointer.Bool(true),
},
Properties: []string{
@@ -316,8 +317,8 @@ func TestHasMatchingTraits_KitSameTraitShouldBePicked(t *testing.T) {
},
Spec: v1.IntegrationKitSpec{
Traits: v1.IntegrationKitTraits{
- Builder: &v1.BuilderTrait{
- Trait: v1.Trait{
+ Builder: &traitv1.BuilderTrait{
+ Trait: traitv1.Trait{
Enabled: pointer.Bool(true),
},
Properties: []string{
diff --git a/pkg/trait/affinity.go b/pkg/trait/affinity.go
index 6d6859425..051299fc2 100644
--- a/pkg/trait/affinity.go
+++ b/pkg/trait/affinity.go
@@ -28,17 +28,18 @@ import (
"k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
)
type affinityTrait struct {
BaseTrait
- v1.AffinityTrait `property:",squash"`
+ traitv1.AffinityTrait `property:",squash"`
}
func newAffinityTrait() Trait {
return &affinityTrait{
BaseTrait: NewBaseTrait("affinity", 1500),
- AffinityTrait: v1.AffinityTrait{
+ AffinityTrait: traitv1.AffinityTrait{
PodAffinity: pointer.Bool(false),
PodAntiAffinity: pointer.Bool(false),
},
diff --git a/pkg/trait/builder.go b/pkg/trait/builder.go
index 15eda75ca..23efd93de 100644
--- a/pkg/trait/builder.go
+++ b/pkg/trait/builder.go
@@ -25,6 +25,7 @@ import (
"k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/builder"
mvn "github.com/apache/camel-k/pkg/util/maven"
"github.com/apache/camel-k/pkg/util/property"
@@ -32,7 +33,7 @@ import (
type builderTrait struct {
BaseTrait
- v1.BuilderTrait `property:",squash"`
+ traitv1.BuilderTrait `property:",squash"`
}
func newBuilderTrait() Trait {
diff --git a/pkg/trait/camel.go b/pkg/trait/camel.go
index e5cf98652..671cee6ba 100644
--- a/pkg/trait/camel.go
+++ b/pkg/trait/camel.go
@@ -30,6 +30,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime/pkg/client"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/maven"
"github.com/apache/camel-k/pkg/util/property"
@@ -37,7 +38,7 @@ import (
type camelTrait struct {
BaseTrait
- v1.CamelTrait `property:",squash"`
+ traitv1.CamelTrait `property:",squash"`
}
func newCamelTrait() Trait {
diff --git a/pkg/trait/container.go b/pkg/trait/container.go
index 2f0011f36..dc510701a 100644
--- a/pkg/trait/container.go
+++ b/pkg/trait/container.go
@@ -31,6 +31,7 @@ import (
serving "knative.dev/serving/pkg/apis/serving/v1"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/defaults"
@@ -48,13 +49,13 @@ const (
type containerTrait struct {
BaseTrait
- v1.ContainerTrait `property:",squash"`
+ traitv1.ContainerTrait `property:",squash"`
}
func newContainerTrait() Trait {
return &containerTrait{
BaseTrait: NewBaseTrait(containerTraitID, 1600),
- ContainerTrait: v1.ContainerTrait{
+ ContainerTrait: traitv1.ContainerTrait{
Port: defaultContainerPort,
ServicePort: defaultServicePort,
ServicePortName: defaultContainerPortName,
diff --git a/pkg/trait/container_probes_test.go b/pkg/trait/container_probes_test.go
index acad3aeba..2642f032d 100644
--- a/pkg/trait/container_probes_test.go
+++ b/pkg/trait/container_probes_test.go
@@ -26,6 +26,7 @@ import (
"k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/kubernetes"
)
@@ -53,7 +54,7 @@ func TestProbesDependencies(t *testing.T) {
integration := &v1.Integration{
Spec: v1.IntegrationSpec{
Traits: v1.Traits{
- Container: &v1.ContainerTrait{
+ Container: &traitv1.ContainerTrait{
DeprecatedProbesEnabled: pointer.Bool(true),
},
},
@@ -73,7 +74,7 @@ func TestProbesOnDeployment(t *testing.T) {
integration := &v1.Integration{
Spec: v1.IntegrationSpec{
Traits: v1.Traits{
- Container: &v1.ContainerTrait{
+ Container: &traitv1.ContainerTrait{
DeprecatedProbesEnabled: pointer.Bool(true),
Expose: pointer.Bool(true),
DeprecatedLivenessTimeout: 1234,
@@ -105,7 +106,7 @@ func TestProbesOnDeploymentWithCustomScheme(t *testing.T) {
integration := &v1.Integration{
Spec: v1.IntegrationSpec{
Traits: v1.Traits{
- Container: &v1.ContainerTrait{
+ Container: &traitv1.ContainerTrait{
DeprecatedProbesEnabled: pointer.Bool(true),
Expose: pointer.Bool(true),
DeprecatedLivenessTimeout: 1234,
@@ -140,12 +141,12 @@ func TestProbesOnKnativeService(t *testing.T) {
Spec: v1.IntegrationSpec{
Profile: v1.TraitProfileKnative,
Traits: v1.Traits{
- KnativeService: &v1.KnativeServiceTrait{
- Trait: v1.Trait{
+ KnativeService: &traitv1.KnativeServiceTrait{
+ Trait: traitv1.Trait{
Enabled: pointer.Bool(true),
},
},
- Container: &v1.ContainerTrait{
+ Container: &traitv1.ContainerTrait{
DeprecatedProbesEnabled: pointer.Bool(true),
Expose: pointer.Bool(true),
DeprecatedLivenessTimeout: 1234,
diff --git a/pkg/trait/container_test.go b/pkg/trait/container_test.go
index 07db63f3e..54d2157b5 100644
--- a/pkg/trait/container_test.go
+++ b/pkg/trait/container_test.go
@@ -31,6 +31,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime/pkg/client"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/kubernetes"
"github.com/apache/camel-k/pkg/util/test"
@@ -111,7 +112,7 @@ func TestContainerWithCustomName(t *testing.T) {
Spec: v1.IntegrationSpec{
Profile: v1.TraitProfileKubernetes,
Traits: v1.Traits{
- Container: &v1.ContainerTrait{
+ Container: &traitv1.ContainerTrait{
Name: "my-container-name",
},
},
@@ -177,7 +178,7 @@ func TestContainerWithCustomImage(t *testing.T) {
Spec: v1.IntegrationSpec{
Profile: v1.TraitProfileKubernetes,
Traits: v1.Traits{
- Container: &v1.ContainerTrait{
+ Container: &traitv1.ContainerTrait{
Image: "foo/bar:1.0.0",
},
},
@@ -248,7 +249,7 @@ func TestContainerWithCustomImageAndIntegrationKit(t *testing.T) {
Spec: v1.IntegrationSpec{
Profile: v1.TraitProfileKubernetes,
Traits: v1.Traits{
- Container: &v1.ContainerTrait{
+ Container: &traitv1.ContainerTrait{
Image: "foo/bar:1.0.0",
},
},
@@ -294,7 +295,7 @@ func TestContainerWithImagePullPolicy(t *testing.T) {
Spec: v1.IntegrationSpec{
Profile: v1.TraitProfileKubernetes,
Traits: v1.Traits{
- Container: &v1.ContainerTrait{
+ Container: &traitv1.ContainerTrait{
ImagePullPolicy: "Always",
},
},
diff --git a/pkg/trait/cron.go b/pkg/trait/cron.go
index f6b33b250..62adad38e 100644
--- a/pkg/trait/cron.go
+++ b/pkg/trait/cron.go
@@ -29,6 +29,7 @@ import (
"k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/metadata"
"github.com/apache/camel-k/pkg/util"
"github.com/apache/camel-k/pkg/util/kubernetes"
@@ -38,7 +39,7 @@ import (
type cronTrait struct {
BaseTrait
- v1.CronTrait `property:",squash"`
+ traitv1.CronTrait `property:",squash"`
}
var _ ControllerStrategySelector = &cronTrait{}
diff --git a/pkg/trait/cron_test.go b/pkg/trait/cron_test.go
index 2d0240f17..9e30936d1 100644
--- a/pkg/trait/cron_test.go
+++ b/pkg/trait/cron_test.go
@@ -30,6 +30,7 @@ import (
"k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/kubernetes"
@@ -320,7 +321,7 @@ func TestCronDepsFallback(t *testing.T) {
},
Resources: []v1.ResourceSpec{},
Traits: v1.Traits{
- Cron: &v1.CronTrait{
+ Cron: &traitv1.CronTrait{
Fallback: pointer.Bool(true),
},
},
@@ -395,7 +396,7 @@ func TestCronWithActiveDeadline(t *testing.T) {
},
Resources: []v1.ResourceSpec{},
Traits: v1.Traits{
- Cron: &v1.CronTrait{
+ Cron: &traitv1.CronTrait{
ActiveDeadlineSeconds: pointer.Int64(120),
},
},
@@ -468,7 +469,7 @@ func TestCronWithBackoffLimit(t *testing.T) {
},
Resources: []v1.ResourceSpec{},
Traits: v1.Traits{
- Cron: &v1.CronTrait{
+ Cron: &traitv1.CronTrait{
BackoffLimit: pointer.Int32(5),
},
},
diff --git a/pkg/trait/dependencies.go b/pkg/trait/dependencies.go
index 59ed4bd22..9278dbc26 100644
--- a/pkg/trait/dependencies.go
+++ b/pkg/trait/dependencies.go
@@ -23,6 +23,7 @@ import (
"k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/metadata"
"github.com/apache/camel-k/pkg/util"
"github.com/apache/camel-k/pkg/util/kubernetes"
@@ -30,7 +31,7 @@ import (
type dependenciesTrait struct {
BaseTrait
- v1.DependenciesTrait `property:",squash"`
+ traitv1.DependenciesTrait `property:",squash"`
}
func newDependenciesTrait() Trait {
diff --git a/pkg/trait/deployer.go b/pkg/trait/deployer.go
index b46e3324a..861036cb5 100644
--- a/pkg/trait/deployer.go
+++ b/pkg/trait/deployer.go
@@ -31,13 +31,13 @@ import (
ctrl "sigs.k8s.io/controller-runtime/pkg/client"
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util/patch"
)
type deployerTrait struct {
BaseTrait
- v1.DeployerTrait `property:",squash"`
+ traitv1.DeployerTrait `property:",squash"`
}
var _ ControllerStrategySelector = &deployerTrait{}
diff --git a/pkg/trait/deployment.go b/pkg/trait/deployment.go
index c9fafe2e3..934eef07b 100644
--- a/pkg/trait/deployment.go
+++ b/pkg/trait/deployment.go
@@ -26,12 +26,13 @@ import (
"k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util/label"
)
type deploymentTrait struct {
BaseTrait
- v1.DeploymentTrait `property:",squash"`
+ traitv1.DeploymentTrait `property:",squash"`
}
var _ ControllerStrategySelector = &deploymentTrait{}
diff --git a/pkg/trait/environment.go b/pkg/trait/environment.go
index 735e9e1ea..a9ed40a70 100644
--- a/pkg/trait/environment.go
+++ b/pkg/trait/environment.go
@@ -22,7 +22,7 @@ import (
"k8s.io/utils/pointer"
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/defaults"
"github.com/apache/camel-k/pkg/util/envvar"
@@ -31,7 +31,7 @@ import (
type environmentTrait struct {
BaseTrait
- v1.EnvironmentTrait `property:",squash"`
+ traitv1.EnvironmentTrait `property:",squash"`
}
const (
@@ -54,7 +54,7 @@ const (
func newEnvironmentTrait() Trait {
return &environmentTrait{
BaseTrait: NewBaseTrait("environment", 800),
- EnvironmentTrait: v1.EnvironmentTrait{
+ EnvironmentTrait: traitv1.EnvironmentTrait{
ContainerMeta: pointer.Bool(true),
},
}
diff --git a/pkg/trait/environment_test.go b/pkg/trait/environment_test.go
index 9cf25059d..2072e8ede 100644
--- a/pkg/trait/environment_test.go
+++ b/pkg/trait/environment_test.go
@@ -28,6 +28,7 @@ import (
"k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/kubernetes"
)
@@ -82,7 +83,7 @@ func TestEnabledContainerMetaDataEnvVars(t *testing.T) {
env := mockEnvironment(c)
env.Integration.Spec.Traits = v1.Traits{
- Environment: &v1.EnvironmentTrait{
+ Environment: &traitv1.EnvironmentTrait{
ContainerMeta: pointer.Bool(true),
},
}
@@ -121,7 +122,7 @@ func TestDisabledContainerMetaDataEnvVars(t *testing.T) {
env := mockEnvironment(c)
env.Integration.Spec.Traits = v1.Traits{
- Environment: &v1.EnvironmentTrait{
+ Environment: &traitv1.EnvironmentTrait{
ContainerMeta: pointer.Bool(false),
},
}
@@ -161,7 +162,7 @@ func TestCustomEnvVars(t *testing.T) {
env := mockEnvironment(c)
env.Integration.Spec.Traits = v1.Traits{
- Environment: &v1.EnvironmentTrait{
+ Environment: &traitv1.EnvironmentTrait{
Vars: []string{"key1=val1", "key2 = val2"},
},
}
diff --git a/pkg/trait/error_handler.go b/pkg/trait/error_handler.go
index b15c052cb..c906ca40f 100644
--- a/pkg/trait/error_handler.go
+++ b/pkg/trait/error_handler.go
@@ -26,13 +26,14 @@ import (
"k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
"github.com/apache/camel-k/pkg/util"
)
type errorHandlerTrait struct {
BaseTrait
- v1.ErrorHandlerTrait `property:",squash"`
+ traitv1.ErrorHandlerTrait `property:",squash"`
}
func newErrorHandlerTrait() Trait {
diff --git a/pkg/trait/gc.go b/pkg/trait/gc.go
index bcbd3b9c6..5c0db1b8d 100644
--- a/pkg/trait/gc.go
+++ b/pkg/trait/gc.go
@@ -44,6 +44,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime/pkg/client"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util"
)
@@ -59,7 +60,7 @@ var (
type gcTrait struct {
BaseTrait
- v1.GCTrait `property:",squash"`
+ traitv1.GCTrait `property:",squash"`
}
func newGCTrait() Trait {
@@ -74,7 +75,7 @@ func (t *gcTrait) Configure(e *Environment) (bool, error) {
}
if t.DiscoveryCache == nil {
- s := v1.MemoryDiscoveryCache
+ s := traitv1.MemoryDiscoveryCache
t.DiscoveryCache = &s
}
@@ -244,7 +245,7 @@ func (t *gcTrait) getDeletableTypes(e *Environment) (map[schema.GroupVersionKind
func (t *gcTrait) discoveryClient() (discovery.DiscoveryInterface, error) {
switch *t.DiscoveryCache {
- case v1.DiskDiscoveryCache:
+ case traitv1.DiskDiscoveryCache:
if diskCachedDiscovery != nil {
return diskCachedDiscovery, nil
}
@@ -255,14 +256,14 @@ func (t *gcTrait) discoveryClient() (discovery.DiscoveryInterface, error) {
diskCachedDiscovery, err = disk.NewCachedDiscoveryClientForConfig(config, diskCacheDir, httpCacheDir, 10*time.Minute)
return diskCachedDiscovery, err
- case v1.MemoryDiscoveryCache:
+ case traitv1.MemoryDiscoveryCache:
if memoryCachedDiscovery != nil {
return memoryCachedDiscovery, nil
}
memoryCachedDiscovery = memory.NewMemCacheClient(t.Client.Discovery())
return memoryCachedDiscovery, nil
- case v1.DisabledDiscoveryCache, "":
+ case traitv1.DisabledDiscoveryCache, "":
return t.Client.Discovery(), nil
default:
diff --git a/pkg/trait/health.go b/pkg/trait/health.go
index 274defcb3..cf233d3e6 100644
--- a/pkg/trait/health.go
+++ b/pkg/trait/health.go
@@ -26,6 +26,7 @@ import (
"k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util"
)
@@ -36,13 +37,13 @@ const (
type healthTrait struct {
BaseTrait
- v1.HealthTrait `property:",squash"`
+ traitv1.HealthTrait `property:",squash"`
}
func newHealthTrait() Trait {
return &healthTrait{
BaseTrait: NewBaseTrait("health", 1700),
- HealthTrait: v1.HealthTrait{
+ HealthTrait: traitv1.HealthTrait{
LivenessScheme: string(corev1.URISchemeHTTP),
ReadinessScheme: string(corev1.URISchemeHTTP),
},
diff --git a/pkg/trait/ingress.go b/pkg/trait/ingress.go
index 31a0dd030..93b0bd591 100644
--- a/pkg/trait/ingress.go
+++ b/pkg/trait/ingress.go
@@ -27,17 +27,18 @@ import (
"k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
)
type ingressTrait struct {
BaseTrait
- v1.IngressTrait `property:",squash"`
+ traitv1.IngressTrait `property:",squash"`
}
func newIngressTrait() Trait {
return &ingressTrait{
BaseTrait: NewBaseTrait("ingress", 2400),
- IngressTrait: v1.IngressTrait{
+ IngressTrait: traitv1.IngressTrait{
Host: "",
},
}
diff --git a/pkg/trait/init.go b/pkg/trait/init.go
index b8005da52..9e29e5b91 100644
--- a/pkg/trait/init.go
+++ b/pkg/trait/init.go
@@ -25,6 +25,7 @@ import (
"k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util"
"github.com/apache/camel-k/pkg/util/dsl"
)
@@ -33,7 +34,7 @@ const flowsInternalSourceName = "camel-k-embedded-flow.yaml"
type initTrait struct {
BaseTrait
- v1.Trait
+ traitv1.Trait
}
func NewInitTrait() Trait {
diff --git a/pkg/trait/istio.go b/pkg/trait/istio.go
index 12013a532..f065c58db 100644
--- a/pkg/trait/istio.go
+++ b/pkg/trait/istio.go
@@ -20,16 +20,17 @@ package trait
import (
"strconv"
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
appsv1 "k8s.io/api/apps/v1"
"k8s.io/utils/pointer"
servingv1 "knative.dev/serving/pkg/apis/serving/v1"
+
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
)
type istioTrait struct {
BaseTrait
- v1.IstioTrait `property:",squash"`
+ traitv1.IstioTrait `property:",squash"`
}
const (
@@ -40,7 +41,7 @@ const (
func newIstioTrait() Trait {
return &istioTrait{
BaseTrait: NewBaseTrait("istio", 2300),
- IstioTrait: v1.IstioTrait{
+ IstioTrait: traitv1.IstioTrait{
Allow: "10.0.0.0/8,172.16.0.0/12,192.168.0.0/16",
},
}
diff --git a/pkg/trait/istio_test.go b/pkg/trait/istio_test.go
index b829d6d32..75e537c9c 100644
--- a/pkg/trait/istio_test.go
+++ b/pkg/trait/istio_test.go
@@ -30,6 +30,7 @@ import (
serving "knative.dev/serving/pkg/apis/serving/v1"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/kubernetes"
)
@@ -66,8 +67,8 @@ func NewIstioTestEnv(t *testing.T, d *appsv1.Deployment, s *serving.Service, ena
env.Platform.ResyncStatusFullConfig()
if enabled {
- env.Integration.Spec.Traits.Istio = &v1.IstioTrait{
- Trait: v1.Trait{
+ env.Integration.Spec.Traits.Istio = &traitv1.IstioTrait{
+ Trait: traitv1.Trait{
Enabled: pointer.Bool(true),
},
}
diff --git a/pkg/trait/jolokia.go b/pkg/trait/jolokia.go
index eae076c1a..2ca5c134f 100644
--- a/pkg/trait/jolokia.go
+++ b/pkg/trait/jolokia.go
@@ -26,18 +26,19 @@ import (
"k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util"
)
type jolokiaTrait struct {
BaseTrait
- v1.JolokiaTrait `property:",squash"`
+ traitv1.JolokiaTrait `property:",squash"`
}
func newJolokiaTrait() Trait {
return &jolokiaTrait{
BaseTrait: NewBaseTrait("jolokia", 1800),
- JolokiaTrait: v1.JolokiaTrait{
+ JolokiaTrait: traitv1.JolokiaTrait{
Port: 8778,
},
}
diff --git a/pkg/trait/jvm.go b/pkg/trait/jvm.go
index 0cca3267a..63fd61a24 100644
--- a/pkg/trait/jvm.go
+++ b/pkg/trait/jvm.go
@@ -37,6 +37,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime/pkg/client"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/builder"
"github.com/apache/camel-k/pkg/util"
"github.com/apache/camel-k/pkg/util/camel"
@@ -45,13 +46,13 @@ import (
type jvmTrait struct {
BaseTrait
- v1.JVMTrait `property:",squash"`
+ traitv1.JVMTrait `property:",squash"`
}
func newJvmTrait() Trait {
return &jvmTrait{
BaseTrait: NewBaseTrait("jvm", 2000),
- JVMTrait: v1.JVMTrait{
+ JVMTrait: traitv1.JVMTrait{
DebugAddress: "*:5005",
PrintCommand: pointer.Bool(true),
},
diff --git a/pkg/trait/kamelets.go b/pkg/trait/kamelets.go
index 821b08761..5ac294c80 100644
--- a/pkg/trait/kamelets.go
+++ b/pkg/trait/kamelets.go
@@ -29,6 +29,7 @@ import (
"k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
kameletutils "github.com/apache/camel-k/pkg/kamelet"
"github.com/apache/camel-k/pkg/kamelet/repository"
@@ -41,7 +42,7 @@ import (
type kameletsTrait struct {
BaseTrait
- v1.KameletsTrait `property:",squash"`
+ traitv1.KameletsTrait `property:",squash"`
}
type configurationKey struct {
diff --git a/pkg/trait/knative.go b/pkg/trait/knative.go
index 34fcd8375..7117a31e0 100644
--- a/pkg/trait/knative.go
+++ b/pkg/trait/knative.go
@@ -38,6 +38,7 @@ import (
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
knativeapi "github.com/apache/camel-k/pkg/apis/camel/v1/knative"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/metadata"
"github.com/apache/camel-k/pkg/util"
"github.com/apache/camel-k/pkg/util/envvar"
@@ -47,7 +48,7 @@ import (
type knativeTrait struct {
BaseTrait
- v1.KnativeTrait `property:",squash"`
+ traitv1.KnativeTrait `property:",squash"`
}
const (
diff --git a/pkg/trait/knative_service.go b/pkg/trait/knative_service.go
index 351c92044..3ea30c67e 100644
--- a/pkg/trait/knative_service.go
+++ b/pkg/trait/knative_service.go
@@ -28,6 +28,7 @@ import (
serving "knative.dev/serving/pkg/apis/serving/v1"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/metadata"
"github.com/apache/camel-k/pkg/util/kubernetes"
"github.com/apache/camel-k/pkg/util/label"
@@ -48,7 +49,7 @@ const (
type knativeServiceTrait struct {
BaseTrait
- v1.KnativeServiceTrait `property:",squash"`
+ traitv1.KnativeServiceTrait `property:",squash"`
}
var _ ControllerStrategySelector = &knativeServiceTrait{}
diff --git a/pkg/trait/knative_service_test.go b/pkg/trait/knative_service_test.go
index e3c91637b..8e28ae373 100644
--- a/pkg/trait/knative_service_test.go
+++ b/pkg/trait/knative_service_test.go
@@ -29,6 +29,7 @@ import (
serving "knative.dev/serving/pkg/apis/serving/v1"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/envvar"
"github.com/apache/camel-k/pkg/util/gzip"
@@ -89,8 +90,8 @@ func TestKnativeService(t *testing.T) {
{Type: "property", Value: "my-property=my-property-value"},
},
Traits: v1.Traits{
- KnativeService: &v1.KnativeServiceTrait{
- Trait: v1.Trait{
+ KnativeService: &traitv1.KnativeServiceTrait{
+ Trait: traitv1.Trait{
Enabled: pointer.Bool(true),
},
},
@@ -205,16 +206,16 @@ func TestKnativeServiceWithCustomContainerName(t *testing.T) {
Spec: v1.IntegrationSpec{
Profile: v1.TraitProfileKnative,
Traits: v1.Traits{
- Deployer: &v1.DeployerTrait{
+ Deployer: &traitv1.DeployerTrait{
Kind: "knative-service",
},
- KnativeService: &v1.KnativeServiceTrait{
- Trait: v1.Trait{
+ KnativeService: &traitv1.KnativeServiceTrait{
+ Trait: traitv1.Trait{
Enabled: pointer.Bool(true),
},
Auto: pointer.Bool(false),
},
- Container: &v1.ContainerTrait{
+ Container: &traitv1.ContainerTrait{
Name: "my-container-name",
},
},
@@ -365,7 +366,7 @@ func TestKnativeServiceWithRollout(t *testing.T) {
},
},
Traits: v1.Traits{
- KnativeService: &v1.KnativeServiceTrait{
+ KnativeService: &traitv1.KnativeServiceTrait{
RolloutDuration: "60s",
},
},
diff --git a/pkg/trait/knative_test.go b/pkg/trait/knative_test.go
index 12bc8d4b0..590eeda63 100644
--- a/pkg/trait/knative_test.go
+++ b/pkg/trait/knative_test.go
@@ -35,6 +35,7 @@ import (
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
knativeapi "github.com/apache/camel-k/pkg/apis/camel/v1/knative"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/client"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/envvar"
@@ -64,8 +65,8 @@ func TestKnativeEnvConfigurationFromTrait(t *testing.T) {
Sources: []v1.SourceSpec{},
Resources: []v1.ResourceSpec{},
Traits: v1.Traits{
- Knative: &v1.KnativeTrait{
- Trait: v1.Trait{
+ Knative: &traitv1.KnativeTrait{
+ Trait: traitv1.Trait{
Enabled: pointer.Bool(true),
},
Auto: pointer.Bool(false),
@@ -192,8 +193,8 @@ func TestKnativeEnvConfigurationFromSource(t *testing.T) {
},
Resources: []v1.ResourceSpec{},
Traits: v1.Traits{
- Knative: &v1.KnativeTrait{
- Trait: v1.Trait{
+ Knative: &traitv1.KnativeTrait{
+ Trait: traitv1.Trait{
Enabled: pointer.Bool(true),
},
},
@@ -379,8 +380,8 @@ func NewFakeEnvironment(t *testing.T, source v1.SourceSpec) Environment {
},
Resources: []v1.ResourceSpec{},
Traits: v1.Traits{
- Knative: &v1.KnativeTrait{
- Trait: v1.Trait{
+ Knative: &traitv1.KnativeTrait{
+ Trait: traitv1.Trait{
Enabled: pointer.Bool(true),
},
},
diff --git a/pkg/trait/logging.go b/pkg/trait/logging.go
index bb13043b1..99eef35b3 100644
--- a/pkg/trait/logging.go
+++ b/pkg/trait/logging.go
@@ -20,7 +20,7 @@ package trait
import (
"k8s.io/utils/pointer"
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util/envvar"
)
@@ -35,13 +35,13 @@ const (
type loggingTrait struct {
BaseTrait
- v1.LoggingTrait `property:",squash"`
+ traitv1.LoggingTrait `property:",squash"`
}
func newLoggingTraitTrait() Trait {
return &loggingTrait{
BaseTrait: NewBaseTrait("logging", 800),
- LoggingTrait: v1.LoggingTrait{
+ LoggingTrait: traitv1.LoggingTrait{
Level: defaultLogLevel,
},
}
diff --git a/pkg/trait/logging_test.go b/pkg/trait/logging_test.go
index 519932c91..e59563877 100644
--- a/pkg/trait/logging_test.go
+++ b/pkg/trait/logging_test.go
@@ -28,6 +28,7 @@ import (
"k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/kubernetes"
)
@@ -55,7 +56,7 @@ func createLoggingTestEnv(t *testing.T, color bool, json bool, jsonPrettyPrint b
Spec: v1.IntegrationSpec{
Profile: v1.TraitProfileOpenShift,
Traits: v1.Traits{
- Logging: &v1.LoggingTrait{
+ Logging: &traitv1.LoggingTrait{
Color: pointer.Bool(color),
Format: logFormat,
JSON: pointer.Bool(json),
diff --git a/pkg/trait/mount.go b/pkg/trait/mount.go
index fb81840c7..d695f437d 100644
--- a/pkg/trait/mount.go
+++ b/pkg/trait/mount.go
@@ -31,13 +31,14 @@ import (
serving "knative.dev/serving/pkg/apis/serving/v1"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util/kubernetes"
utilResource "github.com/apache/camel-k/pkg/util/resource"
)
type mountTrait struct {
BaseTrait
- v1.MountTrait `property:",squash"`
+ traitv1.MountTrait `property:",squash"`
}
func newMountTrait() Trait {
diff --git a/pkg/trait/mount_test.go b/pkg/trait/mount_test.go
index 34a6e4924..e46e70cb7 100644
--- a/pkg/trait/mount_test.go
+++ b/pkg/trait/mount_test.go
@@ -28,6 +28,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/gzip"
"github.com/apache/camel-k/pkg/util/kubernetes"
@@ -154,7 +155,7 @@ func getNominalEnv(t *testing.T, traitCatalog *Catalog) *Environment {
},
},
Traits: v1.Traits{
- Mount: &v1.MountTrait{
+ Mount: &traitv1.MountTrait{
Configs: []string{"configmap:my-cm"},
Resources: []string{"secret:my-secret"},
Volumes: []string{"my-pvc:/over/the/rainbow"},
diff --git a/pkg/trait/openapi.go b/pkg/trait/openapi.go
index 1d48367d0..19e7bbef1 100644
--- a/pkg/trait/openapi.go
+++ b/pkg/trait/openapi.go
@@ -38,6 +38,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime/pkg/client"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util"
"github.com/apache/camel-k/pkg/util/defaults"
"github.com/apache/camel-k/pkg/util/digest"
@@ -49,7 +50,7 @@ import (
type openAPITrait struct {
BaseTrait
- v1.OpenAPITrait `property:",squash"`
+ traitv1.OpenAPITrait `property:",squash"`
}
func newOpenAPITrait() Trait {
diff --git a/pkg/trait/owner.go b/pkg/trait/owner.go
index 0ac1f0259..8c8a5fc53 100644
--- a/pkg/trait/owner.go
+++ b/pkg/trait/owner.go
@@ -25,11 +25,12 @@ import (
serving "knative.dev/serving/pkg/apis/serving/v1"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
)
type ownerTrait struct {
BaseTrait
- v1.OwnerTrait `property:",squash"`
+ traitv1.OwnerTrait `property:",squash"`
}
func newOwnerTrait() Trait {
diff --git a/pkg/trait/owner_test.go b/pkg/trait/owner_test.go
index 96aaa8491..5d73bac31 100644
--- a/pkg/trait/owner_test.go
+++ b/pkg/trait/owner_test.go
@@ -26,6 +26,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
)
func TestOwner(t *testing.T) {
@@ -44,7 +45,7 @@ func SetUpOwnerEnvironment(t *testing.T) *Environment {
env := createTestEnv(t, v1.IntegrationPlatformClusterOpenShift, "camel:core")
env.Integration.Spec.Traits = v1.Traits{
- Owner: &v1.OwnerTrait{
+ Owner: &traitv1.OwnerTrait{
TargetLabels: []string{"com.mycompany/mylabel1"},
TargetAnnotations: []string{"com.mycompany/myannotation2"},
},
diff --git a/pkg/trait/pdb.go b/pkg/trait/pdb.go
index cb57e4a99..ba98af215 100644
--- a/pkg/trait/pdb.go
+++ b/pkg/trait/pdb.go
@@ -26,11 +26,12 @@ import (
"k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
)
type pdbTrait struct {
BaseTrait
- v1.PDBTrait `property:",squash"`
+ traitv1.PDBTrait `property:",squash"`
}
func newPdbTrait() Trait {
diff --git a/pkg/trait/platform.go b/pkg/trait/platform.go
index 6c1cebabe..4cf7d5b65 100644
--- a/pkg/trait/platform.go
+++ b/pkg/trait/platform.go
@@ -22,13 +22,14 @@ import (
"k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/platform"
"github.com/apache/camel-k/pkg/util/openshift"
)
type platformTrait struct {
BaseTrait
- v1.PlatformTrait `property:",squash"`
+ traitv1.PlatformTrait `property:",squash"`
}
func newPlatformTrait() Trait {
diff --git a/pkg/trait/pod.go b/pkg/trait/pod.go
index 6bdc6763f..b139eb81e 100644
--- a/pkg/trait/pod.go
+++ b/pkg/trait/pod.go
@@ -30,11 +30,12 @@ import (
serving "knative.dev/serving/pkg/apis/serving/v1"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
)
type podTrait struct {
BaseTrait
- v1.PodTrait `property:",squash"`
+ traitv1.PodTrait `property:",squash"`
}
func newPodTrait() Trait {
diff --git a/pkg/trait/prometheus.go b/pkg/trait/prometheus.go
index 9997bac76..134b1e62c 100644
--- a/pkg/trait/prometheus.go
+++ b/pkg/trait/prometheus.go
@@ -27,18 +27,19 @@ import (
monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util"
)
type prometheusTrait struct {
BaseTrait
- v1.PrometheusTrait `property:",squash"`
+ traitv1.PrometheusTrait `property:",squash"`
}
func newPrometheusTrait() Trait {
return &prometheusTrait{
BaseTrait: NewBaseTrait("prometheus", 1900),
- PrometheusTrait: v1.PrometheusTrait{
+ PrometheusTrait: traitv1.PrometheusTrait{
PodMonitor: pointer.Bool(true),
},
}
diff --git a/pkg/trait/pull_secret.go b/pkg/trait/pull_secret.go
index ab758bb4f..470186ffd 100644
--- a/pkg/trait/pull_secret.go
+++ b/pkg/trait/pull_secret.go
@@ -29,7 +29,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime/pkg/client"
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/platform"
"github.com/apache/camel-k/pkg/util/kubernetes"
"github.com/apache/camel-k/pkg/util/openshift"
@@ -37,7 +37,7 @@ import (
type pullSecretTrait struct {
BaseTrait
- v1.PullSecretTrait `property:",squash"`
+ traitv1.PullSecretTrait `property:",squash"`
}
func newPullSecretTrait() Trait {
diff --git a/pkg/trait/quarkus.go b/pkg/trait/quarkus.go
index 9890f124c..fc5509595 100644
--- a/pkg/trait/quarkus.go
+++ b/pkg/trait/quarkus.go
@@ -27,6 +27,7 @@ import (
"k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/builder"
"github.com/apache/camel-k/pkg/util/defaults"
"github.com/apache/camel-k/pkg/util/kubernetes"
@@ -36,14 +37,14 @@ const (
quarkusTraitID = "quarkus"
)
-var kitPriority = map[v1.QuarkusPackageType]string{
- v1.FastJarPackageType: "1000",
- v1.NativePackageType: "2000",
+var kitPriority = map[traitv1.QuarkusPackageType]string{
+ traitv1.FastJarPackageType: "1000",
+ traitv1.NativePackageType: "2000",
}
type quarkusTrait struct {
BaseTrait
- v1.QuarkusTrait `property:",squash"`
+ traitv1.QuarkusTrait `property:",squash"`
}
func newQuarkusTrait() Trait {
@@ -74,13 +75,13 @@ func (t *quarkusTrait) Matches(trait Trait) bool {
return false
}
- if len(t.PackageTypes) == 0 && len(qt.PackageTypes) != 0 && !containsPackageType(qt.PackageTypes, v1.FastJarPackageType) {
+ if len(t.PackageTypes) == 0 && len(qt.PackageTypes) != 0 && !containsPackageType(qt.PackageTypes, traitv1.FastJarPackageType) {
return false
}
types:
for _, pt := range t.PackageTypes {
- if pt == v1.FastJarPackageType && len(qt.PackageTypes) == 0 {
+ if pt == traitv1.FastJarPackageType && len(qt.PackageTypes) == 0 {
continue
}
if containsPackageType(qt.PackageTypes, pt) {
@@ -105,7 +106,7 @@ func (t *quarkusTrait) Configure(e *Environment) (bool, error) {
func (t *quarkusTrait) Apply(e *Environment) error {
if e.IntegrationInPhase(v1.IntegrationPhaseBuildingKit) {
- if containsPackageType(t.PackageTypes, v1.NativePackageType) {
+ if containsPackageType(t.PackageTypes, traitv1.NativePackageType) {
// Native compilation is only supported for a subset of languages,
// so let's check for compatibility, and fail-fast the Integration,
// to save compute resources and user time.
@@ -128,7 +129,7 @@ func (t *quarkusTrait) Apply(e *Environment) error {
switch len(t.PackageTypes) {
case 0:
- kit := t.newIntegrationKit(e, v1.FastJarPackageType)
+ kit := t.newIntegrationKit(e, traitv1.FastJarPackageType)
e.IntegrationKits = append(e.IntegrationKits, *kit)
case 1:
@@ -139,9 +140,9 @@ func (t *quarkusTrait) Apply(e *Environment) error {
for _, packageType := range t.PackageTypes {
kit := t.newIntegrationKit(e, packageType)
if kit.Spec.Traits.Quarkus == nil {
- kit.Spec.Traits.Quarkus = &v1.QuarkusTrait{}
+ kit.Spec.Traits.Quarkus = &traitv1.QuarkusTrait{}
}
- kit.Spec.Traits.Quarkus.PackageTypes = []v1.QuarkusPackageType{packageType}
+ kit.Spec.Traits.Quarkus.PackageTypes = []traitv1.QuarkusPackageType{packageType}
e.IntegrationKits = append(e.IntegrationKits, *kit)
}
}
@@ -174,14 +175,14 @@ func (t *quarkusTrait) Apply(e *Environment) error {
}
if native {
- build.Maven.Properties["quarkus.package.type"] = string(v1.NativePackageType)
+ build.Maven.Properties["quarkus.package.type"] = string(traitv1.NativePackageType)
steps = append(steps, builder.Image.NativeImageContext)
// Spectrum does not rely on Dockerfile to assemble the image
if e.Platform.Status.Build.PublishStrategy != v1.IntegrationPlatformBuildPublishStrategySpectrum {
steps = append(steps, builder.Image.ExecutableDockerfile)
}
} else {
- build.Maven.Properties["quarkus.package.type"] = string(v1.FastJarPackageType)
+ build.Maven.Properties["quarkus.package.type"] = string(traitv1.FastJarPackageType)
steps = append(steps, builder.Quarkus.ComputeQuarkusDependencies, builder.Image.IncrementalImageContext)
// Spectrum does not rely on Dockerfile to assemble the image
if e.Platform.Status.Build.PublishStrategy != v1.IntegrationPlatformBuildPublishStrategySpectrum {
@@ -211,7 +212,7 @@ func (t *quarkusTrait) Apply(e *Environment) error {
return nil
}
-func (t *quarkusTrait) newIntegrationKit(e *Environment, packageType v1.QuarkusPackageType) *v1.IntegrationKit {
+func (t *quarkusTrait) newIntegrationKit(e *Environment, packageType traitv1.QuarkusPackageType) *v1.IntegrationKit {
integration := e.Integration
kit := v1.NewIntegrationKit(integration.GetIntegrationKitNamespace(e.Platform), fmt.Sprintf("kit-%s", xid.New()))
@@ -255,7 +256,7 @@ func (t *quarkusTrait) isNativeKit(e *Environment) (bool, error) {
case 0:
return false, nil
case 1:
- return types[0] == v1.NativePackageType, nil
+ return types[0] == traitv1.NativePackageType, nil
default:
return false, fmt.Errorf("kit %q has more than one package type", e.IntegrationKit.Name)
}
@@ -275,7 +276,7 @@ func getBuilderTask(tasks []v1.Task) *v1.BuilderTask {
return nil
}
-func containsPackageType(types []v1.QuarkusPackageType, t v1.QuarkusPackageType) bool {
+func containsPackageType(types []traitv1.QuarkusPackageType, t traitv1.QuarkusPackageType) bool {
for _, ti := range types {
if t == ti {
return true
diff --git a/pkg/trait/registry.go b/pkg/trait/registry.go
index 368410675..2a7cbc61d 100644
--- a/pkg/trait/registry.go
+++ b/pkg/trait/registry.go
@@ -27,6 +27,7 @@ import (
base64 "encoding/base64"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/platform"
"github.com/apache/camel-k/pkg/util/kubernetes"
"github.com/apache/camel-k/pkg/util/registry"
@@ -38,7 +39,7 @@ import (
type registryTrait struct {
BaseTrait
- v1.RegistryTrait
+ traitv1.RegistryTrait
}
func newRegistryTrait() Trait {
diff --git a/pkg/trait/route.go b/pkg/trait/route.go
index 652f6bee5..08b450114 100644
--- a/pkg/trait/route.go
+++ b/pkg/trait/route.go
@@ -30,13 +30,14 @@ import (
routev1 "github.com/openshift/api/route/v1"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util/kubernetes"
)
type routeTrait struct {
BaseTrait
- v1.RouteTrait `property:",squash"`
- service *corev1.Service
+ traitv1.RouteTrait `property:",squash"`
+ service *corev1.Service
}
func newRouteTrait() Trait {
diff --git a/pkg/trait/route_test.go b/pkg/trait/route_test.go
index 241210177..9ddf24e5f 100644
--- a/pkg/trait/route_test.go
+++ b/pkg/trait/route_test.go
@@ -30,6 +30,7 @@ import (
"k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/kubernetes"
"github.com/apache/camel-k/pkg/util/test"
@@ -219,8 +220,8 @@ func TestRoute_Disabled(t *testing.T) {
name := xid.New().String()
environment := createTestRouteEnvironment(t, name)
environment.Integration.Spec.Traits = v1.Traits{
- Route: &v1.RouteTrait{
- Trait: v1.Trait{
+ Route: &traitv1.RouteTrait{
+ Trait: traitv1.Trait{
Enabled: pointer.Bool(false),
},
},
@@ -260,7 +261,7 @@ func TestRoute_Host(t *testing.T) {
traitsCatalog := environment.Catalog
environment.Integration.Spec.Traits = v1.Traits{
- Route: &v1.RouteTrait{
+ Route: &traitv1.RouteTrait{
Host: host,
},
}
@@ -286,7 +287,7 @@ func TestRoute_TLS_From_Secret_reencrypt(t *testing.T) {
traitsCatalog := environment.Catalog
environment.Integration.Spec.Traits = v1.Traits{
- Route: &v1.RouteTrait{
+ Route: &traitv1.RouteTrait{
TLSTermination: string(routev1.TLSTerminationReencrypt),
Host: host,
TLSKeySecret: tlsKeySecretName,
@@ -321,7 +322,7 @@ func TestRoute_TLS_wrong_secret(t *testing.T) {
traitsCatalog := environment.Catalog
environment.Integration.Spec.Traits = v1.Traits{
- Route: &v1.RouteTrait{
+ Route: &traitv1.RouteTrait{
TLSTermination: string(routev1.TLSTerminationReencrypt),
Host: host,
TLSKeySecret: "foo",
@@ -350,7 +351,7 @@ func TestRoute_TLS_secret_wrong_key(t *testing.T) {
traitsCatalog := environment.Catalog
environment.Integration.Spec.Traits = v1.Traits{
- Route: &v1.RouteTrait{
+ Route: &traitv1.RouteTrait{
TLSTermination: string(routev1.TLSTerminationReencrypt),
Host: host,
TLSKeySecret: tlsKeySecretName,
@@ -378,7 +379,7 @@ func TestRoute_TLS_secret_missing_key(t *testing.T) {
traitsCatalog := environment.Catalog
environment.Integration.Spec.Traits = v1.Traits{
- Route: &v1.RouteTrait{
+ Route: &traitv1.RouteTrait{
TLSTermination: string(routev1.TLSTerminationReencrypt),
Host: host,
TLSKeySecret: tlsKeySecretName,
@@ -406,7 +407,7 @@ func TestRoute_TLS_reencrypt(t *testing.T) {
traitsCatalog := environment.Catalog
environment.Integration.Spec.Traits = v1.Traits{
- Route: &v1.RouteTrait{
+ Route: &traitv1.RouteTrait{
TLSTermination: string(routev1.TLSTerminationReencrypt),
Host: host,
TLSKey: key,
@@ -441,7 +442,7 @@ func TestRoute_TLS_edge(t *testing.T) {
traitsCatalog := environment.Catalog
environment.Integration.Spec.Traits = v1.Traits{
- Route: &v1.RouteTrait{
+ Route: &traitv1.RouteTrait{
TLSTermination: string(routev1.TLSTerminationEdge),
Host: host,
TLSKey: key,
@@ -475,7 +476,7 @@ func TestRoute_TLS_passthrough(t *testing.T) {
traitsCatalog := environment.Catalog
environment.Integration.Spec.Traits = v1.Traits{
- Route: &v1.RouteTrait{
+ Route: &traitv1.RouteTrait{
TLSTermination: string(routev1.TLSTerminationPassthrough),
Host: host,
TLSInsecureEdgeTerminationPolicy: string(routev1.InsecureEdgeTerminationPolicyAllow),
@@ -505,7 +506,7 @@ func TestRoute_WithCustomServicePort(t *testing.T) {
name := xid.New().String()
environment := createTestRouteEnvironment(t, name)
environment.Integration.Spec.Traits = v1.Traits{
- Container: &v1.ContainerTrait{
+ Container: &traitv1.ContainerTrait{
ServicePortName: "my-port",
},
}
diff --git a/pkg/trait/service.go b/pkg/trait/service.go
index 5a2e3de47..79199041a 100644
--- a/pkg/trait/service.go
+++ b/pkg/trait/service.go
@@ -23,13 +23,14 @@ import (
"k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/metadata"
"github.com/apache/camel-k/pkg/util/kubernetes"
)
type serviceTrait struct {
BaseTrait
- v1.ServiceTrait `property:",squash"`
+ traitv1.ServiceTrait `property:",squash"`
}
const serviceTraitID = "service"
diff --git a/pkg/trait/service_binding.go b/pkg/trait/service_binding.go
index f57ab57a4..ae37c81bd 100644
--- a/pkg/trait/service_binding.go
+++ b/pkg/trait/service_binding.go
@@ -32,13 +32,14 @@ import (
"github.com/redhat-developer/service-binding-operator/pkg/reconcile/pipeline/handler/naming"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/reference"
)
type serviceBindingTrait struct {
BaseTrait
- v1.ServiceBindingTrait `property:",squash"`
+ traitv1.ServiceBindingTrait `property:",squash"`
}
func newServiceBindingTrait() Trait {
diff --git a/pkg/trait/service_test.go b/pkg/trait/service_test.go
index 7e9d59283..944c7cea2 100644
--- a/pkg/trait/service_test.go
+++ b/pkg/trait/service_test.go
@@ -28,6 +28,7 @@ import (
"k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/gzip"
"github.com/apache/camel-k/pkg/util/kubernetes"
@@ -71,8 +72,8 @@ func TestServiceWithDefaults(t *testing.T) {
},
},
Traits: v1.Traits{
- Service: &v1.ServiceTrait{
- Trait: v1.Trait{
+ Service: &traitv1.ServiceTrait{
+ Trait: traitv1.Trait{
Enabled: pointer.Bool(true),
},
Auto: pointer.Bool(false),
@@ -164,13 +165,13 @@ func TestService(t *testing.T) {
},
},
Traits: v1.Traits{
- Service: &v1.ServiceTrait{
- Trait: v1.Trait{
+ Service: &traitv1.ServiceTrait{
+ Trait: traitv1.Trait{
Enabled: pointer.Bool(true),
},
},
- Container: &v1.ContainerTrait{
- Trait: v1.Trait{
+ Container: &traitv1.ContainerTrait{
+ Trait: traitv1.Trait{
Enabled: pointer.Bool(true),
},
Auto: pointer.Bool(false),
@@ -252,13 +253,13 @@ func TestServiceWithCustomContainerName(t *testing.T) {
Spec: v1.IntegrationSpec{
Profile: v1.TraitProfileKubernetes,
Traits: v1.Traits{
- Service: &v1.ServiceTrait{
- Trait: v1.Trait{
+ Service: &traitv1.ServiceTrait{
+ Trait: traitv1.Trait{
Enabled: pointer.Bool(true),
},
Auto: pointer.Bool(false),
},
- Container: &v1.ContainerTrait{
+ Container: &traitv1.ContainerTrait{
Name: "my-container-name",
},
},
@@ -338,8 +339,8 @@ func TestServiceWithNodePort(t *testing.T) {
},
},
Traits: v1.Traits{
- Service: &v1.ServiceTrait{
- Trait: v1.Trait{
+ Service: &traitv1.ServiceTrait{
+ Trait: traitv1.Trait{
Enabled: pointer.Bool(true),
},
Auto: pointer.Bool(false),
diff --git a/pkg/trait/toleration.go b/pkg/trait/toleration.go
index 83483830c..daab0c59c 100644
--- a/pkg/trait/toleration.go
+++ b/pkg/trait/toleration.go
@@ -23,13 +23,13 @@ import (
corev1 "k8s.io/api/core/v1"
"k8s.io/utils/pointer"
- v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util/kubernetes"
)
type tolerationTrait struct {
BaseTrait
- v1.TolerationTrait `property:",squash"`
+ traitv1.TolerationTrait `property:",squash"`
}
func newTolerationTrait() Trait {
diff --git a/pkg/trait/trait_configure_test.go b/pkg/trait/trait_configure_test.go
index 0cfe1b853..00c374955 100644
--- a/pkg/trait/trait_configure_test.go
+++ b/pkg/trait/trait_configure_test.go
@@ -26,6 +26,7 @@ import (
"k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
)
func TestTraitConfigurationFromAnnotations(t *testing.T) {
@@ -40,7 +41,7 @@ func TestTraitConfigurationFromAnnotations(t *testing.T) {
Spec: v1.IntegrationSpec{
Profile: v1.TraitProfileKubernetes,
Traits: v1.Traits{
- Cron: &v1.CronTrait{
+ Cron: &traitv1.CronTrait{
Fallback: pointer.Bool(true),
ConcurrencyPolicy: "mypolicy",
},
@@ -83,7 +84,7 @@ func TestTraitConfigurationOverrideRulesFromAnnotations(t *testing.T) {
},
Spec: v1.IntegrationPlatformSpec{
Traits: v1.Traits{
- Cron: &v1.CronTrait{
+ Cron: &traitv1.CronTrait{
Components: "cmp1",
Schedule: "schedule1",
ConcurrencyPolicy: "policy1",
@@ -101,7 +102,7 @@ func TestTraitConfigurationOverrideRulesFromAnnotations(t *testing.T) {
},
Spec: v1.IntegrationKitSpec{
Traits: v1.IntegrationKitTraits{
- Builder: &v1.BuilderTrait{
+ Builder: &traitv1.BuilderTrait{
Verbose: pointer.Bool(false),
},
},
@@ -117,7 +118,7 @@ func TestTraitConfigurationOverrideRulesFromAnnotations(t *testing.T) {
Spec: v1.IntegrationSpec{
Profile: v1.TraitProfileKubernetes,
Traits: v1.Traits{
- Cron: &v1.CronTrait{
+ Cron: &traitv1.CronTrait{
ConcurrencyPolicy: "policy3",
},
},
diff --git a/pkg/trait/trait_test.go b/pkg/trait/trait_test.go
index c2aeb40fc..efc7aa9fc 100644
--- a/pkg/trait/trait_test.go
+++ b/pkg/trait/trait_test.go
@@ -31,6 +31,7 @@ import (
"k8s.io/utils/pointer"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/util/camel"
"github.com/apache/camel-k/pkg/util/kubernetes"
)
@@ -89,8 +90,8 @@ func TestOpenShiftTraitsWithWebAndConfig(t *testing.T) {
func TestOpenShiftTraitsWithWebAndDisabledTrait(t *testing.T) {
env := createTestEnv(t, v1.IntegrationPlatformClusterOpenShift, "from('netty-http:http').to('log:info')")
- env.Integration.Spec.Traits.Service = &v1.ServiceTrait{
- Trait: v1.Trait{
+ env.Integration.Spec.Traits.Service = &traitv1.ServiceTrait{
+ Trait: traitv1.Trait{
Enabled: pointer.Bool(false),
},
}
@@ -136,8 +137,8 @@ func TestKubernetesTraitsWithWeb(t *testing.T) {
}
func TestTraitDecode(t *testing.T) {
- trait := v1.ContainerTrait{
- Trait: v1.Trait{
+ trait := traitv1.ContainerTrait{
+ Trait: traitv1.Trait{
Enabled: pointer.Bool(false),
},
Port: 7071,
@@ -156,8 +157,8 @@ func TestTraitDecode(t *testing.T) {
func TestTraitHierarchyDecode(t *testing.T) {
env := createTestEnv(t, v1.IntegrationPlatformClusterOpenShift, "")
- env.Platform.Spec.Traits.KnativeService = &v1.KnativeServiceTrait{
- Trait: v1.Trait{
+ env.Platform.Spec.Traits.KnativeService = &traitv1.KnativeServiceTrait{
+ Trait: traitv1.Trait{
Enabled: pointer.Bool(false),
},
MinScale: pointer.Int(1),
@@ -166,8 +167,8 @@ func TestTraitHierarchyDecode(t *testing.T) {
}
env.Platform.ResyncStatusFullConfig()
- env.Integration.Spec.Traits.KnativeService = &v1.KnativeServiceTrait{
- Trait: v1.Trait{
+ env.Integration.Spec.Traits.KnativeService = &traitv1.KnativeServiceTrait{
+ Trait: traitv1.Trait{
Enabled: pointer.Bool(true),
},
MinScale: pointer.Int(5),
diff --git a/pkg/util/bindings/bindings_test.go b/pkg/util/bindings/bindings_test.go
index da1c6dd10..b8318de9e 100644
--- a/pkg/util/bindings/bindings_test.go
+++ b/pkg/util/bindings/bindings_test.go
@@ -29,6 +29,7 @@ import (
camelv1 "github.com/apache/camel-k/pkg/apis/camel/v1"
knativeapis "github.com/apache/camel-k/pkg/apis/camel/v1/knative"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
"github.com/apache/camel-k/pkg/util/test"
@@ -184,7 +185,7 @@ func TestBindings(t *testing.T) {
},
uri: "knative:endpoint/sink?ce.override.ce-type=mytype",
traits: camelv1.Traits{
- Knative: &camelv1.KnativeTrait{
+ Knative: &traitv1.KnativeTrait{
SinkBinding: pointer.Bool(false),
Configuration: asKnativeConfig("https://myurl/hey"),
},
diff --git a/pkg/util/bindings/knative_uri.go b/pkg/util/bindings/knative_uri.go
index 5bf7ce935..137fd22ee 100644
--- a/pkg/util/bindings/knative_uri.go
+++ b/pkg/util/bindings/knative_uri.go
@@ -25,6 +25,7 @@ import (
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
knativeapis "github.com/apache/camel-k/pkg/apis/camel/v1/knative"
+ traitv1 "github.com/apache/camel-k/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
"github.com/apache/camel-k/pkg/util/uri"
)
@@ -83,7 +84,7 @@ func (k KnativeURIBindingProvider) Translate(ctx BindingContext, endpointCtx End
return &Binding{
URI: serviceURI,
Traits: v1.Traits{
- Knative: &v1.KnativeTrait{
+ Knative: &traitv1.KnativeTrait{
Configuration: config,
SinkBinding: pointer.Bool(false),
},
[camel-k] 08/14: fix(trait): fix addon handling at kamel run
Posted by ts...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tsato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit d3c4cfe7d1ce8088e1ea073af11a186a99081b96
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Fri Jul 1 00:29:46 2022 +0900
fix(trait): fix addon handling at kamel run
---
pkg/cmd/run.go | 2 --
pkg/cmd/trait_support.go | 41 +++++++++++++++++++++++++++++++----------
2 files changed, 31 insertions(+), 12 deletions(-)
diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go
index bb5ff353c..a37ac19cd 100644
--- a/pkg/cmd/run.go
+++ b/pkg/cmd/run.go
@@ -75,8 +75,6 @@ import (
"github.com/apache/camel-k/pkg/util/watch"
)
-var traitConfigRegexp = regexp.MustCompile(`^([a-z0-9-]+)((?:\.[a-z0-9-]+)(?:\[[0-9]+\]|\.[A-Za-z0-9-_]+)*)=(.*)$`)
-
func newCmdRun(rootCmdOptions *RootCmdOptions) (*cobra.Command, *runCmdOptions) {
options := runCmdOptions{
RootCmdOptions: rootCmdOptions,
diff --git a/pkg/cmd/trait_support.go b/pkg/cmd/trait_support.go
index e36ae09aa..6e8abfa22 100644
--- a/pkg/cmd/trait_support.go
+++ b/pkg/cmd/trait_support.go
@@ -22,6 +22,7 @@ import (
"errors"
"fmt"
"reflect"
+ "regexp"
"strings"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
@@ -30,6 +31,13 @@ import (
"github.com/mitchellh/mapstructure"
)
+type optionMap map[string]map[string]interface{}
+
+// The list of known addons is used for handling backward compatibility.
+var knownAddons = []string{"keda", "master", "strimzi", "3scale", "tracing"}
+
+var traitConfigRegexp = regexp.MustCompile(`^([a-z0-9-]+)((?:\.[a-z0-9-]+)(?:\[[0-9]+\]|\.[A-Za-z0-9-_]+)*)=(.*)$`)
+
func validateTraits(catalog *trait.Catalog, traits []string) error {
tp := catalog.ComputeTraitsProperties()
for _, t := range traits {
@@ -52,6 +60,20 @@ func configureTraits(options []string, traits interface{}, catalog trait.Finder)
return err
}
+ //
+ // Known addons need to be put aside here, as otherwise the deprecated addon fields on
+ // Traits might be accidentally populated. The deprecated addon fields are preserved
+ // for backward compatibility and should be populated only when the operator reads
+ // existing CRs from the API server.
+ //
+ addons := make(optionMap)
+ for _, id := range knownAddons {
+ if config[id] != nil {
+ addons[id] = config[id]
+ delete(config, id)
+ }
+ }
+
md := mapstructure.Metadata{}
decoder, err := mapstructure.NewDecoder(
&mapstructure.DecoderConfig{
@@ -69,21 +91,20 @@ func configureTraits(options []string, traits interface{}, catalog trait.Finder)
return err
}
- if len(md.Unused) == 0 {
- // No addons found
- return nil
- }
-
- addons := make(map[string]map[string]interface{})
- for _, id := range md.Unused {
+ // in case there are unknown addons
+ for _, prop := range md.Unused {
+ id := strings.Split(prop, ".")[0]
addons[id] = config[id]
}
+ if len(addons) == 0 {
+ return nil
+ }
return configureAddons(addons, traits, catalog)
}
-func optionsToMap(options []string) (map[string]map[string]interface{}, error) {
- optionMap := make(map[string]map[string]interface{})
+func optionsToMap(options []string) (optionMap, error) {
+ optionMap := make(optionMap)
for _, option := range options {
parts := traitConfigRegexp.FindStringSubmatch(option)
@@ -130,7 +151,7 @@ func optionsToMap(options []string) (map[string]map[string]interface{}, error) {
return optionMap, nil
}
-func configureAddons(config map[string]map[string]interface{}, traits interface{}, catalog trait.Finder) error {
+func configureAddons(config optionMap, traits interface{}, catalog trait.Finder) error {
// Addon traits require raw message mapping
addons := make(map[string]v1.AddonTrait)
for id, props := range config {
[camel-k] 11/14: fix(digest): fix hash computation for the new Traits schema
Posted by ts...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tsato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 4e909c8b075d8318a471893011e76136427b24bd
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Sun Jul 3 23:04:28 2022 +0900
fix(digest): fix hash computation for the new Traits schema
---
pkg/util/digest/digest.go | 82 +++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 79 insertions(+), 3 deletions(-)
diff --git a/pkg/util/digest/digest.go b/pkg/util/digest/digest.go
index cdeee2834..1ddda2059 100644
--- a/pkg/util/digest/digest.go
+++ b/pkg/util/digest/digest.go
@@ -25,6 +25,7 @@ import (
"encoding/base64"
"encoding/json"
"fmt"
+ "hash"
"io"
"path"
"sort"
@@ -98,12 +99,29 @@ func ComputeForIntegration(integration *v1.Integration) (string, error) {
}
// Integration traits
- traits, err := json.Marshal(integration.Spec.Traits)
+ // Calculation logic prior to 1.10.0 (the new Traits API schema) is maintained
+ // in order to keep consistency in the digest calculated from the same set of
+ // Trait configurations for backward compatibility.
+ traitsMap, err := toMap(integration.Spec.Traits)
if err != nil {
return "", err
}
- if _, err := hash.Write(traits); err != nil {
- return "", err
+ for _, name := range sortedTraitsMapKeys(traitsMap) {
+ if name != "addons" {
+ if err := computeForTrait(hash, name, traitsMap[name]); err != nil {
+ return "", err
+ }
+ } else {
+ // Addons
+ addons := traitsMap["addons"]
+ for _, name := range util.SortedMapKeys(addons) {
+ if addon, ok := addons[name].(map[string]interface{}); ok {
+ if err := computeForTrait(hash, name, addon); err != nil {
+ return "", err
+ }
+ }
+ }
+ }
}
// Integration traits as annotations
for _, k := range sortedTraitAnnotationsKeys(integration) {
@@ -118,6 +136,53 @@ func ComputeForIntegration(integration *v1.Integration) (string, error) {
return digest, nil
}
+func computeForTrait(hash hash.Hash, name string, trait map[string]interface{}) error {
+ if _, err := hash.Write([]byte(name + "[")); err != nil {
+ return err
+ }
+ // hash legacy configuration first
+ if trait["configuration"] != nil {
+ if config, ok := trait["configuration"].(map[string]interface{}); ok {
+ if err := computeForTraitProps(hash, config); err != nil {
+ return err
+ }
+ }
+ delete(trait, "configuration")
+ }
+ if err := computeForTraitProps(hash, trait); err != nil {
+ return err
+ }
+ if _, err := hash.Write([]byte("]")); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func computeForTraitProps(hash hash.Hash, props map[string]interface{}) error {
+ for _, prop := range util.SortedMapKeys(props) {
+ val := props[prop]
+ if _, err := hash.Write([]byte(fmt.Sprintf("%s=%v,", prop, val))); err != nil {
+ return err
+ }
+ }
+
+ return nil
+}
+
+func toMap(traits v1.Traits) (map[string]map[string]interface{}, error) {
+ data, err := json.Marshal(traits)
+ if err != nil {
+ return nil, err
+ }
+ traitsMap := make(map[string]map[string]interface{})
+ if err = json.Unmarshal(data, &traitsMap); err != nil {
+ return nil, err
+ }
+
+ return traitsMap, nil
+}
+
// ComputeForIntegrationKit a digest of the fields that are relevant for the deployment
// Produces a digest that can be used as docker image tag.
func ComputeForIntegrationKit(kit *v1.IntegrationKit) (string, error) {
@@ -216,6 +281,17 @@ func ComputeForSource(s v1.SourceSpec) (string, error) {
return digest, nil
}
+func sortedTraitsMapKeys(m map[string]map[string]interface{}) []string {
+ res := make([]string, len(m))
+ i := 0
+ for k := range m {
+ res[i] = k
+ i++
+ }
+ sort.Strings(res)
+ return res
+}
+
func sortedTraitAnnotationsKeys(it *v1.Integration) []string {
res := make([]string, 0, len(it.Annotations))
for k := range it.Annotations {