Skip to content

Commit

Permalink
feat: remove deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
squakez committed May 8, 2023
1 parent fc94b7d commit 0e058d9
Show file tree
Hide file tree
Showing 42 changed files with 199 additions and 3,900 deletions.
512 changes: 0 additions & 512 deletions config/crd/bases/camel.apache.org_pipes.yaml

Large diffs are not rendered by default.

55 changes: 0 additions & 55 deletions docs/modules/ROOT/partials/apis/camel-k-crds.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,6 @@ the value to assign to the configuration (syntax may vary depending on the `Type
*Appears on:*
* <<#_camel_apache_org_v1_ResourceSpec, ResourceSpec>>
* <<#_camel_apache_org_v1_SourceSpec, SourceSpec>>
DataSpec represents the way the source is materialized in the running `Pod`
Expand Down Expand Up @@ -1514,14 +1513,6 @@ URI can be used to specify the (Camel) endpoint explicitly
Properties are a key value representation of endpoint properties
|`types` +
*xref:#_camel_apache_org_v1_EventTypeSpec[map[github.com/apache/camel-k/v2/pkg/apis/camel/v1.TypeSlot\]github.com/apache/camel-k/v2/pkg/apis/camel/v1.EventTypeSpec]*
|
Types defines the data type of the data produced/consumed by the endpoint and references a given data type specification.
Deprecated: In favor of using DataTypes
|`dataTypes` +
*xref:#_camel_apache_org_v1_DataTypeReference[map[github.com/apache/camel-k/v2/pkg/apis/camel/v1.TypeSlot\]github.com/apache/camel-k/v2/pkg/apis/camel/v1.DataTypeReference]*
|
Expand Down Expand Up @@ -1702,7 +1693,6 @@ ErrorHandlerType a type of error handler (ie, sink)
*Appears on:*
* <<#_camel_apache_org_v1_Endpoint, Endpoint>>
* <<#_camel_apache_org_v1_KameletSpec, KameletSpec>>
EventTypeSpec represents a specification for an event type
Expand Down Expand Up @@ -4394,51 +4384,6 @@ Your options are to `ignore`, `fail`, or `warn` on missing or incorrect checksum
ResourceCondition is a common type for all conditions
[#_camel_apache_org_v1_ResourceSpec]
=== ResourceSpec
ResourceSpec represent an attached resource which will be materialized as a file on the running `Pod`
TODO: we should deprecate in future releases in favour of mount, openapi or camel traits
[cols="2,2a",options="header"]
|===
|Field
|Description
|`DataSpec` +
*xref:#_camel_apache_org_v1_DataSpec[DataSpec]*
|(Members of `DataSpec` are embedded into this type.)
the content of the resource
|`type` +
*xref:#_camel_apache_org_v1_ResourceType[ResourceType]*
|
the kind of data to expect
|`mountPath` +
string
|
the mount path on destination `Pod`
|===
[#_camel_apache_org_v1_ResourceType]
=== ResourceType(`string` alias)
*Appears on:*
* <<#_camel_apache_org_v1_ResourceSpec, ResourceSpec>>
ResourceType defines a kind of resource
[#_camel_apache_org_v1_RuntimeProvider]
=== RuntimeProvider(`string` alias)
Expand Down
52 changes: 26 additions & 26 deletions e2e/common/misc/kamelet_binding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,16 @@ func TestPipe(t *testing.T) {
APIVersion: v1.SchemeGroupVersion.String(),
}

errorHandler := map[string]interface{}{
"sink": map[string]interface{}{
"endpoint": map[string]interface{}{
"ref": map[string]string{
"kind": "Kamelet",
"apiVersion": v1.SchemeGroupVersion.String(),
"name": "my-own-log-sink",
},
"properties": map[string]string{
"loggerName": "kameletErrorHandler",
},
}}}

t.Run("throw error test", func(t *testing.T) {
Expect(BindKameletToWithErrorHandler(ns, "throw-error-binding", map[string]string{},
from, to,
map[string]string{"message": "throw Error"}, map[string]string{"loggerName": "integrationLogger"},
errorHandler)()).To(Succeed())
Expect(KamelBind(ns,
from.Name,
to.Name,
"--error-handler", "sink:"+to.Name,
"-p", "source.message=throw Error",
"-p", "sink.loggerName=integrationLogger",
"-p", "error-handler.loggerName=kameletErrorHandler",
"--name", "throw-error-binding",
).Execute()).To(Succeed())

Eventually(IntegrationPodPhase(ns, "throw-error-binding"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
Eventually(IntegrationLogs(ns, "throw-error-binding"), TestTimeoutShort).Should(ContainSubstring("kameletErrorHandler"))
Expand All @@ -79,10 +71,15 @@ func TestPipe(t *testing.T) {
})

t.Run("don't throw error test", func(t *testing.T) {
Expect(BindKameletToWithErrorHandler(ns, "no-error-binding", map[string]string{},
from, to,
map[string]string{"message": "true"}, map[string]string{"loggerName": "integrationLogger"},
errorHandler)()).To(Succeed())
Expect(KamelBind(ns,
from.Name,
to.Name,
"--error-handler", "sink:"+to.Name,
"-p", "source.message=true",
"-p", "sink.loggerName=integrationLogger",
"-p", "error-handler.loggerName=kameletErrorHandler",
"--name", "no-error-binding",
).Execute()).To(Succeed())

Eventually(IntegrationPodPhase(ns, "no-error-binding"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
Eventually(IntegrationLogs(ns, "no-error-binding"), TestTimeoutShort).ShouldNot(ContainSubstring("kameletErrorHandler"))
Expand All @@ -108,11 +105,14 @@ func TestPipe(t *testing.T) {
APIVersion: v1.SchemeGroupVersion.String(),
}

Expect(BindKameletTo(ns, "kb-with-traits",
map[string]string{"trait.camel.apache.org/camel.properties": "[\"camel.prop1=a\",\"camel.prop2=b\"]"},
from, to,
map[string]string{"message": "hello from test"}, map[string]string{"loggerName": "integrationLogger"})()).
To(Succeed())
Expect(KamelBind(ns,
from.Name,
to.Name,
"-p", "source.message=hello from test",
"-p", "sink.loggerName=integrationLogger",
"--annotation", "trait.camel.apache.org/camel.properties=[\"camel.prop1=a\",\"camel.prop2=b\"]",
"--name", "kb-with-traits",
).Execute()).To(Succeed())

Eventually(IntegrationPodPhase(ns, "kb-with-traits"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
Eventually(IntegrationLogs(ns, "kb-with-traits"), TestTimeoutShort).Should(ContainSubstring("hello from test"))
Expand Down
47 changes: 24 additions & 23 deletions e2e/common/misc/kamelet_binding_with_image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,29 +49,22 @@ func TestPipeWithImage(t *testing.T) {
APIVersion: v1.SchemeGroupVersion.String(),
}

emptyMap := map[string]string{}

annotations1 := map[string]string{
"trait.camel.apache.org/container.image": "docker.io/jmalloc/echo-server:0.3.2",
"trait.camel.apache.org/jvm.enabled": "false",
"trait.camel.apache.org/kamelets.enabled": "false",
"trait.camel.apache.org/dependencies.enabled": "false",
"test": "1",
}
annotations2 := map[string]string{
"trait.camel.apache.org/container.image": "docker.io/jmalloc/echo-server:0.3.3",
"trait.camel.apache.org/jvm.enabled": "false",
"trait.camel.apache.org/kamelets.enabled": "false",
"trait.camel.apache.org/dependencies.enabled": "false",
"test": "2",
}
bindingID := "with-image-binding"

t.Run("run with initial image", func(t *testing.T) {
expectedImage := annotations1["trait.camel.apache.org/container.image"]
expectedImage := "docker.io/jmalloc/echo-server:0.3.2"

Expect(KamelBind(ns,
from.Name,
to.Name,
"--annotation", "trait.camel.apache.org/container.image="+expectedImage,
"--annotation", "trait.camel.apache.org/jvm.enabled=false",
"--annotation", "trait.camel.apache.org/kamelets.enabled=false",
"--annotation", "trait.camel.apache.org/dependencies.enabled=false",
"--annotation", "test=1",
"--name", bindingID,
).Execute()).To(Succeed())

Expect(BindKameletTo(ns, bindingID, annotations1, from, to, emptyMap, emptyMap)()).
To(Succeed())
Eventually(IntegrationGeneration(ns, bindingID)).
Should(gstruct.PointTo(BeNumerically("==", 1)))
Eventually(Integration(ns, bindingID)).Should(WithTransform(Annotations, And(
Expand All @@ -87,10 +80,18 @@ func TestPipeWithImage(t *testing.T) {
})

t.Run("run with new image", func(t *testing.T) {
expectedImage := annotations2["trait.camel.apache.org/container.image"]

Expect(BindKameletTo(ns, bindingID, annotations2, from, to, emptyMap, emptyMap)()).
To(Succeed())
expectedImage := "docker.io/jmalloc/echo-server:0.3.3"

Expect(KamelBind(ns,
from.Name,
to.Name,
"--annotation", "trait.camel.apache.org/container.image="+expectedImage,
"--annotation", "trait.camel.apache.org/jvm.enabled=false",
"--annotation", "trait.camel.apache.org/kamelets.enabled=false",
"--annotation", "trait.camel.apache.org/dependencies.enabled=false",
"--annotation", "test=2",
"--name", bindingID,
).Execute()).To(Succeed())
Eventually(IntegrationGeneration(ns, bindingID)).
Should(gstruct.PointTo(BeNumerically("==", 1)))
Eventually(Integration(ns, bindingID)).Should(WithTransform(Annotations, And(
Expand Down
28 changes: 11 additions & 17 deletions e2e/common/traits/health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,29 +150,23 @@ func TestHealthTrait(t *testing.T) {
APIVersion: camelv1.SchemeGroupVersion.String(),
}

fromParams := map[string]string{
"message": "Magicstring!",
}

to := corev1.ObjectReference{
Kind: "Kamelet",
Name: "my-own-log-sink",
APIVersion: camelv1.SchemeGroupVersion.String(),
}

toParams := map[string]string{
"loggerName": "binding",
}

annotations := map[string]string{
"trait.camel.apache.org/health.enabled": "true",
"trait.camel.apache.org/jolokia.enabled": "true",
"trait.camel.apache.org/jolokia.use-ssl-client-authentication": "false",
"trait.camel.apache.org/jolokia.protocol": "http",
}

Expect(BindKameletTo(ns, name, annotations, from, to, fromParams, toParams)()).
To(Succeed())
Expect(KamelBind(ns,
from.Name,
to.Name,
"-p", "source.message=Magicstring!",
"-p", "sink.loggerName=binding",
"--annotation", "trait.camel.apache.org/health.enabled=true",
"--annotation", "trait.camel.apache.org/jolokia.enabled=true",
"--annotation", "trait.camel.apache.org/jolokia.use-ssl-client-authentication=false",
"--annotation", "trait.camel.apache.org/jolokia.protocol=http",
"--name", name,
).Execute()).To(Succeed())

Eventually(IntegrationPodPhase(ns, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
Eventually(IntegrationPhase(ns, name), TestTimeoutShort).Should(Equal(v1.IntegrationPhaseRunning))
Expand Down
32 changes: 21 additions & 11 deletions e2e/knative/kamelet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,20 @@ func TestKameletChange(t *testing.T) {
}

timerPipe := "timer-binding"
annotations := map[string]string{
"trait.camel.apache.org/health.enabled": "true",
"trait.camel.apache.org/health.readiness-initial-delay": "10",
}

// Create the Pipe
Expect(BindKameletTo(ns, timerPipe, annotations, from, to, map[string]string{"message": "message is Hello"}, map[string]string{})()).To(Succeed())
Expect(KamelBind(ns,
from.Name,
to.Name,
"-p", "source.message=message is Hello",
"--annotation", "trait.camel.apache.org/health.enabled=true",
"--annotation", "trait.camel.apache.org/health.readiness-initial-delay=10",
"--name", timerPipe,
).Execute()).To(Succeed())

Eventually(IntegrationPodPhase(ns, timerPipe), TestTimeoutLong).Should(Equal(corev1.PodRunning))
Eventually(IntegrationConditionStatus(ns, "timer-binding", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
Eventually(IntegrationLogs(ns, "test-kamelet-display"), TestTimeoutShort).Should(ContainSubstring("message is Hello"))
Eventually(IntegrationConditionStatus(ns, timerPipe, v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
Eventually(IntegrationLogs(ns, timerPipe), TestTimeoutShort).Should(ContainSubstring("message is Hello"))

Eventually(PipeCondition(ns, timerPipe, v1.PipeConditionReady), TestTimeoutMedium).Should(And(
WithTransform(PipeConditionStatusExtract, Equal(corev1.ConditionTrue)),
Expand All @@ -78,11 +81,18 @@ func TestKameletChange(t *testing.T) {
))

// Update the Pipe
Expect(BindKameletTo(ns, "timer-binding", annotations, from, to, map[string]string{"message": "message is Hi"}, map[string]string{})()).To(Succeed())
Expect(KamelBind(ns,
from.Name,
to.Name,
"-p", "source.message=message is Hi",
"--annotation", "trait.camel.apache.org/health.enabled=true",
"--annotation", "trait.camel.apache.org/health.readiness-initial-delay=10",
"--name", timerPipe,
).Execute()).To(Succeed())

Eventually(IntegrationPodPhase(ns, "timer-binding"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
Eventually(IntegrationConditionStatus(ns, "timer-binding", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
Eventually(IntegrationLogs(ns, "test-kamelet-display"), TestTimeoutShort).Should(ContainSubstring("message is Hi"))
Eventually(IntegrationPodPhase(ns, timerPipe), TestTimeoutLong).Should(Equal(corev1.PodRunning))
Eventually(IntegrationConditionStatus(ns, timerPipe, v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
Eventually(IntegrationLogs(ns, timerPipe), TestTimeoutShort).Should(ContainSubstring("message is Hi"))

Eventually(PipeCondition(ns, timerPipe, v1.PipeConditionReady), TestTimeoutMedium).
Should(And(
Expand Down
11 changes: 7 additions & 4 deletions e2e/native/native_binding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,13 @@ func TestNativeBinding(t *testing.T) {

t.Run("binding with native build", func(t *testing.T) {
bindingName := "native-binding"
Expect(BindKameletTo(ns, bindingName,
map[string]string{"trait.camel.apache.org/quarkus.package-type": "native"},
from, to,
map[string]string{"message": message}, map[string]string{})()).To(Succeed())
Expect(KamelBind(ns,
from.Name,
to.Name,
"-p", "source.message=message",
"--annotation", "trait.camel.apache.org/quarkus.package-type=native",
"--name", bindingName,
).Execute()).To(Succeed())

// ====================================
// !!! THE MOST TIME-CONSUMING PART !!!
Expand Down
Loading

0 comments on commit 0e058d9

Please sign in to comment.