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 <[email protected]>
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 {

Reply via email to