This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 1a9395db3f9ed3c7f207e16c06428d2c908af6e2
Author: Antonin Stefanutti <[email protected]>
AuthorDate: Wed Jun 10 09:05:23 2020 +0200

    fix(api): Use RawMessage for Camel Flow
    
    Interface members are not supported by controller-tools that's used
    for generating CRDs.
    See https://github.com/kubernetes-sigs/controller-tools/pull/126
---
 pkg/apis/camel/v1/common_types.go          | 14 +++-----------
 pkg/apis/camel/v1/zz_generated.deepcopy.go | 20 +++++++++++++++++---
 2 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/pkg/apis/camel/v1/common_types.go 
b/pkg/apis/camel/v1/common_types.go
index 2dcdcc1..83ecb90 100644
--- a/pkg/apis/camel/v1/common_types.go
+++ b/pkg/apis/camel/v1/common_types.go
@@ -18,9 +18,10 @@ limitations under the License.
 package v1
 
 import (
+       "encoding/json"
+
        corev1 "k8s.io/api/core/v1"
        metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-       "k8s.io/apimachinery/pkg/runtime"
 )
 
 // ConfigurationSpec --
@@ -133,13 +134,4 @@ type ResourceCondition interface {
 }
 
 // Flow is an unstructured object representing a Camel Flow in YAML/JSON DSL
-type Flow map[string]interface{}
-
-// DeepCopy copies the receiver, creating a new Flow.
-func (in *Flow) DeepCopy() *Flow {
-       if in == nil {
-               return nil
-       }
-       out := Flow(runtime.DeepCopyJSON(*in))
-       return &out
-}
+type Flow json.RawMessage
diff --git a/pkg/apis/camel/v1/zz_generated.deepcopy.go 
b/pkg/apis/camel/v1/zz_generated.deepcopy.go
index 86c4a06..48e1812 100644
--- a/pkg/apis/camel/v1/zz_generated.deepcopy.go
+++ b/pkg/apis/camel/v1/zz_generated.deepcopy.go
@@ -618,12 +618,22 @@ func (in *FailureRecovery) DeepCopy() *FailureRecovery {
 func (in Flow) DeepCopyInto(out *Flow) {
        {
                in := &in
-               clone := in.DeepCopy()
-               *out = *clone
+               *out = make(Flow, len(*in))
+               copy(*out, *in)
                return
        }
 }
 
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, 
creating a new Flow.
+func (in Flow) DeepCopy() Flow {
+       if in == nil {
+               return nil
+       }
+       out := new(Flow)
+       in.DeepCopyInto(out)
+       return *out
+}
+
 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, 
writing into out. in must be non-nil.
 func (in *ImageTask) DeepCopyInto(out *ImageTask) {
        *out = *in
@@ -1094,7 +1104,11 @@ func (in *IntegrationSpec) DeepCopyInto(out 
*IntegrationSpec) {
                in, out := &in.Flows, &out.Flows
                *out = make([]Flow, len(*in))
                for i := range *in {
-                       (*in)[i].DeepCopyInto(&(*out)[i])
+                       if (*in)[i] != nil {
+                               in, out := &(*in)[i], &(*out)[i]
+                               *out = make(Flow, len(*in))
+                               copy(*out, *in)
+                       }
                }
        }
        if in.Resources != nil {

Reply via email to