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

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


The following commit(s) were added to refs/heads/main by this push:
     new b4ed71507 feat(api): clone Kamelet type
b4ed71507 is described below

commit b4ed71507de1186e37d89f4960d19260cc686919
Author: Pasquale Congiusti <[email protected]>
AuthorDate: Mon Sep 15 21:23:30 2025 +0200

    feat(api): clone Kamelet type
    
    Closes #5854
---
 e2e/support/test_support.go                |  2 +-
 pkg/apis/camel/v1/kamelet_types.go         |  1 +
 pkg/apis/camel/v1/kamelet_types_support.go |  6 +-----
 script/Makefile                            |  1 +
 script/clone_kamelets.sh                   | 34 ++++++++++++++++++++++++++++++
 5 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/e2e/support/test_support.go b/e2e/support/test_support.go
index 26ce7a478..04fb40c12 100644
--- a/e2e/support/test_support.go
+++ b/e2e/support/test_support.go
@@ -2723,7 +2723,7 @@ func CreateKameletWithID(t *testing.T, operatorID string, 
ctx context.Context, n
                        },
                }
 
-               kamelet.SetOperatorID(operatorID)
+               v1.SetAnnotation(&kamelet.ObjectMeta, v1.OperatorIDAnnotation, 
operatorID)
                return TestClient(t).Create(ctx, &kamelet)
        }
 }
diff --git a/pkg/apis/camel/v1/kamelet_types.go 
b/pkg/apis/camel/v1/kamelet_types.go
index 3a571d462..be31072c3 100644
--- a/pkg/apis/camel/v1/kamelet_types.go
+++ b/pkg/apis/camel/v1/kamelet_types.go
@@ -15,6 +15,7 @@ See the License for the specific language governing 
permissions and
 limitations under the License.
 */
 
+// DO NOT EDIT: this file was automatically copied from 
apache/camel-kamelets/crds project
 package v1
 
 import (
diff --git a/pkg/apis/camel/v1/kamelet_types_support.go 
b/pkg/apis/camel/v1/kamelet_types_support.go
index bbcc42a5d..24267b6c2 100644
--- a/pkg/apis/camel/v1/kamelet_types_support.go
+++ b/pkg/apis/camel/v1/kamelet_types_support.go
@@ -15,6 +15,7 @@ See the License for the specific language governing 
permissions and
 limitations under the License.
 */
 
+// DO NOT EDIT: this file was automatically copied from 
apache/camel-kamelets/crds project
 package v1
 
 import (
@@ -211,11 +212,6 @@ func NewKameletList() KameletList {
        }
 }
 
-// SetOperatorID sets the given operator id as an annotation.
-func (k *Kamelet) SetOperatorID(operatorID string) {
-       SetAnnotation(&k.ObjectMeta, OperatorIDAnnotation, operatorID)
-}
-
 // CloneWithVersion clones a Kamelet and set the main specification with any 
version provided.
 // It also changes the name adding a suffix with the version provided.
 func (k *Kamelet) CloneWithVersion(version string) (*Kamelet, error) {
diff --git a/script/Makefile b/script/Makefile
index 5b8a3ca78..4175f33e8 100644
--- a/script/Makefile
+++ b/script/Makefile
@@ -218,6 +218,7 @@ codegen:
 generate: codegen-tools-install
        @# We better force the developer to generate all the resources 
everytime as
        @# it happens we tend to forget some code generation in the past
+       ./script/clone_kamelets.sh
        ./script/gen_client.sh
        ./script/gen_crd.sh
        ./script/gen_doc.sh
diff --git a/script/clone_kamelets.sh b/script/clone_kamelets.sh
new file mode 100755
index 000000000..f597a365a
--- /dev/null
+++ b/script/clone_kamelets.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# 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.
+
+location=$(dirname $0)
+
+GO111MODULE=on
+
+# Entering the api module
+cd $location/../pkg/apis/camel/v1
+
+echo "Cloning Kamelets from apache-kamelets repository..."
+
+# TODO: use a fixed tag instad of main starting from apache kamelets 4.15.0 
release
+wget -q -O kamelet_types.go  
https://raw.githubusercontent.com/apache/camel-kamelets/refs/heads/main/crds/pkg/apis/camel/v1/kamelet_types.go
+wget -q -O kamelet_types_support.go  
https://raw.githubusercontent.com/apache/camel-kamelets/refs/heads/main/crds/pkg/apis/camel/v1/kamelet_types_support.go
+
+# Add a short autogen comment here
+comment="// DO NOT EDIT: this file was automatically copied from 
apache/camel-kamelets/crds project"
+sed -i "/^package v1/i $comment" kamelet_types.go
+sed -i "/^package v1/i $comment" kamelet_types_support.go
\ No newline at end of file

Reply via email to