Skip to content

Commit

Permalink
chore: more replacements
Browse files Browse the repository at this point in the history
  • Loading branch information
squakez committed Apr 5, 2023
1 parent 71435d8 commit 3102ddf
Show file tree
Hide file tree
Showing 21 changed files with 105 additions and 94 deletions.
2 changes: 1 addition & 1 deletion addons/keda/keda.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func (t *kedaTrait) hackControllerReplicas(e *trait.Environment) error {
}
if ctrlRef.Kind == camelv1.PipeKind {
scale.ObjectMeta.Name = ctrlRef.Name
_, err = scalesClient.Scales(e.Integration.Namespace).Update(e.Ctx, camelv1.SchemeGroupVersion.WithResource("bindings").GroupResource(), &scale, metav1.UpdateOptions{})
_, err = scalesClient.Scales(e.Integration.Namespace).Update(e.Ctx, camelv1.SchemeGroupVersion.WithResource("pipes").GroupResource(), &scale, metav1.UpdateOptions{})
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion addons/keda/keda_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,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, camelv1.SchemeGroupVersion.WithResource("bindings").GroupResource(), "my-klb", metav1.GetOptions{})
sc, err := scalesClient.Scales("test").Get(env.Ctx, camelv1.SchemeGroupVersion.WithResource("pipes").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 config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ resources:
- bases/camel.apache.org_integrations.yaml
- bases/camel.apache.org_kamelets.yaml
- bases/camel.apache.org_kameletbindings.yaml
- bases/camel.apache.org_bindings.yaml
- bases/camel.apache.org_pipes.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-03-30T11:22:34Z
createdAt: 2023-04-05T11:19:26Z
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: Binding is the Schema for the binding API
displayName: Binding
kind: Binding
name: bindings.camel.apache.org
- description: Pipe is the Schema for the pipes API
displayName: Pipe
kind: BindPipe
name: pipes.camel.apache.org
version: v1alpha1
- description: Kamelet is the Schema for the kamelets API
displayName: Kamelet
Expand Down
3 changes: 2 additions & 1 deletion config/rbac/openshift/operator-role-openshift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ rules:
- integrationkits/finalizers
- integrationplatforms/finalizers
- integrations/finalizers
- bindings/finalizers
- pipes/finalizers
- kameletbindings/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
- bindings
- pipes
# Deprecated: kameletbindings CR
- kameletbindings
- kamelets
Expand All @@ -56,8 +56,8 @@ rules:
- integrationplatforms/status
- integrations/scale
- integrations/status
- bindings/status
- bindings/scale
- pipes/status
- pipes/scale
# Deprecated: kameletbindings CR
- kameletbindings/status
- kameletbindings/scale
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
- bindings
- pipes
# Deprecated: kameletbindings CR
- kameletbindings
- kamelets
Expand All @@ -55,8 +55,8 @@ rules:
- integrationplatforms/status
- integrations/scale
- integrations/status
- bindings/scale
- bindings/status
- pipes/scale
- pipes/status
# Deprecated: kameletbindings CR
- kameletbindings/scale
- kameletbindings/status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,20 @@
# limitations under the License.
# ---------------------------------------------------------------------------

apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
name: example
spec:
source:
ref:
apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
name: example
properties:
message: Hello world
sink:
ref:
apiVersion: messaging.knative.dev/v1
kind: InMemoryChannel
name: example
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# ---------------------------------------------------------------------------

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

patchesStrategicMerge:
- patch-integration-platform.yaml
4 changes: 2 additions & 2 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
*** xref:observability/monitoring/operator.adoc[Operator]
*** xref:observability/monitoring/integration.adoc[Integration]
* Scaling
** xref:scaling/integration.adoc[Integration]
** xref:scaling/binding.adoc[Binding]
** xref:scaling/integration.adoc[Integrations]
** xref:scaling/binding.adoc[Pipes]
* xref:traits:traits.adoc[Traits]
// Start of autogenerated code - DO NOT EDIT! (trait-nav)
** xref:traits:3scale.adoc[3Scale]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[[bindings-error-handler]]
=Bindings Error Handler
=Pipes Error Handler

Bindings offer a mechanism to specify an error policy to adopt in case an event produced by a `source` or consumed by a `sink`. Through the definition of an `errorHandler` you will be able to apply certain logic to the failing event, such as simply logging, ignoring the event or posting the event to a `Sink`.
Pipes offer a mechanism to specify an error policy to adopt in case an event produced by a `source` or consumed by a `sink`. Through the definition of an `errorHandler` you will be able to apply certain logic to the failing event, such as simply logging, ignoring the event or posting the event to a `Sink`.

[source,yaml]
----
apiVersion: camel.apache.org/v1alpha1
kind: Binding
kind: Pipe
metadata:
name: my-kamelet-binding
spec:
Expand All @@ -33,7 +33,7 @@ There may be certain cases where you want to just ignore any failure happening o
[source,yaml]
----
apiVersion: camel.apache.org/v1alpha1
kind: Binding
kind: Pipe
metadata:
name: my-kamelet-binding
spec:
Expand All @@ -54,7 +54,7 @@ Apache Camel offers a default behavior for handling any failure: log to standard
[source,yaml]
----
apiVersion: camel.apache.org/v1alpha1
kind: Binding
kind: Pipe
metadata:
name: my-kamelet-binding
spec:
Expand All @@ -78,7 +78,7 @@ The `Sink` is probably the most interesting error handler type as it allows you
[source,yaml]
----
apiVersion: camel.apache.org/v1alpha1
kind: Binding
kind: Pipe
metadata:
name: my-kamelet-binding
spec:
Expand Down
26 changes: 13 additions & 13 deletions docs/modules/ROOT/pages/kamelets/kamelets-dev.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ spec:
- to: "kamelet:sink"
----
<1> An icon with an appropriate license, better using svg+base64 URL encoding. You can encode icons using services like https://dopiaza.org/tools/datauri/index.php[this one]
<2> The dataTypes section indicates that the Kamelet is going to produce JSON data as a default. The Kamelet is able to define multiple data types for in/out/error. The user will then be able to choose on of the data types in a Binding when referencing the Kamelet.
<2> The dataTypes section indicates that the Kamelet is going to produce JSON data as a default. The Kamelet is able to define multiple data types for in/out/error. The user will then be able to choose on of the data types in a Pipe when referencing the Kamelet.
<3> The previous YAML flow

The Kamelet can be shared on the Catalog and or created on a Kubernetes cluster to let users use it.
Expand All @@ -294,7 +294,7 @@ Then you can create a binding like the following one to try it out:
[source,yaml]
----
apiVersion: camel.apache.org/v1alpha1
kind: Binding
kind: Pipe
metadata:
name: twitter-search-source-binding
spec:
Expand Down Expand Up @@ -867,7 +867,7 @@ spec:
----
<1> Add an icon with an appropriate license, better using svg+base64 URL encoding. You can encode icons using services like https://dopiaza.org/tools/datauri/index.php[this one]
<2> This marks the Kamelet as dependant on Quarkus since we're specifying explicit dependencies on Quarkus artifacts in the `spec` -> `dependencies` section
<3> The types section indicates that the Kamelet is going to produce JSON data by default. The Kamelet is able to define multiple data types for in/out/error. The user will then be able to choose on of the data types in a Binding when referencing the Kamelet.
<3> The types section indicates that the Kamelet is going to produce JSON data by default. The Kamelet is able to define multiple data types for in/out/error. The user will then be able to choose on of the data types in a Pipe when referencing the Kamelet.
<4> Dependencies that we previously specified in the modeline options should be expressed now in the Kamelet spec

The Kamelet is now ready to be used!
Expand All @@ -893,7 +893,7 @@ To check if it works, you can create a simple binding:
[source,yaml]
----
apiVersion: camel.apache.org/v1alpha1
kind: Binding
kind: Pipe
metadata:
name: earthquake-source-binding
spec:
Expand Down Expand Up @@ -1217,7 +1217,7 @@ So, for example, to send a text message to a chat, we may create a binding like
[source,yaml]
----
apiVersion: camel.apache.org/v1alpha1
kind: Binding
kind: Pipe
metadata:
name: telegram-text-binding
spec:
Expand Down Expand Up @@ -1261,7 +1261,7 @@ To check if we can also receive pictures using the above Kamelet, we can create
[source,yaml]
----
apiVersion: camel.apache.org/v1alpha1
kind: Binding
kind: Pipe
metadata:
name: telegram-image-binding
spec:
Expand Down Expand Up @@ -1314,16 +1314,16 @@ Feature: Kamelet earthquake-source works
Scenario: Bind Kamelet to service
Given create Kubernetes service test-service with target port 8080
And bind Kamelet earthquake-source to uri http://test-service.${YAKS_NAMESPACE}.svc.cluster.local/test
When create Binding earthquake-source-uri
Then Binding earthquake-source-uri should be available
When create Pipe earthquake-source-uri
Then Pipe earthquake-source-uri should be available
And Camel K integration earthquake-source-uri should be running
Scenario: Verify binding
Given HTTP server "test-service"
And HTTP server timeout is 120000 ms
Then expect HTTP request header: Content-Type="application/json;charset=UTF-8"
And receive POST /test
And delete Binding earthquake-source-uri
And delete Pipe earthquake-source-uri
----

As you see this is a declarative test that is materialized into something that actually checks that the service generates some data.
Expand Down Expand Up @@ -1356,7 +1356,7 @@ send data to it via HTTP. Let's create a parameterized binding like the followin
[source,yaml]
----
apiVersion: camel.apache.org/v1alpha1
kind: Binding
kind: Pipe
metadata:
name: webhook-to-telegram
spec:
Expand Down Expand Up @@ -1406,8 +1406,8 @@ Feature: Kamelet telegram-sink works
Scenario: Bind webhook to Kamelet sink
Given load variables telegram-credentials.properties
And load Binding webhook-to-telegram.yaml
Then Binding webhook-to-telegram should be available
And load Pipe webhook-to-telegram.yaml
Then Pipe webhook-to-telegram should be available
And Camel K integration webhook-to-telegram should be running
Expand All @@ -1423,7 +1423,7 @@ Feature: Kamelet telegram-sink works
"""
When send POST /message
Then receive HTTP 200 OK
And delete Binding webhook-to-telegram
And delete Pipe webhook-to-telegram
----

Expand Down
Loading

0 comments on commit 3102ddf

Please sign in to comment.