Skip to content

Commit

Permalink
feat: change KameletBinding name to Binding
Browse files Browse the repository at this point in the history
  • Loading branch information
squakez committed Apr 26, 2023
1 parent 72f0366 commit e8e73fa
Show file tree
Hide file tree
Showing 107 changed files with 10,303 additions and 1,754 deletions.
2 changes: 1 addition & 1 deletion .github/actions/kamel-cleanup/clean-orphan-resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set +e

resourcetypes="integrations integrationkits integrationplatforms camelcatalogs kamelets builds kameletbindings"
resourcetypes="integrations integrationkits integrationplatforms camelcatalogs kamelets builds bindings"

#
# Loop through the resource types
Expand Down
2 changes: 1 addition & 1 deletion PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ resources:
kind: Integration
version: v1
- group: camel
kind: KameletBinding
kind: Binding
version: v1alpha1
- group: camel
kind: Kamelet
Expand Down
6 changes: 3 additions & 3 deletions addons/keda/keda.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,9 @@ func (t *kedaTrait) hackControllerReplicas(e *trait.Environment) error {
if err != nil {
return err
}
if ctrlRef.Kind == camelv1alpha1.KameletBindingKind {
if ctrlRef.Kind == camelv1alpha1.BindingKind {
scale.ObjectMeta.Name = ctrlRef.Name
_, err = scalesClient.Scales(e.Integration.Namespace).Update(e.Ctx, camelv1alpha1.SchemeGroupVersion.WithResource("kameletbindings").GroupResource(), &scale, metav1.UpdateOptions{})
_, err = scalesClient.Scales(e.Integration.Namespace).Update(e.Ctx, camelv1alpha1.SchemeGroupVersion.WithResource("bindings").GroupResource(), &scale, metav1.UpdateOptions{})
if err != nil {
return err
}
Expand All @@ -297,7 +297,7 @@ func (t *kedaTrait) hackControllerReplicas(e *trait.Environment) error {

func (t *kedaTrait) getTopControllerReference(e *trait.Environment) *v1.ObjectReference {
for _, o := range e.Integration.OwnerReferences {
if o.Kind == camelv1alpha1.KameletBindingKind && strings.HasPrefix(o.APIVersion, camelv1alpha1.SchemeGroupVersion.Group) {
if o.Kind == camelv1alpha1.BindingKind && strings.HasPrefix(o.APIVersion, camelv1alpha1.SchemeGroupVersion.Group) {
return &v1.ObjectReference{
APIVersion: o.APIVersion,
Kind: o.Kind,
Expand Down
16 changes: 8 additions & 8 deletions addons/keda/keda_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/apache/camel-k/v2/addons/keda/duck/v1alpha1"
camelv1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
camelv1alpha1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1alpha1"
"github.com/apache/camel-k/v2/pkg/controller/kameletbinding"
"github.com/apache/camel-k/v2/pkg/controller/binding"
"github.com/apache/camel-k/v2/pkg/trait"
"github.com/apache/camel-k/v2/pkg/util/camel"
"github.com/apache/camel-k/v2/pkg/util/kubernetes"
Expand Down Expand Up @@ -203,16 +203,16 @@ func TestKameletAutoDetection(t *testing.T) {
assert.Contains(t, secret.StringData, "cc")
}

func TestKameletBindingAutoDetection(t *testing.T) {
func TestBindingAutoDetection(t *testing.T) {
keda, _ := NewKedaTrait().(*kedaTrait)
keda.Enabled = pointer.Bool(true)
logEndpoint := "log:info"
klb := camelv1alpha1.KameletBinding{
klb := camelv1alpha1.Binding{
ObjectMeta: metav1.ObjectMeta{
Namespace: "test",
Name: "my-binding",
},
Spec: camelv1alpha1.KameletBindingSpec{
Spec: camelv1alpha1.BindingSpec{
Source: camelv1alpha1.Endpoint{
Ref: &corev1.ObjectReference{
Kind: "Kamelet",
Expand Down Expand Up @@ -277,7 +277,7 @@ func TestKameletBindingAutoDetection(t *testing.T) {
},
})

it, err := kameletbinding.CreateIntegrationFor(env.Ctx, env.Client, &klb)
it, err := binding.CreateIntegrationFor(env.Ctx, env.Client, &klb)
assert.NoError(t, err)
assert.NotNil(t, it)
env.Integration = it
Expand Down Expand Up @@ -362,7 +362,7 @@ func TestHackKLBReplicas(t *testing.T) {
})
keda.HackControllerReplicas = pointer.Bool(true)
env := createBasicTestEnvironment(
&camelv1alpha1.KameletBinding{
&camelv1alpha1.Binding{
ObjectMeta: metav1.ObjectMeta{
Namespace: "test",
Name: "my-klb",
Expand All @@ -375,7 +375,7 @@ func TestHackKLBReplicas(t *testing.T) {
OwnerReferences: []metav1.OwnerReference{
{
APIVersion: camelv1alpha1.SchemeGroupVersion.String(),
Kind: "KameletBinding",
Kind: "Binding",
Name: "my-klb",
},
},
Expand All @@ -392,7 +392,7 @@ func TestHackKLBReplicas(t *testing.T) {
assert.NoError(t, keda.Apply(env))
scalesClient, err := env.Client.ScalesClient()
assert.NoError(t, err)
sc, err := scalesClient.Scales("test").Get(env.Ctx, camelv1alpha1.SchemeGroupVersion.WithResource("kameletbindings").GroupResource(), "my-klb", metav1.GetOptions{})
sc, err := scalesClient.Scales("test").Get(env.Ctx, camelv1alpha1.SchemeGroupVersion.WithResource("bindings").GroupResource(), "my-klb", metav1.GetOptions{})
assert.NoError(t, err)
assert.Equal(t, int32(1), sc.Spec.Replicas)
}
Expand Down
2 changes: 1 addition & 1 deletion addons/strimzi/strimzi.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
)

// BindingProvider allows to connect to a Kafka topic via KameletBinding.
// BindingProvider allows to connect to a Kafka topic via Binding.
type BindingProvider struct {
Client internalclientset.Interface
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ metadata:
creationTimestamp: null
labels:
app: camel-k
name: kameletbindings.camel.apache.org
name: bindings.camel.apache.org
spec:
group: camel.apache.org
names:
categories:
- kamel
- camel
kind: KameletBinding
listKind: KameletBindingList
plural: kameletbindings
kind: Binding
listKind: BindingList
plural: bindings
shortNames:
- klb
singular: kameletbinding
singular: binding
scope: Namespaced
versions:
- additionalPrinterColumns:
- description: The Kamelet Binding phase
- description: TheBinding phase
jsonPath: .status.phase
name: Phase
type: string
Expand All @@ -50,7 +50,7 @@ spec:
name: v1alpha1
schema:
openAPIV3Schema:
description: KameletBinding is the Schema for the kamelets binding API
description: Binding is the Schema for the kamelets binding API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand All @@ -65,7 +65,7 @@ spec:
metadata:
type: object
spec:
description: the specification of a KameletBinding
description: the specification of a Binding
properties:
errorHandler:
description: ErrorHandler is an optional handler called upon an error
Expand Down Expand Up @@ -8410,12 +8410,12 @@ spec:
type: array
type: object
status:
description: the status of a KameletBinding
description: the status of a Binding
properties:
conditions:
description: Conditions --
items:
description: KameletBindingCondition describes the state of a resource
description: BindingCondition describes the state of a resource
at a certain point.
properties:
lastTransitionTime:
Expand Down Expand Up @@ -8498,7 +8498,7 @@ spec:
description: Status of the condition, one of True, False, Unknown.
type: string
type:
description: Type of kameletBinding condition.
description: Type of binding condition.
type: string
required:
- status
Expand All @@ -8507,7 +8507,7 @@ spec:
type: array
observedGeneration:
description: ObservedGeneration is the most recent generation observed
for this KameletBinding.
for this Binding.
format: int64
type: integer
phase:
Expand Down
2 changes: 1 addition & 1 deletion config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ resources:
- bases/camel.apache.org_integrationkits.yaml
- bases/camel.apache.org_integrationplatforms.yaml
- bases/camel.apache.org_integrations.yaml
- bases/camel.apache.org_kameletbindings.yaml
- bases/camel.apache.org_bindings.yaml
- bases/camel.apache.org_kamelets.yaml
10 changes: 5 additions & 5 deletions config/manifests/bases/camel-k.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ metadata:
categories: Integration & Delivery
certified: "false"
containerImage: docker.io/apache/camel-k:2.0.0-SNAPSHOT
createdAt: 2023-04-03T16:32:08Z
createdAt: 2023-03-24T09:36:48Z
description: Apache Camel K is a lightweight integration platform, born on Kubernetes,
with serverless superpowers.
operators.operatorframework.io/builder: operator-sdk-v1.16.0
Expand Down Expand Up @@ -63,10 +63,10 @@ spec:
kind: Integration
name: integrations.camel.apache.org
version: v1
- description: KameletBinding is the Schema for the kamelets binding API
displayName: Kamelet Binding
kind: KameletBinding
name: kameletbindings.camel.apache.org
- description: Binding is the Schema for the kamelets binding API
displayName: Binding
kind: Binding
name: bindings.camel.apache.org
version: v1alpha1
- description: Kamelet is the Schema for the kamelets API
displayName: Kamelet
Expand Down
2 changes: 1 addition & 1 deletion config/rbac/openshift/operator-role-openshift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ rules:
- integrationkits/finalizers
- integrationplatforms/finalizers
- integrations/finalizers
- kameletbindings/finalizers
- bindings/finalizers
verbs:
- update
- apiGroups:
Expand Down
6 changes: 3 additions & 3 deletions config/rbac/operator-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ rules:
- integrationkits
- integrationplatforms
- integrations
- kameletbindings
- bindings
- kamelets
verbs:
- create
Expand All @@ -54,8 +54,8 @@ rules:
- integrationplatforms/status
- integrations/scale
- integrations/status
- kameletbindings/status
- kameletbindings/scale
- bindings/status
- bindings/scale
- kamelets/status
verbs:
- get
Expand Down
6 changes: 3 additions & 3 deletions config/rbac/user-cluster-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ rules:
- integrationkits
- integrationplatforms
- integrations
- kameletbindings
- bindings
- kamelets
verbs:
- create
Expand All @@ -53,8 +53,8 @@ rules:
- integrationplatforms/status
- integrations/scale
- integrations/status
- kameletbindings/scale
- kameletbindings/status
- bindings/scale
- bindings/status
- kamelets/status
verbs:
- get
Expand Down
2 changes: 1 addition & 1 deletion config/samples/bases/camel_v1_kameletbinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# ---------------------------------------------------------------------------

apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
kind: Binding
metadata:
name: example
spec:
Expand Down
2 changes: 1 addition & 1 deletion config/samples/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ resources:
- bases/camel_v1_camelcatalog.yaml
- bases/camel_v1_build.yaml
- bases/camel_v1_kamelet.yaml
- bases/camel_v1_kameletbinding.yaml
- bases/camel_v1_binding.yaml

patchesStrategicMerge:
- patch-integration-platform.yaml
Loading

0 comments on commit e8e73fa

Please sign in to comment.