Skip to content
This repository has been archived by the owner on Jun 4, 2021. It is now read-only.

Commit

Permalink
Upgrade Camel K to 1.0.0-RC2 (#991) (#1000)
Browse files Browse the repository at this point in the history
* Upgrade Camel K to 1.0.0-RC2

* Upgrade Camel K to 1.0.0-RC2: update codegen

* Upgrade Camel K to 1.0.0-RC2: add some logs to debug

* Upgrade Camel K to 1.0.0-RC2: force Knative profile
  • Loading branch information
nicolaferraro authored Mar 7, 2020
1 parent a49a7c7 commit 8defc66
Show file tree
Hide file tree
Showing 20 changed files with 472 additions and 163 deletions.
6 changes: 3 additions & 3 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ required = [

[[constraint]]
name = "github.com/apache/camel-k"
version = "1.0.0-RC1"
version = "1.0.0-RC2"

# needed because pkg upgraded
[[override]]
Expand Down
2 changes: 1 addition & 1 deletion camel/source/pkg/reconciler/camelsource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ func getRunningCamelKFlowIntegration(t *testing.T) *camelv1.Integration {
Integration: &camelv1.IntegrationSpec{
Sources: []camelv1.SourceSpec{
{
Loader: "knative-source-yaml",
Loader: "knative-source",
DataSpec: camelv1.DataSpec{
Name: "flow.yaml",
Content: "- from:\n steps:\n - set-body:\n constant: Hello world\n uri: timer:tick?period=3s\n",
Expand Down
2 changes: 1 addition & 1 deletion camel/source/pkg/reconciler/resources/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func MakeIntegration(args *CamelArguments) (*camelv1.Integration, error) {
return nil, err
}
spec.Sources = append(spec.Sources, camelv1.SourceSpec{
Loader: "knative-source-yaml",
Loader: "knative-source",
DataSpec: camelv1.DataSpec{
Name: "flow.yaml",
Content: flowData,
Expand Down
2 changes: 1 addition & 1 deletion camel/source/pkg/reconciler/resources/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func TestMakeDeployment_sink(t *testing.T) {
Kit: "test-kit",
Sources: []camelv1.SourceSpec{
{
Loader: "knative-source-yaml",
Loader: "knative-source",
DataSpec: camelv1.DataSpec{
Name: "flow.yaml",
Content: "- from:\n uri: timer:tick\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ rules:
resources:
- events
verbs:
- create
- patch
- get
- list
- watch
Expand Down Expand Up @@ -381,7 +383,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: docker.io/apache/camel-k:1.0.0-RC1
image: docker.io/apache/camel-k:1.0.0-RC2
imagePullPolicy: IfNotPresent
name: camel-k-operator
resources: {}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ readonly KAFKA_CRD_CONFIG_DIR="$(mktemp -d)"
readonly KAFKA_SOURCE_CRD_CONFIG_DIR="kafka/source/config"

# CamelK installation
readonly CAMELK_INSTALLATION_CONFIG="test/config/100-camel-k-1.0.0-RC1.yaml"
readonly CAMELK_INSTALLATION_CONFIG="test/config/100-camel-k-1.0.0-RC2.yaml"
# Camel source CRD config template directory
readonly CAMEL_SOURCE_CRD_CONFIG_DIR="camel/source/config"

Expand Down
25 changes: 24 additions & 1 deletion test/e2e/camel_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,31 @@ func TestCamelSource(t *testing.T) {
t.Logf("Sleeping for 3s to let the timer tick at least once")
time.Sleep(3 * time.Second)

pods, err := client.Kube.Kube.CoreV1().Pods(client.Namespace).List(meta.ListOptions{
LabelSelector: "camel.apache.org/integration",
})
if err != nil {
t.Fatalf("cannot get integration pod: %v", err)
}
if len(pods.Items) == 0 {
t.Fatalf("no integration pod found")
}
printPodLogs(t, client, pods.Items[0].Name, "integration")

if err := client.CheckLog(loggerPodName, lib.CheckerContains(body)); err != nil {
printPodLogs(t, client, pods.Items[0].Name, "integration")
t.Fatalf("Strings %q not found in logs of logger pod %q: %v", body, loggerPodName, err)
}
}

func printPodLogs(t *testing.T, c *lib.Client, podName, containerName string) {
logs, err := c.Kube.PodLogs(podName, containerName, c.Namespace)
if err == nil {
t.Log(string(logs))
}
t.Logf("End of pod %s logs", podName)
}

func createCamelSourceOrFail(c *lib.Client, camelSource *v1alpha1.CamelSource) {
camelSourceClientSet, err := camelsourceclient.NewForConfig(c.Config)
if err != nil {
Expand All @@ -114,6 +134,9 @@ func createCamelPlatformOrFail(c *lib.Client, camelClient runtime.Client, camelS
Name: "camel-k",
Namespace: c.Namespace,
},
Spec: camelv1.IntegrationPlatformSpec{
Profile: camelv1.TraitProfileKnative,
},
}

if err := camelClient.Create(context.TODO(), &platform); err != nil {
Expand All @@ -140,7 +163,7 @@ func createCamelKitOrFail(c *lib.Client, camelClient runtime.Client, camelSource
"mvn:org.apache.camel.k/camel-k-runtime-knative",
"mvn:org.apache.camel.k/camel-k-runtime-main",
},
Image: "docker.io/testcamelk/camel-k-kit-bosp6ks52uhp0rb7beeg:3590738",
Image: "docker.io/testcamelk/camel-k-kit-knative-timer:1.0.0-RC2",
},
}

Expand Down
53 changes: 27 additions & 26 deletions vendor/github.com/apache/camel-k/pkg/apis/camel/v1/build_types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8defc66

Please sign in to comment.