Skip to content

Commit b4ed715

Browse files
committed
feat(api): clone Kamelet type
Closes #5854
1 parent 2e43d9d commit b4ed715

File tree

5 files changed

+38
-6
lines changed

5 files changed

+38
-6
lines changed

e2e/support/test_support.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2723,7 +2723,7 @@ func CreateKameletWithID(t *testing.T, operatorID string, ctx context.Context, n
27232723
},
27242724
}
27252725

2726-
kamelet.SetOperatorID(operatorID)
2726+
v1.SetAnnotation(&kamelet.ObjectMeta, v1.OperatorIDAnnotation, operatorID)
27272727
return TestClient(t).Create(ctx, &kamelet)
27282728
}
27292729
}

pkg/apis/camel/v1/kamelet_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ See the License for the specific language governing permissions and
1515
limitations under the License.
1616
*/
1717

18+
// DO NOT EDIT: this file was automatically copied from apache/camel-kamelets/crds project
1819
package v1
1920

2021
import (

pkg/apis/camel/v1/kamelet_types_support.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ See the License for the specific language governing permissions and
1515
limitations under the License.
1616
*/
1717

18+
// DO NOT EDIT: this file was automatically copied from apache/camel-kamelets/crds project
1819
package v1
1920

2021
import (
@@ -211,11 +212,6 @@ func NewKameletList() KameletList {
211212
}
212213
}
213214

214-
// SetOperatorID sets the given operator id as an annotation.
215-
func (k *Kamelet) SetOperatorID(operatorID string) {
216-
SetAnnotation(&k.ObjectMeta, OperatorIDAnnotation, operatorID)
217-
}
218-
219215
// CloneWithVersion clones a Kamelet and set the main specification with any version provided.
220216
// It also changes the name adding a suffix with the version provided.
221217
func (k *Kamelet) CloneWithVersion(version string) (*Kamelet, error) {

script/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ codegen:
218218
generate: codegen-tools-install
219219
@# We better force the developer to generate all the resources everytime as
220220
@# it happens we tend to forget some code generation in the past
221+
./script/clone_kamelets.sh
221222
./script/gen_client.sh
222223
./script/gen_crd.sh
223224
./script/gen_doc.sh

script/clone_kamelets.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/sh
2+
3+
# Licensed to the Apache Software Foundation (ASF) under one or more
4+
# contributor license agreements. See the NOTICE file distributed with
5+
# this work for additional information regarding copyright ownership.
6+
# The ASF licenses this file to You under the Apache License, Version 2.0
7+
# (the "License"); you may not use this file except in compliance with
8+
# the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
18+
location=$(dirname $0)
19+
20+
GO111MODULE=on
21+
22+
# Entering the api module
23+
cd $location/../pkg/apis/camel/v1
24+
25+
echo "Cloning Kamelets from apache-kamelets repository..."
26+
27+
# TODO: use a fixed tag instad of main starting from apache kamelets 4.15.0 release
28+
wget -q -O kamelet_types.go https://raw.githubusercontent.com/apache/camel-kamelets/refs/heads/main/crds/pkg/apis/camel/v1/kamelet_types.go
29+
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
30+
31+
# Add a short autogen comment here
32+
comment="// DO NOT EDIT: this file was automatically copied from apache/camel-kamelets/crds project"
33+
sed -i "/^package v1/i $comment" kamelet_types.go
34+
sed -i "/^package v1/i $comment" kamelet_types_support.go

0 commit comments

Comments
 (0)