You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2019/06/11 08:42:09 UTC
[camel-k] 01/02: Rename 'context' term used by Camel K. #206
This is an automated email from the ASF dual-hosted git repository.
lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 84eb7b7bdcbd213c5a4eb450d57266cfca1dc03b
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Thu Jun 6 17:46:37 2019 +0200
Rename 'context' term used by Camel K. #206
---
Gopkg.lock | 9 --
assets/json-schema/Integration.json | 12 +--
...IntegrationContext.json => IntegrationKit.json} | 12 +--
cmd/util/json-schema-gen/jsonschemagen.go | 2 +-
deploy/camel-catalog-2.23.0.yaml | 17 ----
deploy/camel-catalog-2.23.1.yaml | 17 ----
deploy/camel-catalog-2.23.2.yaml | 17 ----
deploy/camel-catalog-2.24.0.yaml | 17 ----
deploy/camel-catalog-3.0.0-M2.yaml | 17 ----
...ation-context.yaml => crd-integration-kit.yaml} | 20 ++---
deploy/crd-integration.yaml | 6 +-
.../camel-k.v0.3.3.clusterserviceversion.yaml | 12 +--
deploy/olm-catalog/csv-config.yaml | 2 +-
...y.yaml => platform-integration-kit-groovy.yaml} | 8 +-
...-jvm.yaml => platform-integration-kit-jvm.yaml} | 8 +-
....yaml => platform-integration-kit-knative.yaml} | 8 +-
...n.yaml => platform-integration-kit-kotlin.yaml} | 8 +-
deploy/resources.go | 68 +++++++--------
go.mod | 1 -
go.sum | 2 -
pkg/apis/camel/v1alpha1/integration_types.go | 12 +--
.../camel/v1alpha1/integrationcontext_types.go | 97 ----------------------
pkg/apis/camel/v1alpha1/integrationkit_types.go | 97 ++++++++++++++++++++++
..._support.go => integrationkit_types_support.go} | 22 ++---
.../camel/v1alpha1/integrationplatform_types.go | 2 +-
pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go | 42 +++++-----
pkg/builder/builder.go | 2 +-
pkg/builder/builder_steps.go | 23 +++--
pkg/builder/builder_steps_test.go | 24 +++---
pkg/builder/builder_types.go | 1 -
pkg/cmd/completion_bash.go | 22 ++---
pkg/cmd/describe.go | 2 +-
pkg/cmd/describe_integration.go | 2 +-
pkg/cmd/{describe_context.go => describe_kit.go} | 54 ++++++------
pkg/cmd/describe_platform.go | 33 ++++----
pkg/cmd/get.go | 2 +-
pkg/cmd/install.go | 24 +++---
pkg/cmd/{context.go => kit.go} | 14 ++--
pkg/cmd/{context_create.go => kit_create.go} | 47 +++++------
pkg/cmd/{context_delete.go => kit_delete.go} | 52 ++++++------
pkg/cmd/{context_get.go => kit_get.go} | 34 ++++----
pkg/cmd/reset.go | 16 ++--
pkg/cmd/root.go | 2 +-
pkg/cmd/run.go | 48 +++++------
...integrationcontext.go => add_integrationkit.go} | 4 +-
.../integration/{build_context.go => build_kit.go} | 78 ++++++++---------
pkg/controller/integration/deploy.go | 18 ++--
pkg/controller/integration/initialize.go | 4 +-
.../integration/integration_controller.go | 4 +-
pkg/controller/integration/util.go | 46 +++++-----
pkg/controller/integration/util_test.go | 96 ++++++++++-----------
.../action.go | 8 +-
.../build.go | 96 +++++++++++----------
.../initialize.go | 32 +++----
.../integrationkit_controller.go} | 54 ++++++------
.../{integrationcontext => integrationkit}/log.go | 4 +-
.../monitor.go | 22 ++---
pkg/controller/integrationplatform/action.go | 2 +-
pkg/controller/integrationplatform/create.go | 6 +-
pkg/controller/integrationplatform/start.go | 8 +-
pkg/install/cluster.go | 6 +-
pkg/install/common.go | 4 +-
pkg/platform/resources.go | 30 +++----
pkg/trait/builder.go | 2 +-
pkg/trait/builder_test.go | 12 +--
pkg/trait/camel.go | 8 +-
pkg/trait/classpath.go | 26 +++---
pkg/trait/deployment.go | 12 +--
pkg/trait/environment_test.go | 18 ++--
pkg/trait/knative_service.go | 4 +-
pkg/trait/knative_service_test.go | 6 +-
pkg/trait/knative_test.go | 6 +-
pkg/trait/route_test.go | 6 +-
pkg/trait/trait.go | 32 +++----
pkg/trait/trait_catalog.go | 4 +-
pkg/trait/trait_test.go | 10 +--
pkg/trait/trait_types.go | 64 +++++++-------
pkg/trait/util.go | 14 ++--
pkg/trait/util_test.go | 20 ++---
pkg/util/cancellable/cancellable.go | 2 +-
pkg/util/digest/digest.go | 12 +--
pkg/util/kubernetes/util.go | 4 +-
pkg/util/log/log.go | 10 +--
pkg/util/maven/maven_types.go | 2 +-
test/cluster_integration_test.go | 2 +-
85 files changed, 814 insertions(+), 921 deletions(-)
diff --git a/Gopkg.lock b/Gopkg.lock
index 7a219c0..5f290cc 100644
--- a/Gopkg.lock
+++ b/Gopkg.lock
@@ -383,14 +383,6 @@
version = "v1.0.1"
[[projects]]
- digest = "1:4244266b65ea535b8ebd109a327720821707b59f9a37bda738946d52ec69442d"
- name = "github.com/magiconair/properties"
- packages = ["."]
- pruneopts = "NT"
- revision = "c2353362d570a7bfa228149c62842019201cfb71"
- version = "v1.8.0"
-
-[[projects]]
branch = "master"
digest = "1:4925ec3736ef6c299cfcf61597782e3d66ec13114f7476019d04c742a7be55d0"
name = "github.com/mailru/easyjson"
@@ -1116,7 +1108,6 @@
"github.com/knative/eventing/pkg/apis/eventing/v1alpha1",
"github.com/knative/pkg/apis/duck/v1alpha1",
"github.com/knative/serving/pkg/apis/serving/v1alpha1",
- "github.com/magiconair/properties",
"github.com/mitchellh/mapstructure",
"github.com/openshift/api/apps/v1",
"github.com/openshift/api/authorization/v1",
diff --git a/assets/json-schema/Integration.json b/assets/json-schema/Integration.json
index f9e26f5..67e4a80 100644
--- a/assets/json-schema/Integration.json
+++ b/assets/json-schema/Integration.json
@@ -187,15 +187,15 @@
},
"type": "array"
},
- "context": {
- "type": "string"
- },
"dependencies": {
"items": {
"type": "string"
},
"type": "array"
},
+ "kit": {
+ "type": "string"
+ },
"profile": {
"type": "string"
},
@@ -249,9 +249,6 @@
},
"type": "array"
},
- "context": {
- "type": "string"
- },
"dependencies": {
"items": {
"type": "string"
@@ -274,6 +271,9 @@
"image": {
"type": "string"
},
+ "kit": {
+ "type": "string"
+ },
"phase": {
"type": "string"
},
diff --git a/assets/json-schema/IntegrationContext.json b/assets/json-schema/IntegrationKit.json
similarity index 97%
rename from assets/json-schema/IntegrationContext.json
rename to assets/json-schema/IntegrationKit.json
index f879529..a6d9766 100644
--- a/assets/json-schema/IntegrationContext.json
+++ b/assets/json-schema/IntegrationKit.json
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
- "$ref": "#/definitions/IntegrationContext",
+ "$ref": "#/definitions/IntegrationKit",
"definitions": {
"Artifact": {
"required": [
@@ -109,7 +109,7 @@
"additionalProperties": false,
"type": "object"
},
- "IntegrationContext": {
+ "IntegrationKit": {
"properties": {
"annotations": {
"patternProperties": {
@@ -183,11 +183,11 @@
},
"spec": {
"$schema": "http://json-schema.org/draft-04/schema#",
- "$ref": "#/definitions/IntegrationContextSpec"
+ "$ref": "#/definitions/IntegrationKitSpec"
},
"status": {
"$schema": "http://json-schema.org/draft-04/schema#",
- "$ref": "#/definitions/IntegrationContextStatus"
+ "$ref": "#/definitions/IntegrationKitStatus"
},
"uid": {
"type": "string"
@@ -196,7 +196,7 @@
"additionalProperties": false,
"type": "object"
},
- "IntegrationContextSpec": {
+ "IntegrationKitSpec": {
"properties": {
"configuration": {
"items": {
@@ -236,7 +236,7 @@
"additionalProperties": false,
"type": "object"
},
- "IntegrationContextStatus": {
+ "IntegrationKitStatus": {
"properties": {
"artifacts": {
"items": {
diff --git a/cmd/util/json-schema-gen/jsonschemagen.go b/cmd/util/json-schema-gen/jsonschemagen.go
index 6ef401c..7a10089 100644
--- a/cmd/util/json-schema-gen/jsonschemagen.go
+++ b/cmd/util/json-schema-gen/jsonschemagen.go
@@ -33,7 +33,7 @@ import (
func main() {
sources := []interface{}{
v1alpha1.Integration{},
- v1alpha1.IntegrationContext{},
+ v1alpha1.IntegrationKit{},
//v1alpha1.IntegrationPlatform{},
v1alpha1.CamelCatalog{},
}
diff --git a/deploy/camel-catalog-2.23.0.yaml b/deploy/camel-catalog-2.23.0.yaml
index a6b5cd6..d9947cb 100644
--- a/deploy/camel-catalog-2.23.0.yaml
+++ b/deploy/camel-catalog-2.23.0.yaml
@@ -1,20 +1,3 @@
-# ---------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ---------------------------------------------------------------------------
-
apiVersion: camel.apache.org/v1alpha1
kind: CamelCatalog
metadata:
diff --git a/deploy/camel-catalog-2.23.1.yaml b/deploy/camel-catalog-2.23.1.yaml
index d3da662..ea1c0d8 100644
--- a/deploy/camel-catalog-2.23.1.yaml
+++ b/deploy/camel-catalog-2.23.1.yaml
@@ -1,20 +1,3 @@
-# ---------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ---------------------------------------------------------------------------
-
apiVersion: camel.apache.org/v1alpha1
kind: CamelCatalog
metadata:
diff --git a/deploy/camel-catalog-2.23.2.yaml b/deploy/camel-catalog-2.23.2.yaml
index 1b14950..d56c5e6 100644
--- a/deploy/camel-catalog-2.23.2.yaml
+++ b/deploy/camel-catalog-2.23.2.yaml
@@ -1,20 +1,3 @@
-# ---------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ---------------------------------------------------------------------------
-
apiVersion: camel.apache.org/v1alpha1
kind: CamelCatalog
metadata:
diff --git a/deploy/camel-catalog-2.24.0.yaml b/deploy/camel-catalog-2.24.0.yaml
index 064e399..23b2739 100644
--- a/deploy/camel-catalog-2.24.0.yaml
+++ b/deploy/camel-catalog-2.24.0.yaml
@@ -1,20 +1,3 @@
-# ---------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ---------------------------------------------------------------------------
-
apiVersion: camel.apache.org/v1alpha1
kind: CamelCatalog
metadata:
diff --git a/deploy/camel-catalog-3.0.0-M2.yaml b/deploy/camel-catalog-3.0.0-M2.yaml
index 6d7eec4..a9c501a 100644
--- a/deploy/camel-catalog-3.0.0-M2.yaml
+++ b/deploy/camel-catalog-3.0.0-M2.yaml
@@ -1,20 +1,3 @@
-# ---------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ---------------------------------------------------------------------------
-
apiVersion: camel.apache.org/v1alpha1
kind: CamelCatalog
metadata:
diff --git a/deploy/crd-integration-context.yaml b/deploy/crd-integration-kit.yaml
similarity index 77%
rename from deploy/crd-integration-context.yaml
rename to deploy/crd-integration-kit.yaml
index ae67d41..f117dec 100644
--- a/deploy/crd-integration-context.yaml
+++ b/deploy/crd-integration-kit.yaml
@@ -18,7 +18,7 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
- name: integrationcontexts.camel.apache.org
+ name: integrationkits.camel.apache.org
labels:
app: "camel-k"
spec:
@@ -28,22 +28,22 @@ spec:
subresources:
status: {}
names:
- kind: IntegrationContext
- listKind: IntegrationContextList
- plural: integrationcontexts
- singular: integrationcontext
+ kind: IntegrationKit
+ listKind: IntegrationKitList
+ plural: integrationkits
+ singular: integrationkit
shortNames:
- - ictx
+ - itk
additionalPrinterColumns:
- name: Phase
type: string
- description: The IntegrationContext phase
+ description: The IntegrationKit phase
JSONPath: .status.phase
- name: Type
type: string
- description: The IntegrationContext type
- JSONPath: .metadata.labels.camel\.apache\.org\/context\.type
+ description: The IntegrationKit type
+ JSONPath: .metadata.labels.camel\.apache\.org\/kit\.type
- name: Image
type: string
- description: The IntegrationContext image
+ description: The IntegrationKit image
JSONPath: .status.image
diff --git a/deploy/crd-integration.yaml b/deploy/crd-integration.yaml
index 68d89f7..0b0f905 100644
--- a/deploy/crd-integration.yaml
+++ b/deploy/crd-integration.yaml
@@ -39,7 +39,7 @@ spec:
type: string
description: The Integration phase
JSONPath: .status.phase
- - name: Context
+ - name: Kit
type: string
- description: The IntegrationContext to use
- JSONPath: .status.context
+ description: The IntegrationKit to use
+ JSONPath: .status.kit
diff --git a/deploy/olm-catalog/camel-k/0.3.3/camel-k.v0.3.3.clusterserviceversion.yaml b/deploy/olm-catalog/camel-k/0.3.3/camel-k.v0.3.3.clusterserviceversion.yaml
index 24d44de..70c5795 100644
--- a/deploy/olm-catalog/camel-k/0.3.3/camel-k.v0.3.3.clusterserviceversion.yaml
+++ b/deploy/olm-catalog/camel-k/0.3.3/camel-k.v0.3.3.clusterserviceversion.yaml
@@ -40,7 +40,7 @@ metadata:
"buildStrategy": "pod"
},
"resources": {
- "contexts": [
+ "kits": [
"jvm"
]
}
@@ -61,7 +61,7 @@ metadata:
},
{
"apiVersion": "camel.apache.org/v1alpha1",
- "kind": "IntegrationContext",
+ "kind": "IntegrationKit",
"metadata": {
"name": "example"
}
@@ -162,10 +162,10 @@ spec:
version: v1alpha1
displayName: Integration
description: A Camel K integration
- - kind: IntegrationContext
- name: integrationcontexts.camel.apache.org
- displayName: Integration Context
- description: A Camel K integration context
+ - kind: IntegrationKit
+ name: integrationlkits.camel.apache.org
+ displayName: Integration Kit
+ description: A Camel K integration kit
version: v1alpha1
- kind: IntegrationPlatform
name: integrationplatforms.camel.apache.org
diff --git a/deploy/olm-catalog/csv-config.yaml b/deploy/olm-catalog/csv-config.yaml
index 6a2abb7..e2135e5 100644
--- a/deploy/olm-catalog/csv-config.yaml
+++ b/deploy/olm-catalog/csv-config.yaml
@@ -20,6 +20,6 @@ crd-cr-paths:
- deploy/crd-build.yaml
- deploy/crd-camel-catalog.yaml
- deploy/crd-integration.yaml
- - deploy/crd-integration-context.yaml
+ - deploy/crd-integration-kit.yaml
- deploy/crd-integration-platform.yaml
role-path: deploy/operator-role-olm.yaml
diff --git a/deploy/platform-integration-context-groovy.yaml b/deploy/platform-integration-kit-groovy.yaml
similarity index 84%
rename from deploy/platform-integration-context-groovy.yaml
rename to deploy/platform-integration-kit-groovy.yaml
index 20e72fc..fcc9cde 100644
--- a/deploy/platform-integration-context-groovy.yaml
+++ b/deploy/platform-integration-kit-groovy.yaml
@@ -16,14 +16,14 @@
# ---------------------------------------------------------------------------
apiVersion: camel.apache.org/v1alpha1
-kind: IntegrationContext
+kind: IntegrationKit
metadata:
name: groovy
labels:
app: "camel-k"
- camel.apache.org/context.created.by.kind: Operator
- camel.apache.org/context.created.by.name: camel-k-operator
- camel.apache.org/context.type: platform
+ camel.apache.org/kit.created.by.kind: Operator
+ camel.apache.org/kit.created.by.name: camel-k-operator
+ camel.apache.org/kit.type: platform
spec:
dependencies:
- runtime:jvm
diff --git a/deploy/platform-integration-context-jvm.yaml b/deploy/platform-integration-kit-jvm.yaml
similarity index 84%
rename from deploy/platform-integration-context-jvm.yaml
rename to deploy/platform-integration-kit-jvm.yaml
index 239c47d..96a59aa 100644
--- a/deploy/platform-integration-context-jvm.yaml
+++ b/deploy/platform-integration-kit-jvm.yaml
@@ -16,14 +16,14 @@
# ---------------------------------------------------------------------------
apiVersion: camel.apache.org/v1alpha1
-kind: IntegrationContext
+kind: IntegrationKit
metadata:
name: jvm
labels:
app: "camel-k"
- camel.apache.org/context.created.by.kind: Operator
- camel.apache.org/context.created.by.name: camel-k-operator
- camel.apache.org/context.type: platform
+ camel.apache.org/kit.created.by.kind: Operator
+ camel.apache.org/kit.created.by.name: camel-k-operator
+ camel.apache.org/kit.type: platform
spec:
dependencies:
- runtime:jvm
diff --git a/deploy/platform-integration-context-knative.yaml b/deploy/platform-integration-kit-knative.yaml
similarity index 84%
rename from deploy/platform-integration-context-knative.yaml
rename to deploy/platform-integration-kit-knative.yaml
index d985121..f9ad77a 100644
--- a/deploy/platform-integration-context-knative.yaml
+++ b/deploy/platform-integration-kit-knative.yaml
@@ -16,14 +16,14 @@
# ---------------------------------------------------------------------------
apiVersion: camel.apache.org/v1alpha1
-kind: IntegrationContext
+kind: IntegrationKit
metadata:
name: knative
labels:
app: "camel-k"
- camel.apache.org/context.created.by.kind: Operator
- camel.apache.org/context.created.by.name: camel-k-operator
- camel.apache.org/context.type: platform
+ camel.apache.org/kit.created.by.kind: Operator
+ camel.apache.org/kit.created.by.name: camel-k-operator
+ camel.apache.org/kit.type: platform
spec:
dependencies:
- runtime:jvm
diff --git a/deploy/platform-integration-context-kotlin.yaml b/deploy/platform-integration-kit-kotlin.yaml
similarity index 84%
rename from deploy/platform-integration-context-kotlin.yaml
rename to deploy/platform-integration-kit-kotlin.yaml
index 7514b30..caea0b5 100644
--- a/deploy/platform-integration-context-kotlin.yaml
+++ b/deploy/platform-integration-kit-kotlin.yaml
@@ -16,14 +16,14 @@
# ---------------------------------------------------------------------------
apiVersion: camel.apache.org/v1alpha1
-kind: IntegrationContext
+kind: IntegrationKit
metadata:
name: kotlin
labels:
app: "camel-k"
- camel.apache.org/context.created.by.kind: Operator
- camel.apache.org/context.created.by.name: camel-k-operator
- camel.apache.org/context.type: platform
+ camel.apache.org/kit.created.by.kind: Operator
+ camel.apache.org/kit.created.by.name: camel-k-operator
+ camel.apache.org/kit.type: platform
spec:
dependencies:
- runtime:jvm
diff --git a/deploy/resources.go b/deploy/resources.go
index 31aad32..3208488 100644
--- a/deploy/resources.go
+++ b/deploy/resources.go
@@ -10735,7 +10735,7 @@ spec:
`
- Resources["crd-integration-context.yaml"] =
+ Resources["crd-integration-kit.yaml"] =
`
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
@@ -10757,7 +10757,7 @@ spec:
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
- name: integrationcontexts.camel.apache.org
+ name: integrationkits.camel.apache.org
labels:
app: "camel-k"
spec:
@@ -10767,24 +10767,24 @@ spec:
subresources:
status: {}
names:
- kind: IntegrationContext
- listKind: IntegrationContextList
- plural: integrationcontexts
- singular: integrationcontext
+ kind: IntegrationKit
+ listKind: IntegrationKitList
+ plural: integrationkits
+ singular: integrationkit
shortNames:
- - ictx
+ - itk
additionalPrinterColumns:
- name: Phase
type: string
- description: The IntegrationContext phase
+ description: The IntegrationKit phase
JSONPath: .status.phase
- name: Type
type: string
- description: The IntegrationContext type
- JSONPath: .metadata.labels.camel\.apache\.org\/context\.type
+ description: The IntegrationKit type
+ JSONPath: .metadata.labels.camel\.apache\.org\/kit\.type
- name: Image
type: string
- description: The IntegrationContext image
+ description: The IntegrationKit image
JSONPath: .status.image
`
@@ -10876,10 +10876,10 @@ spec:
type: string
description: The Integration phase
JSONPath: .status.phase
- - name: Context
+ - name: Kit
type: string
- description: The IntegrationContext to use
- JSONPath: .status.context
+ description: The IntegrationKit to use
+ JSONPath: .status.kit
`
Resources["cr-example.yaml"] =
@@ -11625,7 +11625,7 @@ metadata:
app: "camel-k"
`
- Resources["platform-integration-context-groovy.yaml"] =
+ Resources["platform-integration-kit-groovy.yaml"] =
`
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
@@ -11645,21 +11645,21 @@ metadata:
# ---------------------------------------------------------------------------
apiVersion: camel.apache.org/v1alpha1
-kind: IntegrationContext
+kind: IntegrationKit
metadata:
name: groovy
labels:
app: "camel-k"
- camel.apache.org/context.created.by.kind: Operator
- camel.apache.org/context.created.by.name: camel-k-operator
- camel.apache.org/context.type: platform
+ camel.apache.org/kit.created.by.kind: Operator
+ camel.apache.org/kit.created.by.name: camel-k-operator
+ camel.apache.org/kit.type: platform
spec:
dependencies:
- runtime:jvm
- runtime:groovy
- camel:core
`
- Resources["platform-integration-context-jvm.yaml"] =
+ Resources["platform-integration-kit-jvm.yaml"] =
`
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
@@ -11679,20 +11679,20 @@ spec:
# ---------------------------------------------------------------------------
apiVersion: camel.apache.org/v1alpha1
-kind: IntegrationContext
+kind: IntegrationKit
metadata:
name: jvm
labels:
app: "camel-k"
- camel.apache.org/context.created.by.kind: Operator
- camel.apache.org/context.created.by.name: camel-k-operator
- camel.apache.org/context.type: platform
+ camel.apache.org/kit.created.by.kind: Operator
+ camel.apache.org/kit.created.by.name: camel-k-operator
+ camel.apache.org/kit.type: platform
spec:
dependencies:
- runtime:jvm
- camel:core
`
- Resources["platform-integration-context-knative.yaml"] =
+ Resources["platform-integration-kit-knative.yaml"] =
`
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
@@ -11712,14 +11712,14 @@ spec:
# ---------------------------------------------------------------------------
apiVersion: camel.apache.org/v1alpha1
-kind: IntegrationContext
+kind: IntegrationKit
metadata:
name: knative
labels:
app: "camel-k"
- camel.apache.org/context.created.by.kind: Operator
- camel.apache.org/context.created.by.name: camel-k-operator
- camel.apache.org/context.type: platform
+ camel.apache.org/kit.created.by.kind: Operator
+ camel.apache.org/kit.created.by.name: camel-k-operator
+ camel.apache.org/kit.type: platform
spec:
dependencies:
- runtime:jvm
@@ -11727,7 +11727,7 @@ spec:
- camel:core
- camel-k:knative
`
- Resources["platform-integration-context-kotlin.yaml"] =
+ Resources["platform-integration-kit-kotlin.yaml"] =
`
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
@@ -11747,14 +11747,14 @@ spec:
# ---------------------------------------------------------------------------
apiVersion: camel.apache.org/v1alpha1
-kind: IntegrationContext
+kind: IntegrationKit
metadata:
name: kotlin
labels:
app: "camel-k"
- camel.apache.org/context.created.by.kind: Operator
- camel.apache.org/context.created.by.name: camel-k-operator
- camel.apache.org/context.type: platform
+ camel.apache.org/kit.created.by.kind: Operator
+ camel.apache.org/kit.created.by.name: camel-k-operator
+ camel.apache.org/kit.type: platform
spec:
dependencies:
- runtime:jvm
diff --git a/go.mod b/go.mod
index 297ed29..265309f 100644
--- a/go.mod
+++ b/go.mod
@@ -30,7 +30,6 @@ require (
github.com/knative/eventing v0.4.0
github.com/knative/pkg v0.0.0-20190214162945-0183bf9cdc73
github.com/knative/serving v0.4.0
- github.com/magiconair/properties v1.8.0
github.com/mailru/easyjson v0.0.0-20190221075403-6243d8e04c3f // indirect
github.com/markbates/inflect v1.0.4 // indirect
github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a // indirect
diff --git a/go.sum b/go.sum
index 5feda3b..7815291 100644
--- a/go.sum
+++ b/go.sum
@@ -151,8 +151,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
-github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY=
-github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190221075403-6243d8e04c3f h1:B6PQkurxGG1rqEX96oE14gbj8bqvYC5dtks9r5uGmlE=
diff --git a/pkg/apis/camel/v1alpha1/integration_types.go b/pkg/apis/camel/v1alpha1/integration_types.go
index 3652d69..a1bcb75 100644
--- a/pkg/apis/camel/v1alpha1/integration_types.go
+++ b/pkg/apis/camel/v1alpha1/integration_types.go
@@ -28,7 +28,7 @@ type IntegrationSpec struct {
Replicas *int32 `json:"replicas,omitempty"`
Sources []SourceSpec `json:"sources,omitempty"`
Resources []ResourceSpec `json:"resources,omitempty"`
- Context string `json:"context,omitempty"`
+ Kit string `json:"kit,omitempty"`
Dependencies []string `json:"dependencies,omitempty"`
Profile TraitProfile `json:"profile,omitempty"`
Traits map[string]TraitSpec `json:"traits,omitempty"`
@@ -43,7 +43,7 @@ type IntegrationStatus struct {
Digest string `json:"digest,omitempty"`
Image string `json:"image,omitempty"`
Dependencies []string `json:"dependencies,omitempty"`
- Context string `json:"context,omitempty"`
+ Kit string `json:"kit,omitempty"`
GeneratedSources []SourceSpec `json:"generatedSources,omitempty"`
Failure *Failure `json:"failure,omitempty"`
CamelVersion string `json:"camelVersion,omitempty"`
@@ -146,10 +146,10 @@ const (
IntegrationPhaseInitial IntegrationPhase = ""
// IntegrationPhaseWaitingForPlatform --
IntegrationPhaseWaitingForPlatform IntegrationPhase = "Waiting For Platform"
- // IntegrationPhaseBuildingContext --
- IntegrationPhaseBuildingContext IntegrationPhase = "Building Context"
- // IntegrationPhaseResolvingContext --
- IntegrationPhaseResolvingContext IntegrationPhase = "Resolving Context"
+ // IntegrationPhaseBuildingKit --
+ IntegrationPhaseBuildingKit IntegrationPhase = "Building Kit"
+ // IntegrationPhaseResolvingKit --
+ IntegrationPhaseResolvingKit IntegrationPhase = "Resolving Kit"
// IntegrationPhaseDeploying --
IntegrationPhaseDeploying IntegrationPhase = "Deploying"
// IntegrationPhaseRunning --
diff --git a/pkg/apis/camel/v1alpha1/integrationcontext_types.go b/pkg/apis/camel/v1alpha1/integrationcontext_types.go
deleted file mode 100644
index 62ef847..0000000
--- a/pkg/apis/camel/v1alpha1/integrationcontext_types.go
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-package v1alpha1
-
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-)
-
-// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
-
-// IntegrationContextSpec defines the desired state of IntegrationContext
-type IntegrationContextSpec struct {
- Image string `json:"image,omitempty"`
- Dependencies []string `json:"dependencies,omitempty"`
- Profile TraitProfile `json:"profile,omitempty"`
- Traits map[string]TraitSpec `json:"traits,omitempty"`
- Configuration []ConfigurationSpec `json:"configuration,omitempty"`
- Repositories []string `json:"repositories,omitempty"`
-}
-
-// IntegrationContextStatus defines the observed state of IntegrationContext
-type IntegrationContextStatus struct {
- Phase IntegrationContextPhase `json:"phase,omitempty"`
- BaseImage string `json:"baseImage,omitempty"`
- Image string `json:"image,omitempty"`
- PublicImage string `json:"publicImage,omitempty"`
- Digest string `json:"digest,omitempty"`
- Artifacts []Artifact `json:"artifacts,omitempty"`
- Failure *Failure `json:"failure,omitempty"`
- CamelVersion string `json:"camelVersion,omitempty"`
- RuntimeVersion string `json:"runtimeVersion,omitempty"`
-}
-
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-
-// IntegrationContext is the Schema for the integrationcontexts API
-// +k8s:openapi-gen=true
-type IntegrationContext struct {
- metav1.TypeMeta `json:",inline"`
- metav1.ObjectMeta `json:"metadata,omitempty"`
-
- Spec IntegrationContextSpec `json:"spec,omitempty"`
- Status IntegrationContextStatus `json:"status,omitempty"`
-}
-
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-
-// IntegrationContextList contains a list of IntegrationContext
-type IntegrationContextList struct {
- metav1.TypeMeta `json:",inline"`
- metav1.ListMeta `json:"metadata,omitempty"`
- Items []IntegrationContext `json:"items"`
-}
-
-// IntegrationContextPhase --
-type IntegrationContextPhase string
-
-const (
- // IntegrationContextKind --
- IntegrationContextKind string = "IntegrationContext"
-
- // IntegrationContextTypePlatform --
- IntegrationContextTypePlatform = "platform"
-
- // IntegrationContextTypeUser --
- IntegrationContextTypeUser = "user"
-
- // IntegrationContextTypeExternal --
- IntegrationContextTypeExternal = "external"
-
- // IntegrationContextPhaseBuildSubmitted --
- IntegrationContextPhaseBuildSubmitted IntegrationContextPhase = "Build Submitted"
- // IntegrationContextPhaseBuildRunning --
- IntegrationContextPhaseBuildRunning IntegrationContextPhase = "Build Running"
- // IntegrationContextPhaseReady --
- IntegrationContextPhaseReady IntegrationContextPhase = "Ready"
- // IntegrationContextPhaseError --
- IntegrationContextPhaseError IntegrationContextPhase = "Error"
-)
-
-func init() {
- SchemeBuilder.Register(&IntegrationContext{}, &IntegrationContextList{})
-}
diff --git a/pkg/apis/camel/v1alpha1/integrationkit_types.go b/pkg/apis/camel/v1alpha1/integrationkit_types.go
new file mode 100644
index 0000000..0dc8616
--- /dev/null
+++ b/pkg/apis/camel/v1alpha1/integrationkit_types.go
@@ -0,0 +1,97 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+package v1alpha1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
+
+// IntegrationKitSpec defines the desired state of IntegrationKit
+type IntegrationKitSpec struct {
+ Image string `json:"image,omitempty"`
+ Dependencies []string `json:"dependencies,omitempty"`
+ Profile TraitProfile `json:"profile,omitempty"`
+ Traits map[string]TraitSpec `json:"traits,omitempty"`
+ Configuration []ConfigurationSpec `json:"configuration,omitempty"`
+ Repositories []string `json:"repositories,omitempty"`
+}
+
+// IntegrationKitStatus defines the observed state of IntegrationKit
+type IntegrationKitStatus struct {
+ Phase IntegrationKitPhase `json:"phase,omitempty"`
+ BaseImage string `json:"baseImage,omitempty"`
+ Image string `json:"image,omitempty"`
+ PublicImage string `json:"publicImage,omitempty"`
+ Digest string `json:"digest,omitempty"`
+ Artifacts []Artifact `json:"artifacts,omitempty"`
+ Failure *Failure `json:"failure,omitempty"`
+ CamelVersion string `json:"camelVersion,omitempty"`
+ RuntimeVersion string `json:"runtimeVersion,omitempty"`
+}
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+// IntegrationKit is the Schema for the integrationkits API
+// +k8s:openapi-gen=true
+type IntegrationKit struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ Spec IntegrationKitSpec `json:"spec,omitempty"`
+ Status IntegrationKitStatus `json:"status,omitempty"`
+}
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+// IntegrationKitList contains a list of IntegrationKit
+type IntegrationKitList struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ListMeta `json:"metadata,omitempty"`
+ Items []IntegrationKit `json:"items"`
+}
+
+// IntegrationKitPhase --
+type IntegrationKitPhase string
+
+const (
+ // IntegrationKindKind --
+ IntegrationKindKind string = "IntegrationKit"
+
+ // IntegrationKitTypePlatform --
+ IntegrationKitTypePlatform = "platform"
+
+ // IntegrationKitTypeUser --
+ IntegrationKitTypeUser = "user"
+
+ // IntegrationKitTypeExternal --
+ IntegrationKitTypeExternal = "external"
+
+ // IntegrationKitPhaseBuildSubmitted --
+ IntegrationKitPhaseBuildSubmitted IntegrationKitPhase = "Build Submitted"
+ // IntegrationKitPhaseBuildRunning --
+ IntegrationKitPhaseBuildRunning IntegrationKitPhase = "Build Running"
+ // IntegrationKitPhaseReady --
+ IntegrationKitPhaseReady IntegrationKitPhase = "Ready"
+ // IntegrationKitPhaseError --
+ IntegrationKitPhaseError IntegrationKitPhase = "Error"
+)
+
+func init() {
+ SchemeBuilder.Register(&IntegrationKit{}, &IntegrationKitList{})
+}
diff --git a/pkg/apis/camel/v1alpha1/integrationcontext_types_support.go b/pkg/apis/camel/v1alpha1/integrationkit_types_support.go
similarity index 73%
rename from pkg/apis/camel/v1alpha1/integrationcontext_types_support.go
rename to pkg/apis/camel/v1alpha1/integrationkit_types_support.go
index 3a0b614..46ce1fe 100644
--- a/pkg/apis/camel/v1alpha1/integrationcontext_types_support.go
+++ b/pkg/apis/camel/v1alpha1/integrationkit_types_support.go
@@ -19,12 +19,12 @@ package v1alpha1
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-// NewIntegrationContext --
-func NewIntegrationContext(namespace string, name string) IntegrationContext {
- return IntegrationContext{
+// NewIntegrationKit --
+func NewIntegrationKit(namespace string, name string) IntegrationKit {
+ return IntegrationKit{
TypeMeta: metav1.TypeMeta{
APIVersion: SchemeGroupVersion.String(),
- Kind: IntegrationContextKind,
+ Kind: IntegrationKindKind,
},
ObjectMeta: metav1.ObjectMeta{
Namespace: namespace,
@@ -33,18 +33,18 @@ func NewIntegrationContext(namespace string, name string) IntegrationContext {
}
}
-// NewIntegrationContextList --
-func NewIntegrationContextList() IntegrationContextList {
- return IntegrationContextList{
+// NewIntegrationKitList --
+func NewIntegrationKitList() IntegrationKitList {
+ return IntegrationKitList{
TypeMeta: metav1.TypeMeta{
APIVersion: SchemeGroupVersion.String(),
- Kind: IntegrationContextKind,
+ Kind: IntegrationKindKind,
},
}
}
// ImageForIntegration returns the image to use when using it for running an integration
-func (in *IntegrationContext) ImageForIntegration() string {
+func (in *IntegrationKit) ImageForIntegration() string {
if in.Status.PublicImage != "" {
return in.Status.PublicImage
}
@@ -52,7 +52,7 @@ func (in *IntegrationContext) ImageForIntegration() string {
}
// Configurations --
-func (in *IntegrationContextSpec) Configurations() []ConfigurationSpec {
+func (in *IntegrationKitSpec) Configurations() []ConfigurationSpec {
if in == nil {
return []ConfigurationSpec{}
}
@@ -61,7 +61,7 @@ func (in *IntegrationContextSpec) Configurations() []ConfigurationSpec {
}
// Configurations --
-func (in *IntegrationContext) Configurations() []ConfigurationSpec {
+func (in *IntegrationKit) Configurations() []ConfigurationSpec {
if in == nil {
return []ConfigurationSpec{}
}
diff --git a/pkg/apis/camel/v1alpha1/integrationplatform_types.go b/pkg/apis/camel/v1alpha1/integrationplatform_types.go
index 9ca8a17..1cf959d 100644
--- a/pkg/apis/camel/v1alpha1/integrationplatform_types.go
+++ b/pkg/apis/camel/v1alpha1/integrationplatform_types.go
@@ -34,7 +34,7 @@ type IntegrationPlatformSpec struct {
// IntegrationPlatformResourcesSpec contains platform related resources
type IntegrationPlatformResourcesSpec struct {
- Contexts []string `json:"contexts,omitempty"`
+ Kits []string `json:"kits,omitempty"`
}
// IntegrationPlatformStatus defines the observed state of IntegrationPlatform
diff --git a/pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go
index fab12d9..60e0f48 100644
--- a/pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go
+++ b/pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go
@@ -482,7 +482,7 @@ func (in *Integration) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *IntegrationContext) DeepCopyInto(out *IntegrationContext) {
+func (in *IntegrationKit) DeepCopyInto(out *IntegrationKit) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
@@ -491,18 +491,18 @@ func (in *IntegrationContext) DeepCopyInto(out *IntegrationContext) {
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntegrationContext.
-func (in *IntegrationContext) DeepCopy() *IntegrationContext {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntegrationKit.
+func (in *IntegrationKit) DeepCopy() *IntegrationKit {
if in == nil {
return nil
}
- out := new(IntegrationContext)
+ out := new(IntegrationKit)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *IntegrationContext) DeepCopyObject() runtime.Object {
+func (in *IntegrationKit) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
@@ -510,13 +510,13 @@ func (in *IntegrationContext) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *IntegrationContextList) DeepCopyInto(out *IntegrationContextList) {
+func (in *IntegrationKitList) DeepCopyInto(out *IntegrationKitList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
- *out = make([]IntegrationContext, len(*in))
+ *out = make([]IntegrationKit, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
@@ -524,18 +524,18 @@ func (in *IntegrationContextList) DeepCopyInto(out *IntegrationContextList) {
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntegrationContextList.
-func (in *IntegrationContextList) DeepCopy() *IntegrationContextList {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntegrationKitList.
+func (in *IntegrationKitList) DeepCopy() *IntegrationKitList {
if in == nil {
return nil
}
- out := new(IntegrationContextList)
+ out := new(IntegrationKitList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *IntegrationContextList) DeepCopyObject() runtime.Object {
+func (in *IntegrationKitList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
@@ -543,7 +543,7 @@ func (in *IntegrationContextList) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *IntegrationContextSpec) DeepCopyInto(out *IntegrationContextSpec) {
+func (in *IntegrationKitSpec) DeepCopyInto(out *IntegrationKitSpec) {
*out = *in
if in.Dependencies != nil {
in, out := &in.Dependencies, &out.Dependencies
@@ -570,18 +570,18 @@ func (in *IntegrationContextSpec) DeepCopyInto(out *IntegrationContextSpec) {
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntegrationContextSpec.
-func (in *IntegrationContextSpec) DeepCopy() *IntegrationContextSpec {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntegrationKitSpec.
+func (in *IntegrationKitSpec) DeepCopy() *IntegrationKitSpec {
if in == nil {
return nil
}
- out := new(IntegrationContextSpec)
+ out := new(IntegrationKitSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *IntegrationContextStatus) DeepCopyInto(out *IntegrationContextStatus) {
+func (in *IntegrationKitStatus) DeepCopyInto(out *IntegrationKitStatus) {
*out = *in
if in.Artifacts != nil {
in, out := &in.Artifacts, &out.Artifacts
@@ -596,12 +596,12 @@ func (in *IntegrationContextStatus) DeepCopyInto(out *IntegrationContextStatus)
return
}
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntegrationContextStatus.
-func (in *IntegrationContextStatus) DeepCopy() *IntegrationContextStatus {
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntegrationKitStatus.
+func (in *IntegrationKitStatus) DeepCopy() *IntegrationKitStatus {
if in == nil {
return nil
}
- out := new(IntegrationContextStatus)
+ out := new(IntegrationKitStatus)
in.DeepCopyInto(out)
return out
}
@@ -745,8 +745,8 @@ func (in *IntegrationPlatformRegistrySpec) DeepCopy() *IntegrationPlatformRegist
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *IntegrationPlatformResourcesSpec) DeepCopyInto(out *IntegrationPlatformResourcesSpec) {
*out = *in
- if in.Contexts != nil {
- in, out := &in.Contexts, &out.Contexts
+ if in.Kits != nil {
+ in, out := &in.Kits, &out.Kits
*out = make([]string, len(*in))
copy(*out, *in)
}
diff --git a/pkg/builder/builder.go b/pkg/builder/builder.go
index 41064f8..52cb7b9 100644
--- a/pkg/builder/builder.go
+++ b/pkg/builder/builder.go
@@ -156,7 +156,7 @@ func (b *defaultBuilder) Build(build v1alpha1.BuildSpec) v1alpha1.BuildStatus {
l := b.log.WithValues(
"step", step.ID(),
"phase", step.Phase(),
- "context", build.Meta.Name,
+ "kit", build.Meta.Name,
)
l.Infof("executing step")
diff --git a/pkg/builder/builder_steps.go b/pkg/builder/builder_steps.go
index 0b50b15..32d0890 100644
--- a/pkg/builder/builder_steps.go
+++ b/pkg/builder/builder_steps.go
@@ -392,7 +392,7 @@ func packager(ctx *Context, selector ArtifactsSelector) error {
}
func listPublishedImages(context *Context) ([]publishedImage, error) {
- list := v1alpha1.NewIntegrationContextList()
+ list := v1alpha1.NewIntegrationKitList()
err := context.Client.List(context.C, &k8sclient.ListOptions{Namespace: context.Namespace}, &list)
if err != nil {
@@ -401,31 +401,28 @@ func listPublishedImages(context *Context) ([]publishedImage, error) {
images := make([]publishedImage, 0)
for _, item := range list.Items {
- ctx := item
+ kit := item
- if ctx.Status.Phase != v1alpha1.IntegrationContextPhaseReady {
+ if kit.Status.Phase != v1alpha1.IntegrationKitPhaseReady {
continue
}
- if ctx.Status.CamelVersion != context.Catalog.Version {
+ if kit.Status.CamelVersion != context.Catalog.Version {
continue
}
- if ctx.Status.RuntimeVersion != context.Build.RuntimeVersion {
+ if kit.Status.RuntimeVersion != context.Build.RuntimeVersion {
continue
}
- if ctx.Status.Phase != v1alpha1.IntegrationContextPhaseReady || ctx.Labels == nil {
+ if kit.Status.Phase != v1alpha1.IntegrationKitPhaseReady || kit.Labels == nil {
continue
}
- if context.ContextFilter != nil && !context.ContextFilter(&ctx) {
- continue
- }
- if ctxType, present := ctx.Labels["camel.apache.org/context.type"]; !present || ctxType != v1alpha1.IntegrationContextTypePlatform {
+ if ctxType, present := kit.Labels["camel.apache.org/kit.type"]; !present || ctxType != v1alpha1.IntegrationKitTypePlatform {
continue
}
images = append(images, publishedImage{
- Image: ctx.Status.Image,
- Artifacts: ctx.Status.Artifacts,
- Dependencies: ctx.Spec.Dependencies,
+ Image: kit.Status.Image,
+ Artifacts: kit.Status.Artifacts,
+ Dependencies: kit.Spec.Dependencies,
})
}
return images, nil
diff --git a/pkg/builder/builder_steps_test.go b/pkg/builder/builder_steps_test.go
index b576f8d..9754f64 100644
--- a/pkg/builder/builder_steps_test.go
+++ b/pkg/builder/builder_steps_test.go
@@ -328,38 +328,38 @@ func TestListPublishedImages(t *testing.T) {
assert.Nil(t, err)
c, err := test.NewFakeClient(
- &v1alpha1.IntegrationContext{
+ &v1alpha1.IntegrationKit{
TypeMeta: metav1.TypeMeta{
APIVersion: v1alpha1.SchemeGroupVersion.String(),
- Kind: v1alpha1.IntegrationContextKind,
+ Kind: v1alpha1.IntegrationKindKind,
},
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns",
- Name: "my-context-1",
+ Name: "my-kit-1",
Labels: map[string]string{
- "camel.apache.org/context.type": v1alpha1.IntegrationContextTypePlatform,
+ "camel.apache.org/kit.type": v1alpha1.IntegrationKitTypePlatform,
},
},
- Status: v1alpha1.IntegrationContextStatus{
- Phase: v1alpha1.IntegrationContextPhaseError,
+ Status: v1alpha1.IntegrationKitStatus{
+ Phase: v1alpha1.IntegrationKitPhaseError,
Image: "image-1",
CamelVersion: catalog.Version,
},
},
- &v1alpha1.IntegrationContext{
+ &v1alpha1.IntegrationKit{
TypeMeta: metav1.TypeMeta{
APIVersion: v1alpha1.SchemeGroupVersion.String(),
- Kind: v1alpha1.IntegrationContextKind,
+ Kind: v1alpha1.IntegrationKindKind,
},
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns",
- Name: "my-context-2",
+ Name: "my-kit-2",
Labels: map[string]string{
- "camel.apache.org/context.type": v1alpha1.IntegrationContextTypePlatform,
+ "camel.apache.org/kit.type": v1alpha1.IntegrationKitTypePlatform,
},
},
- Status: v1alpha1.IntegrationContextStatus{
- Phase: v1alpha1.IntegrationContextPhaseReady,
+ Status: v1alpha1.IntegrationKitStatus{
+ Phase: v1alpha1.IntegrationKitPhaseReady,
Image: "image-2",
CamelVersion: catalog.Version,
},
diff --git a/pkg/builder/builder_types.go b/pkg/builder/builder_types.go
index 549e9aa..1ad1a19 100644
--- a/pkg/builder/builder_types.go
+++ b/pkg/builder/builder_types.go
@@ -111,7 +111,6 @@ type Context struct {
Artifacts []v1alpha1.Artifact
SelectedArtifacts []v1alpha1.Artifact
Archive string
- ContextFilter func(integrationContext *v1alpha1.IntegrationContext) bool
Resources []Resource
Maven struct {
diff --git a/pkg/cmd/completion_bash.go b/pkg/cmd/completion_bash.go
index 25f0733..58d1aaa 100644
--- a/pkg/cmd/completion_bash.go
+++ b/pkg/cmd/completion_bash.go
@@ -130,31 +130,31 @@ __kamel_kubectl_get_integrations() {
fi
}
-__kamel_kubectl_get_integrationcontexts() {
+__kamel_kubectl_get_integrationkits() {
local template
local kubectl_out
template="{{ range .items }}{{ .metadata.name }} {{ end }}"
- if kubectl_out=$(kubectl get -o template --template="${template}" integrationcontexts 2>/dev/null); then
+ if kubectl_out=$(kubectl get -o template --template="${template}" integrationkits 2>/dev/null); then
COMPREPLY=( $( compgen -W "${kubectl_out}" -- "$cur" ) )
fi
}
-__kamel_kubectl_get_non_platform_integrationcontexts() {
+__kamel_kubectl_get_non_platform_integrationkits() {
local template
local kubectl_out
template="{{ range .items }}{{ .metadata.name }} {{ end }}"
- label_condition="camel.apache.org/context.type!=platform"
+ label_condition="camel.apache.org/kit.type!=platform"
- if kubectl_out=$(kubectl get -l ${label_condition} -o template --template="${template}" integrationcontexts 2>/dev/null); then
+ if kubectl_out=$(kubectl get -l ${label_condition} -o template --template="${template}" integrationkits 2>/dev/null); then
COMPREPLY=( $( compgen -W "${kubectl_out}" -- "$cur" ) )
fi
}
-__kamel_kubectl_get_known_integrationcontexts() {
- local type_list="` + strings.Join(platform.GetContextsNames(), " ") + `"
+__kamel_kubectl_get_known_integrationkits() {
+ local type_list="` + strings.Join(platform.GetKitsNames(), " ") + `"
COMPREPLY=( $( compgen -W "${type_list}" -- "$cur") )
compopt -o nospace
}
@@ -169,8 +169,8 @@ __custom_func() {
__kamel_kubectl_get_integrations
return
;;
- kamel_context_delete)
- __kamel_kubectl_get_non_platform_integrationcontexts
+ kamel_kit_delete)
+ __kamel_kubectl_get_non_platform_integrationkits
return
;;
*)
@@ -223,9 +223,9 @@ func configureKnownBashCompletions(command *cobra.Command) {
)
configureBashAnnotationForFlag(
command,
- "context",
+ "kit",
map[string][]string{
- cobra.BashCompCustom: {"__kamel_kubectl_get_non_platform_integrationcontexts"},
+ cobra.BashCompCustom: {"__kamel_kubectl_get_non_platform_integrationkits"},
},
)
configureBashAnnotationForFlag(
diff --git a/pkg/cmd/describe.go b/pkg/cmd/describe.go
index 95c59c6..b726138 100644
--- a/pkg/cmd/describe.go
+++ b/pkg/cmd/describe.go
@@ -111,7 +111,7 @@ func newCmdDescribe(rootCmdOptions *RootCmdOptions) *cobra.Command {
Long: `Describe a Camel K resource.`,
}
- cmd.AddCommand(newDescribeContextCmd(rootCmdOptions))
+ cmd.AddCommand(newDescribeKitCmd(rootCmdOptions))
cmd.AddCommand(newDescribeIntegrationCmd(rootCmdOptions))
cmd.AddCommand(newDescribePlatformCmd(rootCmdOptions))
diff --git a/pkg/cmd/describe_integration.go b/pkg/cmd/describe_integration.go
index 1356d8b..393a6f7 100644
--- a/pkg/cmd/describe_integration.go
+++ b/pkg/cmd/describe_integration.go
@@ -92,7 +92,7 @@ func (command *describeIntegrationCommand) describeIntegration(i v1alpha1.Integr
w.write(0, "Phase:\t%s\n", i.Status.Phase)
w.write(0, "Camel Version:\t%s\n", i.Status.CamelVersion)
- w.write(0, "Context:\t%s\n", i.Status.Context)
+ w.write(0, "Kit:\t%s\n", i.Status.Kit)
w.write(0, "Image:\t%s\n", i.Status.Image)
if len(i.Spec.Configuration) > 0 {
diff --git a/pkg/cmd/describe_context.go b/pkg/cmd/describe_kit.go
similarity index 59%
rename from pkg/cmd/describe_context.go
rename to pkg/cmd/describe_kit.go
index 552eb40..8211d79 100644
--- a/pkg/cmd/describe_context.go
+++ b/pkg/cmd/describe_kit.go
@@ -26,16 +26,16 @@ import (
k8sclient "sigs.k8s.io/controller-runtime/pkg/client"
)
-func newDescribeContextCmd(rootCmdOptions *RootCmdOptions) *cobra.Command {
+func newDescribeKitCmd(rootCmdOptions *RootCmdOptions) *cobra.Command {
- impl := &describeContextCommand{
+ impl := &describeKitCommand{
rootCmdOptions,
}
cmd := cobra.Command{
- Use: "context",
- Short: "Describe an Integration Context",
- Long: `Describe an Integration Context.`,
+ Use: "kit",
+ Short: "Describe an Integration Kit",
+ Long: `Describe an Integration Kit.`,
RunE: func(_ *cobra.Command, args []string) error {
if err := impl.validate(args); err != nil {
return err
@@ -51,77 +51,77 @@ func newDescribeContextCmd(rootCmdOptions *RootCmdOptions) *cobra.Command {
return &cmd
}
-type describeContextCommand struct {
+type describeKitCommand struct {
*RootCmdOptions
}
-func (command *describeContextCommand) validate(args []string) error {
+func (command *describeKitCommand) validate(args []string) error {
if len(args) != 1 {
return fmt.Errorf("accepts at least 1 arg, received %d", len(args))
}
return nil
}
-func (command *describeContextCommand) run(args []string) error {
+func (command *describeKitCommand) run(args []string) error {
c, err := command.GetCmdClient()
if err != nil {
return err
}
- ctx := v1alpha1.NewIntegrationContext(command.Namespace, args[0])
- key := k8sclient.ObjectKey{
+ kit := v1alpha1.NewIntegrationKit(command.Namespace, args[0])
+ kitKey := k8sclient.ObjectKey{
Namespace: command.Namespace,
Name: args[0],
}
- if err := c.Get(command.Context, key, &ctx); err == nil {
- fmt.Print(command.describeIntegrationContext(ctx))
+ if err := c.Get(command.Context, kitKey, &kit); err == nil {
+ fmt.Print(command.describeIntegrationKit(kit))
} else {
- fmt.Printf("IntegrationContext '%s' does not exist.\n", args[0])
+ fmt.Printf("IntegrationKit '%s' does not exist.\n", args[0])
}
return nil
}
-func (command *describeContextCommand) describeIntegrationContext(i v1alpha1.IntegrationContext) string {
+func (command *describeKitCommand) describeIntegrationKit(kit v1alpha1.IntegrationKit) string {
return indentedString(func(out io.Writer) {
w := newIndentedWriter(out)
- describeObjectMeta(w, i.ObjectMeta)
+ describeObjectMeta(w, kit.ObjectMeta)
- w.write(0, "Phase:\t%s\n", i.Status.Phase)
- w.write(0, "Camel Version:\t%s\n", i.Status.CamelVersion)
- w.write(0, "Image:\t%s\n", i.Status.Image)
+ w.write(0, "Phase:\t%s\n", kit.Status.Phase)
+ w.write(0, "Camel Version:\t%s\n", kit.Status.CamelVersion)
+ w.write(0, "Image:\t%s\n", kit.Status.Image)
- if len(i.Status.Artifacts) > 0 {
+ if len(kit.Status.Artifacts) > 0 {
w.write(0, "Artifacts:\t\n")
- for _, artifact := range i.Status.Artifacts {
+ for _, artifact := range kit.Status.Artifacts {
w.write(1, "%s\n", artifact.ID)
}
}
- if len(i.Spec.Configuration) > 0 {
+ if len(kit.Spec.Configuration) > 0 {
w.write(0, "Configuration:\n")
- for _, config := range i.Spec.Configuration {
+ for _, config := range kit.Spec.Configuration {
w.write(1, "Type:\t%s\n", config.Type)
w.write(1, "Value:\t%s\n", config.Value)
}
}
- if len(i.Spec.Dependencies) > 0 {
+ if len(kit.Spec.Dependencies) > 0 {
w.write(0, "Dependencies:\t\n")
- for _, dependency := range i.Spec.Dependencies {
+ for _, dependency := range kit.Spec.Dependencies {
w.write(1, "%s\n", dependency)
}
}
- if len(i.Spec.Repositories) > 0 {
+ if len(kit.Spec.Repositories) > 0 {
w.write(0, "Repositories:\n")
- for _, repository := range i.Spec.Repositories {
+ for _, repository := range kit.Spec.Repositories {
w.write(1, "%s\n", repository)
}
}
- describeTraits(w, i.Spec.Traits)
+ describeTraits(w, kit.Spec.Traits)
})
}
diff --git a/pkg/cmd/describe_platform.go b/pkg/cmd/describe_platform.go
index f9d5002..17c0d2b 100644
--- a/pkg/cmd/describe_platform.go
+++ b/pkg/cmd/describe_platform.go
@@ -27,7 +27,6 @@ import (
)
func newDescribePlatformCmd(rootCmdOptions *RootCmdOptions) *cobra.Command {
-
impl := &describePlatformCommand{
rootCmdOptions,
}
@@ -68,14 +67,14 @@ func (command *describePlatformCommand) run(args []string) error {
return err
}
- ctx := v1alpha1.NewIntegrationPlatform(command.Namespace, args[0])
- key := k8sclient.ObjectKey{
+ platform := v1alpha1.NewIntegrationPlatform(command.Namespace, args[0])
+ platformKey := k8sclient.ObjectKey{
Namespace: command.Namespace,
Name: args[0],
}
- if err := c.Get(command.Context, key, &ctx); err == nil {
- fmt.Print(command.describeIntegrationPlatform(ctx))
+ if err := c.Get(command.Context, platformKey, &platform); err == nil {
+ fmt.Print(command.describeIntegrationPlatform(platform))
} else {
fmt.Printf("IntegrationPlatform '%s' does not exist.\n", args[0])
}
@@ -83,21 +82,21 @@ func (command *describePlatformCommand) run(args []string) error {
return nil
}
-func (command *describePlatformCommand) describeIntegrationPlatform(i v1alpha1.IntegrationPlatform) string {
+func (command *describePlatformCommand) describeIntegrationPlatform(platform v1alpha1.IntegrationPlatform) string {
return indentedString(func(out io.Writer) {
w := newIndentedWriter(out)
- describeObjectMeta(w, i.ObjectMeta)
- w.write(0, "Phase:\t%s\n", i.Status.Phase)
- w.write(0, "Base Image:\t%s\n", i.Spec.Build.BaseImage)
- w.write(0, "Camel Version:\t%s\n", i.Spec.Build.CamelVersion)
- w.write(0, "Local Repository:\t%s\n", i.Spec.Build.LocalRepository)
- w.write(0, "Publish Strategy:\t%s\n", i.Spec.Build.PublishStrategy)
-
- if len(i.Spec.Resources.Contexts) > 0 {
+ describeObjectMeta(w, platform.ObjectMeta)
+ w.write(0, "Phase:\t%s\n", platform.Status.Phase)
+ w.write(0, "Base Image:\t%s\n", platform.Spec.Build.BaseImage)
+ w.write(0, "Camel Version:\t%s\n", platform.Spec.Build.CamelVersion)
+ w.write(0, "Local Repository:\t%s\n", platform.Spec.Build.LocalRepository)
+ w.write(0, "Publish Strategy:\t%s\n", platform.Spec.Build.PublishStrategy)
+
+ if len(platform.Spec.Resources.Kits) > 0 {
w.write(0, "Resources:\n")
- w.write(1, "Contexts:\n")
- for _, context := range i.Spec.Resources.Contexts {
- w.write(2, "%s\n", context)
+ w.write(1, "Kits:\n")
+ for _, kit := range platform.Spec.Resources.Kits {
+ w.write(2, "%s\n", kit)
}
}
})
diff --git a/pkg/cmd/get.go b/pkg/cmd/get.go
index 636eb53..8a13d73 100644
--- a/pkg/cmd/get.go
+++ b/pkg/cmd/get.go
@@ -70,7 +70,7 @@ func (o *getCmdOptions) run(_ *cobra.Command, _ []string) error {
w := tabwriter.NewWriter(os.Stdout, 0, 8, 1, '\t', 0)
fmt.Fprintln(w, "NAME\tPHASE\tCONTEXT")
for _, integration := range integrationList.Items {
- fmt.Fprintf(w, "%s\t%s\t%s\n", integration.Name, string(integration.Status.Phase), integration.Status.Context)
+ fmt.Fprintf(w, "%s\t%s\t%s\n", integration.Name, string(integration.Status.Phase), integration.Status.Kit)
}
w.Flush()
diff --git a/pkg/cmd/install.go b/pkg/cmd/install.go
index 65d6b67..d8c313f 100644
--- a/pkg/cmd/install.go
+++ b/pkg/cmd/install.go
@@ -74,7 +74,7 @@ func newCmdInstall(rootCmdOptions *RootCmdOptions) *cobra.Command {
cmd.Flags().StringVar(&impl.runtimeVersion, "runtime-version", "", "Set the camel-k runtime version")
cmd.Flags().StringVar(&impl.baseImage, "base-image", "", "Set the base image used to run integrations")
cmd.Flags().StringVar(&impl.operatorImage, "operator-image", "", "Set the operator image used for the operator deployment")
- cmd.Flags().StringSliceVar(&impl.contexts, "context", nil, "Add a camel context to build at startup, by default all known contexts are built")
+ cmd.Flags().StringSliceVar(&impl.kits, "kit", nil, "Add an integration kit to build at startup")
cmd.Flags().StringVar(&impl.buildStrategy, "build-strategy", "", "Set the build strategy")
cmd.Flags().StringVar(&impl.buildTimeout, "build-timeout", "", "Set how long the build process can last")
@@ -113,7 +113,7 @@ type installCmdOptions struct {
mavenRepositories []string
mavenSettings string
properties []string
- contexts []string
+ kits []string
registry v1alpha1.IntegrationPlatformRegistrySpec
}
@@ -269,7 +269,7 @@ func (o *installCmdOptions) install(_ *cobra.Command, _ []string) error {
platform.Spec.Build.Maven.Settings = mavenSettings
}
- platform.Spec.Resources.Contexts = o.contexts
+ platform.Spec.Resources.Kits = o.kits
err = install.RuntimeObjectOrCollect(o.Context, c, namespace, collection, platform)
if err != nil {
@@ -354,22 +354,20 @@ func (o *installCmdOptions) validate(_ *cobra.Command, _ []string) error {
return err
}
- if o.contexts == nil {
- return nil
- }
- for _, context := range o.contexts {
- err := errorIfContextIsNotAvailable(schema, context)
+ for _, kit := range o.kits {
+ err := errorIfKitIsNotAvailable(schema, kit)
result = multierr.Append(result, err)
}
if len(o.mavenRepositories) > 0 && o.mavenSettings != "" {
- result = fmt.Errorf("incompatible options combinations: you cannot set both mavenRepository and mavenSettings")
+ err := fmt.Errorf("incompatible options combinations: you cannot set both mavenRepository and mavenSettings")
+ result = multierr.Append(result, err)
}
return result
}
-func errorIfContextIsNotAvailable(schema *runtime.Scheme, context string) error {
+func errorIfKitIsNotAvailable(schema *runtime.Scheme, context string) error {
for _, resource := range deploy.Resources {
resource, err := kubernetes.LoadResourceFromYaml(schema, resource)
if err != nil {
@@ -377,11 +375,11 @@ func errorIfContextIsNotAvailable(schema *runtime.Scheme, context string) error
continue
}
kind := resource.GetObjectKind().GroupVersionKind()
- if kind.Kind != "IntegrationContext" {
+ if kind.Kind != "IntegrationKit" {
continue
}
- integrationContext := resource.(*v1alpha1.IntegrationContext)
- if integrationContext.Name == context {
+ integrationKit := resource.(*v1alpha1.IntegrationKit)
+ if integrationKit.Name == context {
return nil
}
}
diff --git a/pkg/cmd/context.go b/pkg/cmd/kit.go
similarity index 71%
rename from pkg/cmd/context.go
rename to pkg/cmd/kit.go
index 7fa66ed..67d7ef1 100644
--- a/pkg/cmd/context.go
+++ b/pkg/cmd/kit.go
@@ -21,16 +21,16 @@ import (
"github.com/spf13/cobra"
)
-func newCmdContext(rootCmdOptions *RootCmdOptions) *cobra.Command {
+func newCmdKit(rootCmdOptions *RootCmdOptions) *cobra.Command {
cmd := cobra.Command{
- Use: "context",
- Short: "Configure an Integration Context",
- Long: `Configure an Integration Context.`,
+ Use: "kit",
+ Short: "Configure an Integration Kit",
+ Long: `Configure an Integration Kit.`,
}
- cmd.AddCommand(newContextCreateCmd(rootCmdOptions))
- cmd.AddCommand(newContextDeleteCmd(rootCmdOptions))
- cmd.AddCommand(newContextGetCmd(rootCmdOptions))
+ cmd.AddCommand(newKitCreateCmd(rootCmdOptions))
+ cmd.AddCommand(newKitDeleteCmd(rootCmdOptions))
+ cmd.AddCommand(newKitGetCmd(rootCmdOptions))
return &cmd
}
diff --git a/pkg/cmd/context_create.go b/pkg/cmd/kit_create.go
similarity index 78%
rename from pkg/cmd/context_create.go
rename to pkg/cmd/kit_create.go
index 059497b..d7710c3 100644
--- a/pkg/cmd/context_create.go
+++ b/pkg/cmd/kit_create.go
@@ -35,22 +35,21 @@ import (
k8sclient "sigs.k8s.io/controller-runtime/pkg/client"
)
-// NewCmdContext --
-func newContextCreateCmd(rootCmdOptions *RootCmdOptions) *cobra.Command {
- impl := &contextCreateCommand{
+func newKitCreateCmd(rootCmdOptions *RootCmdOptions) *cobra.Command {
+ impl := &kitCreateCommand{
RootCmdOptions: rootCmdOptions,
}
cmd := cobra.Command{
Use: "create",
- Short: "Create an Integration Context",
- Long: `Create an Integration Context.`,
+ Short: "Create an Integration Kit",
+ Long: `Create an Integration Kit.`,
Args: impl.validateArgs,
RunE: impl.run,
}
- cmd.Flags().StringVarP(&impl.runtime, "runtime", "r", "jvm", "Runtime provided by the context")
- cmd.Flags().StringVar(&impl.image, "image", "", "Image used to create the context")
+ cmd.Flags().StringVarP(&impl.runtime, "runtime", "r", "jvm", "Runtime provided by the kit")
+ cmd.Flags().StringVar(&impl.image, "image", "", "Image used to create the kit")
cmd.Flags().StringSliceVarP(&impl.dependencies, "dependency", "d", nil, "Add a dependency")
cmd.Flags().StringSliceVarP(&impl.properties, "property", "p", nil, "Add a camel property")
cmd.Flags().StringSliceVar(&impl.configmaps, "configmap", nil, "Add a ConfigMap")
@@ -64,7 +63,7 @@ func newContextCreateCmd(rootCmdOptions *RootCmdOptions) *cobra.Command {
return &cmd
}
-type contextCreateCommand struct {
+type kitCreateCommand struct {
*RootCmdOptions
runtime string
@@ -77,7 +76,7 @@ type contextCreateCommand struct {
traits []string
}
-func (command *contextCreateCommand) validateArgs(_ *cobra.Command, args []string) error {
+func (command *kitCreateCommand) validateArgs(_ *cobra.Command, args []string) error {
if len(args) != 1 {
return errors.New("accepts 1 arg, received " + strconv.Itoa(len(args)))
}
@@ -85,7 +84,7 @@ func (command *contextCreateCommand) validateArgs(_ *cobra.Command, args []strin
return nil
}
-func (command *contextCreateCommand) run(_ *cobra.Command, args []string) error {
+func (command *kitCreateCommand) run(_ *cobra.Command, args []string) error {
c, err := command.GetCmdClient()
if err != nil {
return err
@@ -102,26 +101,26 @@ func (command *contextCreateCommand) run(_ *cobra.Command, args []string) error
}
}
- ctx := v1alpha1.NewIntegrationContext(command.Namespace, args[0])
+ ctx := v1alpha1.NewIntegrationKit(command.Namespace, args[0])
key := k8sclient.ObjectKey{
Namespace: command.Namespace,
Name: args[0],
}
if err := c.Get(command.Context, key, &ctx); err == nil {
- // the integration context already exists, let's check that it is
+ // the integration kit already exists, let's check that it is
// not a platform one which is supposed to be "read only"
- if ctx.Labels["camel.apache.org/context.type"] == v1alpha1.IntegrationContextTypePlatform {
- fmt.Printf("integration context \"%s\" is not editable\n", ctx.Name)
+ if ctx.Labels["camel.apache.org/kit.type"] == v1alpha1.IntegrationKitTypePlatform {
+ fmt.Printf("integration kit \"%s\" is not editable\n", ctx.Name)
return nil
}
}
- ctx = v1alpha1.NewIntegrationContext(command.Namespace, kubernetes.SanitizeName(args[0]))
+ ctx = v1alpha1.NewIntegrationKit(command.Namespace, kubernetes.SanitizeName(args[0]))
ctx.Labels = map[string]string{
- "camel.apache.org/context.type": v1alpha1.IntegrationContextTypeUser,
+ "camel.apache.org/kit.type": v1alpha1.IntegrationKitTypeUser,
}
- ctx.Spec = v1alpha1.IntegrationContextSpec{
+ ctx.Spec = v1alpha1.IntegrationKitSpec{
Dependencies: make([]string, 0, len(command.dependencies)),
Configuration: make([]v1alpha1.ConfigurationSpec, 0),
Repositories: command.repositories,
@@ -129,14 +128,14 @@ func (command *contextCreateCommand) run(_ *cobra.Command, args []string) error
if command.image != "" {
//
- // if the image is set, the context do not require any build but
+ // if the image is set, the kit do not require any build but
// is be marked as external as the information about the classpath
- // is missing so it cannot be used as base for other contexts
+ // is missing so it cannot be used as base for other kits
//
- ctx.Labels["camel.apache.org/context.type"] = v1alpha1.IntegrationContextTypeExternal
+ ctx.Labels["camel.apache.org/kit.type"] = v1alpha1.IntegrationKitTypeExternal
//
- // Set the image to be used by the context
+ // Set the image to be used by the kit
//
ctx.Spec.Image = command.image
}
@@ -202,15 +201,15 @@ func (command *contextCreateCommand) run(_ *cobra.Command, args []string) error
}
if !existed {
- fmt.Printf("integration context \"%s\" created\n", ctx.Name)
+ fmt.Printf("integration kit \"%s\" created\n", ctx.Name)
} else {
- fmt.Printf("integration context \"%s\" updated\n", ctx.Name)
+ fmt.Printf("integration kit \"%s\" updated\n", ctx.Name)
}
return nil
}
-func (*contextCreateCommand) configureTrait(ctx *v1alpha1.IntegrationContext, config string) error {
+func (*kitCreateCommand) configureTrait(ctx *v1alpha1.IntegrationKit, config string) error {
if ctx.Spec.Traits == nil {
ctx.Spec.Traits = make(map[string]v1alpha1.TraitSpec)
}
diff --git a/pkg/cmd/context_delete.go b/pkg/cmd/kit_delete.go
similarity index 63%
rename from pkg/cmd/context_delete.go
rename to pkg/cmd/kit_delete.go
index 40ebe5b..5cec11e 100644
--- a/pkg/cmd/context_delete.go
+++ b/pkg/cmd/kit_delete.go
@@ -29,15 +29,15 @@ import (
k8errors "k8s.io/apimachinery/pkg/api/errors"
)
-func newContextDeleteCmd(rootCmdOptions *RootCmdOptions) *cobra.Command {
- impl := contextDeleteCommand{
+func newKitDeleteCmd(rootCmdOptions *RootCmdOptions) *cobra.Command {
+ impl := kitDeleteCommand{
RootCmdOptions: rootCmdOptions,
}
cmd := cobra.Command{
Use: "delete",
- Short: "Delete an Integration Context",
- Long: `Delete an Integration Context.`,
+ Short: "Delete an Integration Kit",
+ Long: `Delete an Integration Kit.`,
RunE: func(_ *cobra.Command, args []string) error {
if err := impl.validate(args); err != nil {
return err
@@ -50,28 +50,28 @@ func newContextDeleteCmd(rootCmdOptions *RootCmdOptions) *cobra.Command {
},
}
- cmd.Flags().BoolVar(&impl.all, "all", false, "Delete all integration contexts")
+ cmd.Flags().BoolVar(&impl.all, "all", false, "Delete all integration kits")
return &cmd
}
-type contextDeleteCommand struct {
+type kitDeleteCommand struct {
*RootCmdOptions
all bool
}
-func (command *contextDeleteCommand) validate(args []string) error {
+func (command *kitDeleteCommand) validate(args []string) error {
if command.all && len(args) > 0 {
- return errors.New("invalid combination: both all flag and named contexts are set")
+ return errors.New("invalid combination: both all flag and named kits are set")
}
if !command.all && len(args) == 0 {
- return errors.New("invalid combination: neither all flag nor named contexts are set")
+ return errors.New("invalid combination: neither all flag nor named kits are set")
}
return nil
}
-func (command *contextDeleteCommand) run(args []string) error {
+func (command *kitDeleteCommand) run(args []string) error {
names := args
c, err := command.GetCmdClient()
@@ -80,15 +80,15 @@ func (command *contextDeleteCommand) run(args []string) error {
}
if command.all {
- ctxList := v1alpha1.NewIntegrationContextList()
- if err := c.List(command.Context, &k8sclient.ListOptions{Namespace: command.Namespace}, &ctxList); err != nil {
+ kitList := v1alpha1.NewIntegrationKitList()
+ if err := c.List(command.Context, &k8sclient.ListOptions{Namespace: command.Namespace}, &kitList); err != nil {
return err
}
- names = make([]string, 0, len(ctxList.Items))
- for _, item := range ctxList.Items {
- // only include non platform contexts
- if item.Labels["camel.apache.org/context.type"] != v1alpha1.IntegrationContextTypePlatform {
+ names = make([]string, 0, len(kitList.Items))
+ for _, item := range kitList.Items {
+ // only include non platform kits
+ if item.Labels["camel.apache.org/kit.type"] != v1alpha1.IntegrationKitTypePlatform {
names = append(names, item.Name)
}
}
@@ -103,8 +103,8 @@ func (command *contextDeleteCommand) run(args []string) error {
return nil
}
-func (command *contextDeleteCommand) delete(name string) error {
- ctx := v1alpha1.NewIntegrationContext(command.Namespace, name)
+func (command *kitDeleteCommand) delete(name string) error {
+ ctx := v1alpha1.NewIntegrationKit(command.Namespace, name)
key := k8sclient.ObjectKey{
Namespace: command.Namespace,
Name: name,
@@ -116,9 +116,9 @@ func (command *contextDeleteCommand) delete(name string) error {
err = c.Get(command.Context, key, &ctx)
- // pass through if the context is not found
+ // pass through if the kit is not found
if err != nil && k8errors.IsNotFound(err) {
- return fmt.Errorf("no integration context found with name \"%s\"", ctx.Name)
+ return fmt.Errorf("no integration kit found with name \"%s\"", ctx.Name)
}
// fail otherwise
@@ -128,25 +128,25 @@ func (command *contextDeleteCommand) delete(name string) error {
// check that it is not a platform one which is supposed to be "read only"
// thus not managed by the end user
- if ctx.Labels["camel.apache.org/context.type"] == v1alpha1.IntegrationContextTypePlatform {
- // skip platform contexts while deleting all contexts
+ if ctx.Labels["camel.apache.org/kit.type"] == v1alpha1.IntegrationKitTypePlatform {
+ // skip platform kits while deleting all kits
if command.all {
return nil
}
- return fmt.Errorf("integration context \"%s\" is not editable", ctx.Name)
+ return fmt.Errorf("integration kit \"%s\" is not editable", ctx.Name)
}
err = c.Delete(command.Context, &ctx)
if err != nil && !k8errors.IsNotFound(err) {
- return fmt.Errorf("error deleting integration context \"%s\", %s", ctx.Name, err)
+ return fmt.Errorf("error deleting integration kit \"%s\", %s", ctx.Name, err)
}
if err != nil && k8errors.IsNotFound(err) {
- return fmt.Errorf("no integration context found with name \"%s\"", ctx.Name)
+ return fmt.Errorf("no integration kit found with name \"%s\"", ctx.Name)
}
- fmt.Printf("integration context \"%s\" has been deleted\n", ctx.Name)
+ fmt.Printf("integration kit \"%s\" has been deleted\n", ctx.Name)
return err
}
diff --git a/pkg/cmd/context_get.go b/pkg/cmd/kit_get.go
similarity index 61%
rename from pkg/cmd/context_get.go
rename to pkg/cmd/kit_get.go
index a0d88b1..2cc5691 100644
--- a/pkg/cmd/context_get.go
+++ b/pkg/cmd/kit_get.go
@@ -28,15 +28,15 @@ import (
"github.com/spf13/cobra"
)
-func newContextGetCmd(rootCmdOptions *RootCmdOptions) *cobra.Command {
- impl := contextGetCommand{
+func newKitGetCmd(rootCmdOptions *RootCmdOptions) *cobra.Command {
+ impl := kitGetCommand{
RootCmdOptions: rootCmdOptions,
}
cmd := cobra.Command{
Use: "get",
- Short: "Get defined Integration Context",
- Long: `Get defined Integration Context.`,
+ Short: "Get defined Integration Kit",
+ Long: `Get defined Integration Kit.`,
RunE: func(cmd *cobra.Command, args []string) error {
if err := impl.validate(cmd, args); err != nil {
return err
@@ -49,42 +49,42 @@ func newContextGetCmd(rootCmdOptions *RootCmdOptions) *cobra.Command {
},
}
- cmd.Flags().BoolVar(&impl.user, v1alpha1.IntegrationContextTypeUser, true, "Includes user contexts")
- cmd.Flags().BoolVar(&impl.external, v1alpha1.IntegrationContextTypeExternal, true, "Includes external contexts")
- cmd.Flags().BoolVar(&impl.platform, v1alpha1.IntegrationContextTypePlatform, true, "Includes platform contexts")
+ cmd.Flags().BoolVar(&impl.user, v1alpha1.IntegrationKitTypeUser, true, "Includes user kits")
+ cmd.Flags().BoolVar(&impl.external, v1alpha1.IntegrationKitTypeExternal, true, "Includes external kits")
+ cmd.Flags().BoolVar(&impl.platform, v1alpha1.IntegrationKitTypePlatform, true, "Includes platform kits")
return &cmd
}
-type contextGetCommand struct {
+type kitGetCommand struct {
*RootCmdOptions
user bool
external bool
platform bool
}
-func (command *contextGetCommand) validate(cmd *cobra.Command, args []string) error {
+func (command *kitGetCommand) validate(cmd *cobra.Command, args []string) error {
return nil
}
-func (command *contextGetCommand) run() error {
- ctxList := v1alpha1.NewIntegrationContextList()
+func (command *kitGetCommand) run() error {
+ kitList := v1alpha1.NewIntegrationKitList()
c, err := command.GetCmdClient()
if err != nil {
return err
}
- if err := c.List(command.Context, &k8sclient.ListOptions{Namespace: command.Namespace}, &ctxList); err != nil {
+ if err := c.List(command.Context, &k8sclient.ListOptions{Namespace: command.Namespace}, &kitList); err != nil {
return err
}
w := tabwriter.NewWriter(os.Stdout, 0, 8, 1, '\t', 0)
fmt.Fprintln(w, "NAME\tPHASE\tTYPE\tIMAGE")
- for _, ctx := range ctxList.Items {
- t := ctx.Labels["camel.apache.org/context.type"]
- u := command.user && t == v1alpha1.IntegrationContextTypeUser
- e := command.external && t == v1alpha1.IntegrationContextTypeExternal
- p := command.platform && t == v1alpha1.IntegrationContextTypePlatform
+ for _, ctx := range kitList.Items {
+ t := ctx.Labels["camel.apache.org/kit.type"]
+ u := command.user && t == v1alpha1.IntegrationKitTypeUser
+ e := command.external && t == v1alpha1.IntegrationKitTypeExternal
+ p := command.platform && t == v1alpha1.IntegrationKitTypePlatform
if u || e || p {
fmt.Fprintf(w, "%s\t%s\t%s\t%s\n", ctx.Name, string(ctx.Status.Phase), t, ctx.Status.Image)
diff --git a/pkg/cmd/reset.go b/pkg/cmd/reset.go
index 7d0e9e2..ad372ff 100644
--- a/pkg/cmd/reset.go
+++ b/pkg/cmd/reset.go
@@ -58,11 +58,11 @@ func (o *resetCmdOptions) reset(_ *cobra.Command, _ []string) {
}
fmt.Printf("%d integrations deleted from namespace %s\n", n, o.Namespace)
- if n, err = o.deleteAllIntegrationContexts(c); err != nil {
+ if n, err = o.deleteAllIntegrationKits(c); err != nil {
fmt.Print(err)
return
}
- fmt.Printf("%d integration contexts deleted from namespace %s\n", n, o.Namespace)
+ fmt.Printf("%d integration kits deleted from namespace %s\n", n, o.Namespace)
if err = o.resetIntegrationPlatform(c); err != nil {
fmt.Print(err)
@@ -86,15 +86,15 @@ func (o *resetCmdOptions) deleteAllIntegrations(c client.Client) (int, error) {
return len(list.Items), nil
}
-func (o *resetCmdOptions) deleteAllIntegrationContexts(c client.Client) (int, error) {
- list := v1alpha1.NewIntegrationContextList()
+func (o *resetCmdOptions) deleteAllIntegrationKits(c client.Client) (int, error) {
+ list := v1alpha1.NewIntegrationKitList()
if err := c.List(o.Context, &k8sclient.ListOptions{Namespace: o.Namespace}, &list); err != nil {
- return 0, errors.Wrap(err, fmt.Sprintf("could not retrieve integration contexts from namespace %s", o.Namespace))
+ return 0, errors.Wrap(err, fmt.Sprintf("could not retrieve integration kits from namespace %s", o.Namespace))
}
for _, i := range list.Items {
- ictx := i
- if err := c.Delete(o.Context, &ictx); err != nil {
- return 0, errors.Wrap(err, fmt.Sprintf("could not delete integration context %s from namespace %s", ictx.Name, ictx.Namespace))
+ kit := i
+ if err := c.Delete(o.Context, &kit); err != nil {
+ return 0, errors.Wrap(err, fmt.Sprintf("could not delete integration kit %s from namespace %s", kit.Name, kit.Namespace))
}
}
return len(list.Items), nil
diff --git a/pkg/cmd/root.go b/pkg/cmd/root.go
index a96972b..d6fb173 100644
--- a/pkg/cmd/root.go
+++ b/pkg/cmd/root.go
@@ -61,7 +61,7 @@ func NewKamelCommand(ctx context.Context) (*cobra.Command, error) {
cmd.AddCommand(newCmdDelete(&options))
cmd.AddCommand(newCmdInstall(&options))
cmd.AddCommand(newCmdLog(&options))
- cmd.AddCommand(newCmdContext(&options))
+ cmd.AddCommand(newCmdKit(&options))
cmd.AddCommand(newCmdReset(&options))
cmd.AddCommand(newCmdDescribe(&options))
diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go
index 9e3d4a9..374aba5 100644
--- a/pkg/cmd/run.go
+++ b/pkg/cmd/run.go
@@ -70,7 +70,7 @@ func newCmdRun(rootCmdOptions *RootCmdOptions) *cobra.Command {
cmd.Flags().StringVar(&options.IntegrationName, "name", "", "The integration name")
cmd.Flags().StringSliceVarP(&options.Dependencies, "dependency", "d", nil, "The integration dependency")
cmd.Flags().BoolVarP(&options.Wait, "wait", "w", false, "Waits for the integration to be running")
- cmd.Flags().StringVarP(&options.IntegrationContext, "context", "x", "", "The context used to run the integration")
+ cmd.Flags().StringVarP(&options.IntegrationKit, "kit", "k", "", "The kit used to run the integration")
cmd.Flags().StringArrayVarP(&options.Properties, "property", "p", nil, "Add a camel property")
cmd.Flags().StringSliceVar(&options.ConfigMaps, "configmap", nil, "Add a ConfigMap")
cmd.Flags().StringSliceVar(&options.Secrets, "secret", nil, "Add a Secret")
@@ -98,28 +98,28 @@ func newCmdRun(rootCmdOptions *RootCmdOptions) *cobra.Command {
type runCmdOptions struct {
*RootCmdOptions
- Compression bool
- Wait bool
- Logs bool
- Sync bool
- Dev bool
- DeletionPolicy string
- IntegrationContext string
- Runtime string
- IntegrationName string
- Profile string
- OutputFormat string
- Resources []string
- OpenAPIs []string
- Dependencies []string
- Properties []string
- ConfigMaps []string
- Secrets []string
- Repositories []string
- Traits []string
- LoggingLevels []string
- Volumes []string
- EnvVars []string
+ Compression bool
+ Wait bool
+ Logs bool
+ Sync bool
+ Dev bool
+ DeletionPolicy string
+ IntegrationKit string
+ Runtime string
+ IntegrationName string
+ Profile string
+ OutputFormat string
+ Resources []string
+ OpenAPIs []string
+ Dependencies []string
+ Properties []string
+ ConfigMaps []string
+ Secrets []string
+ Repositories []string
+ Traits []string
+ LoggingLevels []string
+ Volumes []string
+ EnvVars []string
}
func (o *runCmdOptions) validateArgs(_ *cobra.Command, args []string) error {
@@ -300,7 +300,7 @@ func (o *runCmdOptions) updateIntegrationCode(c client.Client, sources []string)
},
Spec: v1alpha1.IntegrationSpec{
Dependencies: make([]string, 0, len(o.Dependencies)),
- Context: o.IntegrationContext,
+ Kit: o.IntegrationKit,
Configuration: make([]v1alpha1.ConfigurationSpec, 0),
Repositories: o.Repositories,
Profile: v1alpha1.TraitProfileByName(o.Profile),
diff --git a/pkg/controller/add_integrationcontext.go b/pkg/controller/add_integrationkit.go
similarity index 87%
rename from pkg/controller/add_integrationcontext.go
rename to pkg/controller/add_integrationkit.go
index c340de9..3b0ec03 100644
--- a/pkg/controller/add_integrationcontext.go
+++ b/pkg/controller/add_integrationkit.go
@@ -17,10 +17,10 @@ limitations under the License.
package controller
import (
- "github.com/apache/camel-k/pkg/controller/integrationcontext"
+ "github.com/apache/camel-k/pkg/controller/integrationkit"
)
func init() {
// AddToManagerFuncs is a list of functions to create controllers and add them to a manager.
- AddToManagerFuncs = append(AddToManagerFuncs, integrationcontext.Add)
+ AddToManagerFuncs = append(AddToManagerFuncs, integrationkit.Add)
}
diff --git a/pkg/controller/integration/build_context.go b/pkg/controller/integration/build_kit.go
similarity index 56%
rename from pkg/controller/integration/build_context.go
rename to pkg/controller/integration/build_kit.go
index 54c3c09..0a207f6 100644
--- a/pkg/controller/integration/build_context.go
+++ b/pkg/controller/integration/build_kit.go
@@ -28,52 +28,52 @@ import (
"github.com/rs/xid"
)
-// NewBuildContextAction create an action that handles integration context build
-func NewBuildContextAction() Action {
- return &buildContextAction{}
+// NewBuildKitAction create an action that handles integration kit build
+func NewBuildKitAction() Action {
+ return &buildKitAction{}
}
-type buildContextAction struct {
+type buildKitAction struct {
baseAction
}
-func (action *buildContextAction) Name() string {
- return "build-context"
+func (action *buildKitAction) Name() string {
+ return "build-kit"
}
-func (action *buildContextAction) CanHandle(integration *v1alpha1.Integration) bool {
- return integration.Status.Phase == v1alpha1.IntegrationPhaseBuildingContext ||
- integration.Status.Phase == v1alpha1.IntegrationPhaseResolvingContext
+func (action *buildKitAction) CanHandle(integration *v1alpha1.Integration) bool {
+ return integration.Status.Phase == v1alpha1.IntegrationPhaseBuildingKit ||
+ integration.Status.Phase == v1alpha1.IntegrationPhaseResolvingKit
}
-func (action *buildContextAction) Handle(ctx context.Context, integration *v1alpha1.Integration) error {
- ictx, err := LookupContextForIntegration(ctx, action.client, integration)
+func (action *buildKitAction) Handle(ctx context.Context, integration *v1alpha1.Integration) error {
+ kit, err := LookupKitForIntegration(ctx, action.client, integration)
if err != nil {
//TODO: we may need to add a wait strategy, i.e give up after some time
return err
}
- if ictx != nil {
- if ictx.Labels["camel.apache.org/context.type"] == v1alpha1.IntegrationContextTypePlatform {
- // This is a platform context and as it is auto generated it may get
+ if kit != nil {
+ if kit.Labels["camel.apache.org/kit.type"] == v1alpha1.IntegrationKitTypePlatform {
+ // This is a platform kit and as it is auto generated it may get
// out of sync if the integration that has generated it, has been
// amended to add/remove dependencies
//TODO: this is a very simple check, we may need to provide a deps comparison strategy
- if !util.StringSliceContains(ictx.Spec.Dependencies, integration.Status.Dependencies) {
- // We need to re-generate a context or search for a new one that
+ if !util.StringSliceContains(kit.Spec.Dependencies, integration.Status.Dependencies) {
+ // We need to re-generate a kit or search for a new one that
// satisfies integrations needs so let's remove the association
- // with a context
+ // with a kit
target := integration.DeepCopy()
- target.Status.Context = ""
+ target.Status.Kit = ""
return action.client.Status().Update(ctx, target)
}
}
- if ictx.Status.Phase == v1alpha1.IntegrationContextPhaseError {
+ if kit.Status.Phase == v1alpha1.IntegrationKitPhaseError {
target := integration.DeepCopy()
- target.Status.Image = ictx.ImageForIntegration()
- target.Status.Context = ictx.Name
+ target.Status.Image = kit.ImageForIntegration()
+ target.Status.Kit = kit.Name
target.Status.Phase = v1alpha1.IntegrationPhaseError
target.Status.Digest, err = digest.ComputeForIntegration(target)
@@ -86,10 +86,10 @@ func (action *buildContextAction) Handle(ctx context.Context, integration *v1alp
return action.client.Status().Update(ctx, target)
}
- if ictx.Status.Phase == v1alpha1.IntegrationContextPhaseReady {
+ if kit.Status.Phase == v1alpha1.IntegrationKitPhaseReady {
target := integration.DeepCopy()
- target.Status.Image = ictx.ImageForIntegration()
- target.Status.Context = ictx.Name
+ target.Status.Image = kit.ImageForIntegration()
+ target.Status.Kit = kit.Name
dgst, err := digest.ComputeForIntegration(target)
if err != nil {
@@ -98,7 +98,7 @@ func (action *buildContextAction) Handle(ctx context.Context, integration *v1alp
target.Status.Digest = dgst
- if _, err := trait.Apply(ctx, action.client, target, ictx); err != nil {
+ if _, err := trait.Apply(ctx, action.client, target, kit); err != nil {
return err
}
@@ -107,30 +107,30 @@ func (action *buildContextAction) Handle(ctx context.Context, integration *v1alp
return action.client.Status().Update(ctx, target)
}
- if integration.Status.Context == "" {
- // We need to set the context
+ if integration.Status.Kit == "" {
+ // We need to set the kit
target := integration.DeepCopy()
- target.Status.Context = ictx.Name
+ target.Status.Kit = kit.Name
return action.client.Status().Update(ctx, target)
}
return nil
}
- platformCtxName := fmt.Sprintf("ctx-%s", xid.New())
- platformCtx := v1alpha1.NewIntegrationContext(integration.Namespace, platformCtxName)
+ platformCtxName := fmt.Sprintf("kit-%s", xid.New())
+ platformCtx := v1alpha1.NewIntegrationKit(integration.Namespace, platformCtxName)
// Add some information for post-processing, this may need to be refactored
// to a proper data structure
platformCtx.Labels = map[string]string{
- "camel.apache.org/context.type": v1alpha1.IntegrationContextTypePlatform,
- "camel.apache.org/context.created.by.kind": v1alpha1.IntegrationKind,
- "camel.apache.org/context.created.by.name": integration.Name,
- "camel.apache.org/context.created.by.version": integration.ResourceVersion,
+ "camel.apache.org/kit.type": v1alpha1.IntegrationKitTypePlatform,
+ "camel.apache.org/kit.created.by.kind": v1alpha1.IntegrationKind,
+ "camel.apache.org/kit.created.by.name": integration.Name,
+ "camel.apache.org/kit.created.by.version": integration.ResourceVersion,
}
- // Set the context to have the same characteristics as the integrations
- platformCtx.Spec = v1alpha1.IntegrationContextSpec{
+ // Set the kit to have the same characteristics as the integrations
+ platformCtx.Spec = v1alpha1.IntegrationKitSpec{
Dependencies: integration.Status.Dependencies,
Repositories: integration.Spec.Repositories,
Traits: integration.Spec.Traits,
@@ -140,10 +140,10 @@ func (action *buildContextAction) Handle(ctx context.Context, integration *v1alp
return err
}
- // Set the context name so the next handle loop, will fall through the
- // same path as integration with a user defined context
+ // Set the kit name so the next handle loop, will fall through the
+ // same path as integration with a user defined kit
target := integration.DeepCopy()
- target.Status.Context = platformCtxName
+ target.Status.Kit = platformCtxName
return action.client.Status().Update(ctx, target)
}
diff --git a/pkg/controller/integration/deploy.go b/pkg/controller/integration/deploy.go
index ff78ea8..e8df8b5 100644
--- a/pkg/controller/integration/deploy.go
+++ b/pkg/controller/integration/deploy.go
@@ -45,21 +45,21 @@ func (action *deployAction) CanHandle(integration *v1alpha1.Integration) bool {
}
func (action *deployAction) Handle(ctx context.Context, integration *v1alpha1.Integration) error {
- ictxName := integration.Status.Context
- if ictxName == "" {
- return errors.Errorf("no context set on integration %s", integration.Name)
+ kitName := integration.Status.Kit
+ if kitName == "" {
+ return errors.Errorf("no kit set on integration %s", integration.Name)
}
- ictx := v1alpha1.NewIntegrationContext(integration.Namespace, ictxName)
- ictxKey := k8sclient.ObjectKey{
+ kit := v1alpha1.NewIntegrationKit(integration.Namespace, kitName)
+ kitKey := k8sclient.ObjectKey{
Namespace: integration.Namespace,
- Name: ictxName,
+ Name: kitName,
}
- if err := action.client.Get(ctx, ictxKey, &ictx); err != nil {
- return errors.Wrapf(err, "unable to find integration context %s, %s", ictxName, err)
+ if err := action.client.Get(ctx, kitKey, &kit); err != nil {
+ return errors.Wrapf(err, "unable to find integration kit %s, %s", kitName, err)
}
- env, err := trait.Apply(ctx, action.client, integration, &ictx)
+ env, err := trait.Apply(ctx, action.client, integration, &kit)
if err != nil {
return err
}
diff --git a/pkg/controller/integration/initialize.go b/pkg/controller/integration/initialize.go
index b2e716e..3e5f921 100644
--- a/pkg/controller/integration/initialize.go
+++ b/pkg/controller/integration/initialize.go
@@ -103,9 +103,9 @@ func (action *initializeAction) Handle(ctx context.Context, integration *v1alpha
return err
}
- target.Status.Phase = v1alpha1.IntegrationPhaseBuildingContext
+ target.Status.Phase = v1alpha1.IntegrationPhaseBuildingKit
target.Status.Digest = dgst
- target.Status.Context = integration.Spec.Context
+ target.Status.Kit = integration.Spec.Kit
target.Status.Image = ""
action.L.Info("Integration state transition", "phase", target.Status.Phase)
diff --git a/pkg/controller/integration/integration_controller.go b/pkg/controller/integration/integration_controller.go
index 3eac4fb..5155658 100644
--- a/pkg/controller/integration/integration_controller.go
+++ b/pkg/controller/integration/integration_controller.go
@@ -89,7 +89,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error {
return err
}
- // Watch for changes to secondary resource Builds and requeue the owner IntegrationContext
+ // Watch for changes to secondary resource Builds and requeue the owner IntegrationKit
err = c.Watch(&source.Kind{Type: &v1alpha1.Build{}},
&handler.EnqueueRequestForOwner{
IsController: true,
@@ -183,7 +183,7 @@ func (r *ReconcileIntegration) Reconcile(request reconcile.Request) (reconcile.R
integrationActionPool := []Action{
NewInitializeAction(),
- NewBuildContextAction(),
+ NewBuildKitAction(),
NewDeployAction(),
NewMonitorAction(),
NewDeleteAction(),
diff --git a/pkg/controller/integration/util.go b/pkg/controller/integration/util.go
index 6c3b23f..3504259 100644
--- a/pkg/controller/integration/util.go
+++ b/pkg/controller/integration/util.go
@@ -29,27 +29,27 @@ import (
)
var allowedLookupLabels = map[string]bool{
- v1alpha1.IntegrationContextTypePlatform: true,
- v1alpha1.IntegrationContextTypeExternal: true,
+ v1alpha1.IntegrationKitTypePlatform: true,
+ v1alpha1.IntegrationKitTypeExternal: true,
}
-// LookupContextForIntegration --
-func LookupContextForIntegration(ctx context.Context, c k8sclient.Reader, integration *v1alpha1.Integration) (*v1alpha1.IntegrationContext, error) {
- if integration.Status.Context != "" {
- name := integration.Status.Context
- ictx := v1alpha1.NewIntegrationContext(integration.Namespace, name)
+// LookupKitForIntegration --
+func LookupKitForIntegration(ctx context.Context, c k8sclient.Reader, integration *v1alpha1.Integration) (*v1alpha1.IntegrationKit, error) {
+ if integration.Status.Kit != "" {
+ name := integration.Status.Kit
+ kit := v1alpha1.NewIntegrationKit(integration.Namespace, name)
key := k8sclient.ObjectKey{
Namespace: integration.Namespace,
Name: name,
}
- if err := c.Get(ctx, key, &ictx); err != nil {
- return nil, errors.Wrapf(err, "unable to find integration context %s, %s", name, err)
+ if err := c.Get(ctx, key, &kit); err != nil {
+ return nil, errors.Wrapf(err, "unable to find integration kit %s, %s", name, err)
}
- return &ictx, nil
+ return &kit, nil
}
- ctxList := v1alpha1.NewIntegrationContextList()
+ ctxList := v1alpha1.NewIntegrationKitList()
if err := c.List(ctx, &k8sclient.ListOptions{Namespace: integration.Namespace}, &ctxList); err != nil {
return nil, err
}
@@ -57,7 +57,7 @@ func LookupContextForIntegration(ctx context.Context, c k8sclient.Reader, integr
for _, ctx := range ctxList.Items {
ctx := ctx // pin
- if ctx.Status.Phase == v1alpha1.IntegrationContextPhaseError {
+ if ctx.Status.Phase == v1alpha1.IntegrationKitPhaseError {
continue
}
if ctx.Status.CamelVersion != integration.Status.CamelVersion {
@@ -67,7 +67,7 @@ func LookupContextForIntegration(ctx context.Context, c k8sclient.Reader, integr
continue
}
- if allowed, ok := allowedLookupLabels[ctx.Labels["camel.apache.org/context.type"]]; ok && allowed {
+ if allowed, ok := allowedLookupLabels[ctx.Labels["camel.apache.org/kit.type"]]; ok && allowed {
ideps := len(integration.Status.Dependencies)
cdeps := len(ctx.Spec.Dependencies)
@@ -76,15 +76,15 @@ func LookupContextForIntegration(ctx context.Context, c k8sclient.Reader, integr
}
//
- // When a platform context is created it inherits the traits from the integrations and as
+ // When a platform kit is created it inherits the traits from the integrations and as
// some traits may influence the build thus the artifacts present on the container image,
- // we need to take traits into account when looking up for compatible contexts.
+ // we need to take traits into account when looking up for compatible kits.
//
// It could also happen that an integration is updated and a trait is modified, if we do
- // not include traits in the lookup, we may use a context that does not have all the
+ // not include traits in the lookup, we may use a kit that does not have all the
// characteristics required by the integration.
//
- // An context be used only if it contains a subset of the traits and related configurations
+ // A kit can be used only if it contains a subset of the traits and related configurations
// declared on integration.
//
if !HasMatchingTraits(&ctx, integration) {
@@ -100,12 +100,12 @@ func LookupContextForIntegration(ctx context.Context, c k8sclient.Reader, integr
return nil, nil
}
-// HasMatchingTraits compare traits defined on context against those defined on integration.
-func HasMatchingTraits(ctx *v1alpha1.IntegrationContext, integration *v1alpha1.Integration) bool {
- for ctxTraitName, ctxTraitConf := range ctx.Spec.Traits {
+// HasMatchingTraits compare traits defined on kit against those defined on integration.
+func HasMatchingTraits(kit *v1alpha1.IntegrationKit, integration *v1alpha1.Integration) bool {
+ for ctxTraitName, ctxTraitConf := range kit.Spec.Traits {
iTraitConf, ok := integration.Spec.Traits[ctxTraitName]
if !ok {
- // skip it because trait configured on context is not defined on integration.
+ // skip it because trait configured on kit is not defined on integration.
return false
}
@@ -113,12 +113,12 @@ func HasMatchingTraits(ctx *v1alpha1.IntegrationContext, integration *v1alpha1.I
iv, ok := iTraitConf.Configuration[ck]
if !ok {
- // skip it because trait configured on context has a value that is not defined
+ // skip it because trait configured on kit has a value that is not defined
// in integration trait
return false
}
if iv != cv {
- // skip it because trait configured on context has a value that differs from
+ // skip it because trait configured on kit has a value that differs from
// the one configured on integration
return false
}
diff --git a/pkg/controller/integration/util_test.go b/pkg/controller/integration/util_test.go
index 2f950fd..8029265 100644
--- a/pkg/controller/integration/util_test.go
+++ b/pkg/controller/integration/util_test.go
@@ -29,57 +29,57 @@ import (
"github.com/stretchr/testify/assert"
)
-func TestLookupContextForIntegration_DiscardContextsInError(t *testing.T) {
+func TestLookupKitForIntegration_DiscardKitsInError(t *testing.T) {
c, err := test.NewFakeClient(
- &v1alpha1.IntegrationContext{
+ &v1alpha1.IntegrationKit{
TypeMeta: metav1.TypeMeta{
APIVersion: v1alpha1.SchemeGroupVersion.String(),
- Kind: v1alpha1.IntegrationContextKind,
+ Kind: v1alpha1.IntegrationKindKind,
},
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns",
- Name: "my-context-1",
+ Name: "my-kit-1",
Labels: map[string]string{
- "camel.apache.org/context.type": v1alpha1.IntegrationContextTypePlatform,
+ "camel.apache.org/kit.type": v1alpha1.IntegrationKitTypePlatform,
},
},
- Spec: v1alpha1.IntegrationContextSpec{
+ Spec: v1alpha1.IntegrationKitSpec{
Dependencies: []string{
"camel-core",
"camel-irc",
},
},
- Status: v1alpha1.IntegrationContextStatus{
- Phase: v1alpha1.IntegrationContextPhaseError,
+ Status: v1alpha1.IntegrationKitStatus{
+ Phase: v1alpha1.IntegrationKitPhaseError,
},
},
- &v1alpha1.IntegrationContext{
+ &v1alpha1.IntegrationKit{
TypeMeta: metav1.TypeMeta{
APIVersion: v1alpha1.SchemeGroupVersion.String(),
- Kind: v1alpha1.IntegrationContextKind,
+ Kind: v1alpha1.IntegrationKindKind,
},
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns",
- Name: "my-context-2",
+ Name: "my-kit-2",
Labels: map[string]string{
- "camel.apache.org/context.type": v1alpha1.IntegrationContextTypePlatform,
+ "camel.apache.org/kit.type": v1alpha1.IntegrationKitTypePlatform,
},
},
- Spec: v1alpha1.IntegrationContextSpec{
+ Spec: v1alpha1.IntegrationKitSpec{
Dependencies: []string{
"camel-core",
"camel-irc",
},
},
- Status: v1alpha1.IntegrationContextStatus{
- Phase: v1alpha1.IntegrationContextPhaseReady,
+ Status: v1alpha1.IntegrationKitStatus{
+ Phase: v1alpha1.IntegrationKitPhaseReady,
},
},
)
assert.Nil(t, err)
- i, err := LookupContextForIntegration(context.TODO(), c, &v1alpha1.Integration{
+ i, err := LookupKitForIntegration(context.TODO(), c, &v1alpha1.Integration{
TypeMeta: metav1.TypeMeta{
APIVersion: v1alpha1.SchemeGroupVersion.String(),
Kind: v1alpha1.IntegrationKind,
@@ -98,28 +98,28 @@ func TestLookupContextForIntegration_DiscardContextsInError(t *testing.T) {
assert.Nil(t, err)
assert.NotNil(t, i)
- assert.Equal(t, "my-context-2", i.Name)
+ assert.Equal(t, "my-kit-2", i.Name)
}
-func TestLookupContextForIntegration_DiscardContextsWithIncompatibleTraits(t *testing.T) {
+func TestLookupKitForIntegration_DiscardKitsWithIncompatibleTraits(t *testing.T) {
c, err := test.NewFakeClient(
//
// Should be discarded because it contains both of the required traits but one
// contains a different configuration value
//
- &v1alpha1.IntegrationContext{
+ &v1alpha1.IntegrationKit{
TypeMeta: metav1.TypeMeta{
APIVersion: v1alpha1.SchemeGroupVersion.String(),
- Kind: v1alpha1.IntegrationContextKind,
+ Kind: v1alpha1.IntegrationKindKind,
},
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns",
- Name: "my-context-1",
+ Name: "my-kit-1",
Labels: map[string]string{
- "camel.apache.org/context.type": v1alpha1.IntegrationContextTypePlatform,
+ "camel.apache.org/kit.type": v1alpha1.IntegrationKitTypePlatform,
},
},
- Spec: v1alpha1.IntegrationContextSpec{
+ Spec: v1alpha1.IntegrationKitSpec{
Dependencies: []string{
"camel-core",
"camel-irc",
@@ -137,27 +137,27 @@ func TestLookupContextForIntegration_DiscardContextsWithIncompatibleTraits(t *te
},
},
},
- Status: v1alpha1.IntegrationContextStatus{
- Phase: v1alpha1.IntegrationContextPhaseReady,
+ Status: v1alpha1.IntegrationKitStatus{
+ Phase: v1alpha1.IntegrationKitPhaseReady,
},
},
//
// Should be discarded because it contains a subset of the required traits but
// with different configuration value
//
- &v1alpha1.IntegrationContext{
+ &v1alpha1.IntegrationKit{
TypeMeta: metav1.TypeMeta{
APIVersion: v1alpha1.SchemeGroupVersion.String(),
- Kind: v1alpha1.IntegrationContextKind,
+ Kind: v1alpha1.IntegrationKindKind,
},
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns",
- Name: "my-context-2",
+ Name: "my-kit-2",
Labels: map[string]string{
- "camel.apache.org/context.type": v1alpha1.IntegrationContextTypePlatform,
+ "camel.apache.org/kit.type": v1alpha1.IntegrationKitTypePlatform,
},
},
- Spec: v1alpha1.IntegrationContextSpec{
+ Spec: v1alpha1.IntegrationKitSpec{
Dependencies: []string{
"camel-core",
"camel-irc",
@@ -170,27 +170,27 @@ func TestLookupContextForIntegration_DiscardContextsWithIncompatibleTraits(t *te
},
},
},
- Status: v1alpha1.IntegrationContextStatus{
- Phase: v1alpha1.IntegrationContextPhaseReady,
+ Status: v1alpha1.IntegrationKitStatus{
+ Phase: v1alpha1.IntegrationKitPhaseReady,
},
},
//
// Should be discarded because it contains both of the required traits but
// also an additional one
//
- &v1alpha1.IntegrationContext{
+ &v1alpha1.IntegrationKit{
TypeMeta: metav1.TypeMeta{
APIVersion: v1alpha1.SchemeGroupVersion.String(),
- Kind: v1alpha1.IntegrationContextKind,
+ Kind: v1alpha1.IntegrationKindKind,
},
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns",
- Name: "my-context-3",
+ Name: "my-kit-3",
Labels: map[string]string{
- "camel.apache.org/context.type": v1alpha1.IntegrationContextTypePlatform,
+ "camel.apache.org/kit.type": v1alpha1.IntegrationKitTypePlatform,
},
},
- Spec: v1alpha1.IntegrationContextSpec{
+ Spec: v1alpha1.IntegrationKitSpec{
Dependencies: []string{
"camel-core",
"camel-irc",
@@ -213,27 +213,27 @@ func TestLookupContextForIntegration_DiscardContextsWithIncompatibleTraits(t *te
},
},
},
- Status: v1alpha1.IntegrationContextStatus{
- Phase: v1alpha1.IntegrationContextPhaseReady,
+ Status: v1alpha1.IntegrationKitStatus{
+ Phase: v1alpha1.IntegrationKitPhaseReady,
},
},
//
// Should NOT be discarded because it contains a subset of the required traits and
// same configuration values
//
- &v1alpha1.IntegrationContext{
+ &v1alpha1.IntegrationKit{
TypeMeta: metav1.TypeMeta{
APIVersion: v1alpha1.SchemeGroupVersion.String(),
- Kind: v1alpha1.IntegrationContextKind,
+ Kind: v1alpha1.IntegrationKindKind,
},
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns",
- Name: "my-context-4",
+ Name: "my-kit-4",
Labels: map[string]string{
- "camel.apache.org/context.type": v1alpha1.IntegrationContextTypePlatform,
+ "camel.apache.org/kit.type": v1alpha1.IntegrationKitTypePlatform,
},
},
- Spec: v1alpha1.IntegrationContextSpec{
+ Spec: v1alpha1.IntegrationKitSpec{
Dependencies: []string{
"camel-core",
"camel-irc",
@@ -246,15 +246,15 @@ func TestLookupContextForIntegration_DiscardContextsWithIncompatibleTraits(t *te
},
},
},
- Status: v1alpha1.IntegrationContextStatus{
- Phase: v1alpha1.IntegrationContextPhaseReady,
+ Status: v1alpha1.IntegrationKitStatus{
+ Phase: v1alpha1.IntegrationKitPhaseReady,
},
},
)
assert.Nil(t, err)
- i, err := LookupContextForIntegration(context.TODO(), c, &v1alpha1.Integration{
+ i, err := LookupKitForIntegration(context.TODO(), c, &v1alpha1.Integration{
TypeMeta: metav1.TypeMeta{
APIVersion: v1alpha1.SchemeGroupVersion.String(),
Kind: v1alpha1.IntegrationKind,
@@ -287,5 +287,5 @@ func TestLookupContextForIntegration_DiscardContextsWithIncompatibleTraits(t *te
assert.Nil(t, err)
assert.NotNil(t, i)
- assert.Equal(t, "my-context-4", i.Name)
+ assert.Equal(t, "my-kit-4", i.Name)
}
diff --git a/pkg/controller/integrationcontext/action.go b/pkg/controller/integrationkit/action.go
similarity index 85%
rename from pkg/controller/integrationcontext/action.go
rename to pkg/controller/integrationkit/action.go
index 7c74194..69691bf 100644
--- a/pkg/controller/integrationcontext/action.go
+++ b/pkg/controller/integrationkit/action.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package integrationcontext
+package integrationkit
import (
"context"
@@ -32,11 +32,11 @@ type Action interface {
// a user friendly name for the action
Name() string
- // returns true if the action can handle the integration context
- CanHandle(integration *v1alpha1.IntegrationContext) bool
+ // returns true if the action can handle the integration kit
+ CanHandle(kit *v1alpha1.IntegrationKit) bool
// executes the handling function
- Handle(ctx context.Context, integration *v1alpha1.IntegrationContext) error
+ Handle(ctx context.Context, kit *v1alpha1.IntegrationKit) error
// Inject integration logger
InjectLogger(log.Logger)
diff --git a/pkg/controller/integrationcontext/build.go b/pkg/controller/integrationkit/build.go
similarity index 60%
rename from pkg/controller/integrationcontext/build.go
rename to pkg/controller/integrationkit/build.go
index 65d3b36..31de1e8 100644
--- a/pkg/controller/integrationcontext/build.go
+++ b/pkg/controller/integrationkit/build.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package integrationcontext
+package integrationkit
import (
"context"
@@ -35,7 +35,7 @@ import (
"github.com/apache/camel-k/pkg/trait"
)
-// NewBuildAction creates a new build request handling action for the context
+// NewBuildAction creates a new build request handling action for the kit
func NewBuildAction() Action {
return &buildAction{}
}
@@ -48,24 +48,24 @@ func (action *buildAction) Name() string {
return "build-submitted"
}
-func (action *buildAction) CanHandle(ictx *v1alpha1.IntegrationContext) bool {
- return ictx.Status.Phase == v1alpha1.IntegrationContextPhaseBuildSubmitted ||
- ictx.Status.Phase == v1alpha1.IntegrationContextPhaseBuildRunning
+func (action *buildAction) CanHandle(kit *v1alpha1.IntegrationKit) bool {
+ return kit.Status.Phase == v1alpha1.IntegrationKitPhaseBuildSubmitted ||
+ kit.Status.Phase == v1alpha1.IntegrationKitPhaseBuildRunning
}
-func (action *buildAction) Handle(ctx context.Context, ictx *v1alpha1.IntegrationContext) error {
- if ictx.Status.Phase == v1alpha1.IntegrationContextPhaseBuildSubmitted {
- return action.handleBuildSubmitted(ctx, ictx)
- } else if ictx.Status.Phase == v1alpha1.IntegrationContextPhaseBuildRunning {
- return action.handleBuildRunning(ctx, ictx)
+func (action *buildAction) Handle(ctx context.Context, kit *v1alpha1.IntegrationKit) error {
+ if kit.Status.Phase == v1alpha1.IntegrationKitPhaseBuildSubmitted {
+ return action.handleBuildSubmitted(ctx, kit)
+ } else if kit.Status.Phase == v1alpha1.IntegrationKitPhaseBuildRunning {
+ return action.handleBuildRunning(ctx, kit)
}
return nil
}
-func (action *buildAction) handleBuildSubmitted(ctx context.Context, ictx *v1alpha1.IntegrationContext) error {
+func (action *buildAction) handleBuildSubmitted(ctx context.Context, kit *v1alpha1.IntegrationKit) error {
build := &v1alpha1.Build{}
- err := action.client.Get(ctx, types.NamespacedName{Namespace: ictx.Namespace, Name: ictx.Name}, build)
+ err := action.client.Get(ctx, types.NamespacedName{Namespace: kit.Namespace, Name: kit.Name}, build)
if err != nil && !k8serrors.IsNotFound(err) {
return err
}
@@ -75,7 +75,7 @@ func (action *buildAction) handleBuildSubmitted(ctx context.Context, ictx *v1alp
build.Status.Phase == v1alpha1.BuildPhaseInterrupted ||
build.Status.Phase == v1alpha1.BuildPhaseSucceeded {
- env, err := trait.Apply(ctx, action.client, nil, ictx)
+ env, err := trait.Apply(ctx, action.client, nil, kit)
if err != nil {
return err
}
@@ -90,22 +90,22 @@ func (action *buildAction) handleBuildSubmitted(ctx context.Context, ictx *v1alp
Kind: "Build",
},
ObjectMeta: metav1.ObjectMeta{
- Namespace: ictx.Namespace,
- Name: ictx.Name,
+ Namespace: kit.Namespace,
+ Name: kit.Name,
},
Spec: v1alpha1.BuildSpec{
- Meta: ictx.ObjectMeta,
+ Meta: kit.ObjectMeta,
CamelVersion: env.CamelCatalog.Version,
RuntimeVersion: env.RuntimeVersion,
Platform: env.Platform.Spec,
- Dependencies: ictx.Spec.Dependencies,
+ Dependencies: kit.Spec.Dependencies,
Steps: builder.StepIDsFor(env.Steps...),
BuildDir: env.BuildDir,
},
}
- // Set the integration context instance as the owner and controller
- if err := controllerutil.SetControllerReference(ictx, build, action.client.GetScheme()); err != nil {
+ // Set the integration kit instance as the owner and controller
+ if err := controllerutil.SetControllerReference(kit, build, action.client.GetScheme()); err != nil {
return err
}
@@ -121,10 +121,10 @@ func (action *buildAction) handleBuildSubmitted(ctx context.Context, ictx *v1alp
}
if build.Status.Phase == v1alpha1.BuildPhaseRunning {
- target := ictx.DeepCopy()
- target.Status.Phase = v1alpha1.IntegrationContextPhaseBuildRunning
+ target := kit.DeepCopy()
+ target.Status.Phase = v1alpha1.IntegrationKitPhaseBuildRunning
- action.L.Info("IntegrationContext state transition", "phase", target.Status.Phase)
+ action.L.Info("IntegrationKit state transition", "phase", target.Status.Phase)
return action.client.Status().Update(ctx, target)
}
@@ -132,9 +132,9 @@ func (action *buildAction) handleBuildSubmitted(ctx context.Context, ictx *v1alp
return nil
}
-func (action *buildAction) handleBuildRunning(ctx context.Context, ictx *v1alpha1.IntegrationContext) error {
+func (action *buildAction) handleBuildRunning(ctx context.Context, kit *v1alpha1.IntegrationKit) error {
build := &v1alpha1.Build{}
- err := action.client.Get(ctx, types.NamespacedName{Namespace: ictx.Namespace, Name: ictx.Name}, build)
+ err := action.client.Get(ctx, types.NamespacedName{Namespace: kit.Namespace, Name: kit.Name}, build)
if err != nil {
return err
}
@@ -145,15 +145,14 @@ func (action *buildAction) handleBuildRunning(ctx context.Context, ictx *v1alpha
action.L.Info("Build running")
case v1alpha1.BuildPhaseSucceeded:
- target := ictx.DeepCopy()
+ target := kit.DeepCopy()
- // we should ensure that the integration context is still in the right
- // phase, if not there is a chance that the context has been modified
- // by the user
- if target.Status.Phase != v1alpha1.IntegrationContextPhaseBuildRunning {
- return fmt.Errorf("found context %s not in the expected phase (expectd=%s, found=%s)",
+ // we should ensure that the integration kit is still in the right phase,
+ // if not there is a chance that the kit has been modified by the user
+ if target.Status.Phase != v1alpha1.IntegrationKitPhaseBuildRunning {
+ return fmt.Errorf("found kit %s not in the expected phase (expectd=%s, found=%s)",
build.Spec.Meta.Name,
- string(v1alpha1.IntegrationContextPhaseBuildRunning),
+ string(v1alpha1.IntegrationKitPhaseBuildRunning),
string(target.Status.Phase),
)
}
@@ -161,7 +160,7 @@ func (action *buildAction) handleBuildRunning(ctx context.Context, ictx *v1alpha
target.Status.BaseImage = build.Status.BaseImage
target.Status.Image = build.Status.Image
target.Status.PublicImage = build.Status.PublicImage
- target.Status.Phase = v1alpha1.IntegrationContextPhaseReady
+ target.Status.Phase = v1alpha1.IntegrationKitPhaseReady
target.Status.Artifacts = make([]v1alpha1.Artifact, 0, len(build.Status.Artifacts))
for _, a := range build.Status.Artifacts {
@@ -173,35 +172,34 @@ func (action *buildAction) handleBuildRunning(ctx context.Context, ictx *v1alpha
})
}
- action.L.Info("IntegrationContext state transition", "phase", target.Status.Phase)
+ action.L.Info("IntegrationKit state transition", "phase", target.Status.Phase)
if err := action.client.Status().Update(ctx, target); err != nil {
return err
}
- action.L.Info("Inform integrations about context state change")
+ action.L.Info("Inform integrations about kit state change")
if err := action.informIntegrations(ctx, target); err != nil {
return err
}
case v1alpha1.BuildPhaseError, v1alpha1.BuildPhaseInterrupted:
- target := ictx.DeepCopy()
+ target := kit.DeepCopy()
- // we should ensure that the integration context is still in the right
- // phase, if not there is a chance that the context has been modified
- // by the user
- if target.Status.Phase != v1alpha1.IntegrationContextPhaseBuildRunning {
- return fmt.Errorf("found context %s not the an expected phase (expectd=%s, found=%s)",
+ // we should ensure that the integration kit is still in the right phase,
+ // if not there is a chance that the kit has been modified by the user
+ if target.Status.Phase != v1alpha1.IntegrationKitPhaseBuildRunning {
+ return fmt.Errorf("found kit %s not the an expected phase (expectd=%s, found=%s)",
build.Spec.Meta.Name,
- string(v1alpha1.IntegrationContextPhaseBuildRunning),
+ string(v1alpha1.IntegrationKitPhaseBuildRunning),
string(target.Status.Phase),
)
}
- // Let's copy the build failure to the integration context status
+ // Let's copy the build failure to the integration kit status
target.Status.Failure = build.Status.Failure
- target.Status.Phase = v1alpha1.IntegrationContextPhaseError
+ target.Status.Phase = v1alpha1.IntegrationKitPhaseError
- action.L.Error(fmt.Errorf(build.Status.Error), "IntegrationContext state transition", "phase", target.Status.Phase)
+ action.L.Error(fmt.Errorf(build.Status.Error), "IntegrationKit state transition", "phase", target.Status.Phase)
return action.client.Status().Update(ctx, target)
}
@@ -209,19 +207,19 @@ func (action *buildAction) handleBuildRunning(ctx context.Context, ictx *v1alpha
return nil
}
-// informIntegrations triggers the processing of all integrations waiting for this context to be built
-func (action *buildAction) informIntegrations(ctx context.Context, ictx *v1alpha1.IntegrationContext) error {
+// informIntegrations triggers the processing of all integrations waiting for this kit to be built
+func (action *buildAction) informIntegrations(ctx context.Context, kit *v1alpha1.IntegrationKit) error {
list := v1alpha1.NewIntegrationList()
- err := action.client.List(ctx, &k8sclient.ListOptions{Namespace: ictx.Namespace}, &list)
+ err := action.client.List(ctx, &k8sclient.ListOptions{Namespace: kit.Namespace}, &list)
if err != nil {
return err
}
for _, integration := range list.Items {
integration := integration // pin
- if integration.Status.Context != ictx.Name {
+ if integration.Status.Kit != kit.Name {
continue
}
- integration.Status.Phase = v1alpha1.IntegrationPhaseResolvingContext
+ integration.Status.Phase = v1alpha1.IntegrationPhaseResolvingKit
err = action.client.Status().Update(ctx, &integration)
if err != nil {
return err
diff --git a/pkg/controller/integrationcontext/initialize.go b/pkg/controller/integrationkit/initialize.go
similarity index 68%
rename from pkg/controller/integrationcontext/initialize.go
rename to pkg/controller/integrationkit/initialize.go
index 53a01bf..d90076b 100644
--- a/pkg/controller/integrationcontext/initialize.go
+++ b/pkg/controller/integrationkit/initialize.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package integrationcontext
+package integrationkit
import (
"context"
@@ -26,7 +26,7 @@ import (
"github.com/apache/camel-k/pkg/util/digest"
)
-// NewInitializeAction creates a new initialization handling action for the context
+// NewInitializeAction creates a new initialization handling action for the kit
func NewInitializeAction() Action {
return &initializeAction{}
}
@@ -39,48 +39,48 @@ func (action *initializeAction) Name() string {
return "initialize"
}
-func (action *initializeAction) CanHandle(ictx *v1alpha1.IntegrationContext) bool {
- return ictx.Status.Phase == ""
+func (action *initializeAction) CanHandle(kit *v1alpha1.IntegrationKit) bool {
+ return kit.Status.Phase == ""
}
-func (action *initializeAction) Handle(ctx context.Context, ictx *v1alpha1.IntegrationContext) error {
- // The integration platform needs to be initialized before starting to create contexts
- if _, err := platform.GetCurrentPlatform(ctx, action.client, ictx.Namespace); err != nil {
+func (action *initializeAction) Handle(ctx context.Context, kit *v1alpha1.IntegrationKit) error {
+ // The integration platform needs to be initialized before starting to create kits
+ if _, err := platform.GetCurrentPlatform(ctx, action.client, kit.Namespace); err != nil {
action.L.Info("Waiting for the integration platform to be initialized")
return nil
}
- target := ictx.DeepCopy()
+ target := kit.DeepCopy()
_, err := trait.Apply(ctx, action.client, nil, target)
if err != nil {
return err
}
- // Updating the whole integration context as it may have changed
- action.L.Info("Updating IntegrationContext")
+ // Updating the whole integration kit as it may have changed
+ action.L.Info("Updating IntegrationKit")
if err := action.client.Update(ctx, target); err != nil {
return err
}
if target.Spec.Image == "" {
- // by default the context should be built
- target.Status.Phase = v1alpha1.IntegrationContextPhaseBuildSubmitted
+ // by default the kit should be built
+ target.Status.Phase = v1alpha1.IntegrationKitPhaseBuildSubmitted
} else {
// but in case it has been created from an image, mark the
- // context as ready
- target.Status.Phase = v1alpha1.IntegrationContextPhaseReady
+ // kit as ready
+ target.Status.Phase = v1alpha1.IntegrationKitPhaseReady
// and set the image to be used
target.Status.Image = target.Spec.Image
}
- dgst, err := digest.ComputeForIntegrationContext(target)
+ dgst, err := digest.ComputeForIntegrationKit(target)
if err != nil {
return err
}
target.Status.Digest = dgst
- action.L.Info("IntegrationContext state transition", "phase", target.Status.Phase)
+ action.L.Info("IntegrationKit state transition", "phase", target.Status.Phase)
return action.client.Status().Update(ctx, target)
}
diff --git a/pkg/controller/integrationcontext/integrationcontext_controller.go b/pkg/controller/integrationkit/integrationkit_controller.go
similarity index 69%
rename from pkg/controller/integrationcontext/integrationcontext_controller.go
rename to pkg/controller/integrationkit/integrationkit_controller.go
index 0ae01f7..0de9626 100644
--- a/pkg/controller/integrationcontext/integrationcontext_controller.go
+++ b/pkg/controller/integrationkit/integrationkit_controller.go
@@ -14,7 +14,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
-package integrationcontext
+package integrationkit
import (
"context"
@@ -35,7 +35,7 @@ import (
"github.com/apache/camel-k/pkg/client"
)
-// Add creates a new IntegrationContext Controller and adds it to the Manager. The Manager will set fields on the Controller
+// Add creates a new IntegrationKit Controller and adds it to the Manager. The Manager will set fields on the Controller
// and Start it when the Manager is Started.
func Add(mgr manager.Manager) error {
c, err := client.FromManager(mgr)
@@ -47,7 +47,7 @@ func Add(mgr manager.Manager) error {
// newReconciler returns a new reconcile.Reconciler
func newReconciler(mgr manager.Manager, c client.Client) reconcile.Reconciler {
- return &ReconcileIntegrationContext{
+ return &ReconcileIntegrationKit{
client: c,
scheme: mgr.GetScheme(),
}
@@ -56,21 +56,21 @@ func newReconciler(mgr manager.Manager, c client.Client) reconcile.Reconciler {
// add adds a new Controller to mgr with r as the reconcile.Reconciler
func add(mgr manager.Manager, r reconcile.Reconciler) error {
// Create a new controller
- c, err := controller.New("integrationcontext-controller", mgr, controller.Options{Reconciler: r})
+ c, err := controller.New("integrationkit-controller", mgr, controller.Options{Reconciler: r})
if err != nil {
return err
}
- // Watch for changes to primary resource IntegrationContext
- err = c.Watch(&source.Kind{Type: &v1alpha1.IntegrationContext{}}, &handler.EnqueueRequestForObject{}, predicate.Funcs{
+ // Watch for changes to primary resource IntegrationKit
+ err = c.Watch(&source.Kind{Type: &v1alpha1.IntegrationKit{}}, &handler.EnqueueRequestForObject{}, predicate.Funcs{
UpdateFunc: func(e event.UpdateEvent) bool {
- oldIntegrationContext := e.ObjectOld.(*v1alpha1.IntegrationContext)
- newIntegrationContext := e.ObjectNew.(*v1alpha1.IntegrationContext)
- // Ignore updates to the integration context status in which case metadata.Generation
- // does not change, or except when the integration context phase changes as it's used
+ oldIntegrationKit := e.ObjectOld.(*v1alpha1.IntegrationKit)
+ newIntegrationKit := e.ObjectNew.(*v1alpha1.IntegrationKit)
+ // Ignore updates to the integration kit status in which case metadata.Generation
+ // does not change, or except when the integration kit phase changes as it's used
// to transition from one phase to another
- return oldIntegrationContext.Generation != newIntegrationContext.Generation ||
- oldIntegrationContext.Status.Phase != newIntegrationContext.Status.Phase
+ return oldIntegrationKit.Generation != newIntegrationKit.Generation ||
+ oldIntegrationKit.Status.Phase != newIntegrationKit.Status.Phase
},
DeleteFunc: func(e event.DeleteEvent) bool {
// Evaluates to false if the object has been confirmed deleted
@@ -81,18 +81,18 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error {
return err
}
- // Watch for changes to secondary resource Builds and requeue the owner IntegrationContext
+ // Watch for changes to secondary resource Builds and requeue the owner IntegrationKit
err = c.Watch(&source.Kind{Type: &v1alpha1.Build{}},
&handler.EnqueueRequestForOwner{
IsController: true,
- OwnerType: &v1alpha1.IntegrationContext{},
+ OwnerType: &v1alpha1.IntegrationKit{},
},
predicate.Funcs{
UpdateFunc: func(e event.UpdateEvent) bool {
oldBuild := e.ObjectOld.(*v1alpha1.Build)
newBuild := e.ObjectNew.(*v1alpha1.Build)
// Ignore updates to the build CR except when the build phase changes
- // as it's used to transition the integration context from one phase
+ // as it's used to transition the integration kit from one phase
// to another during the image build
return oldBuild.Status.Phase != newBuild.Status.Phase
},
@@ -104,29 +104,29 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error {
return nil
}
-var _ reconcile.Reconciler = &ReconcileIntegrationContext{}
+var _ reconcile.Reconciler = &ReconcileIntegrationKit{}
-// ReconcileIntegrationContext reconciles a IntegrationContext object
-type ReconcileIntegrationContext struct {
+// ReconcileIntegrationKit reconciles a IntegrationKit object
+type ReconcileIntegrationKit struct {
// This client, initialized using mgr.Client() above, is a split client
// that reads objects from the cache and writes to the apiserver
client client.Client
scheme *runtime.Scheme
}
-// Reconcile reads that state of the cluster for a IntegrationContext object and makes changes based on the state read
-// and what is in the IntegrationContext.Spec
+// Reconcile reads that state of the cluster for a IntegrationKit object and makes changes based on the state read
+// and what is in the IntegrationKit.Spec
// Note:
// The Controller will requeue the Request to be processed again if the returned error is non-nil or
// Result.Requeue is true, otherwise upon completion it will remove the work from the queue.
-func (r *ReconcileIntegrationContext) Reconcile(request reconcile.Request) (reconcile.Result, error) {
+func (r *ReconcileIntegrationKit) Reconcile(request reconcile.Request) (reconcile.Result, error) {
rlog := Log.WithValues("request-namespace", request.Namespace, "request-name", request.Name)
- rlog.Info("Reconciling IntegrationContext")
+ rlog.Info("Reconciling IntegrationKit")
ctx := context.TODO()
- // Fetch the IntegrationContext instance
- instance := &v1alpha1.IntegrationContext{}
+ // Fetch the IntegrationKit instance
+ instance := &v1alpha1.IntegrationKit{}
err := r.client.Get(ctx, request.NamespacedName, instance)
if err != nil {
if errors.IsNotFound(err) {
@@ -139,14 +139,14 @@ func (r *ReconcileIntegrationContext) Reconcile(request reconcile.Request) (reco
return reconcile.Result{}, err
}
- integrationContextActionPool := []Action{
+ actionPool := []Action{
NewInitializeAction(),
NewBuildAction(),
NewMonitorAction(),
}
- ilog := rlog.ForIntegrationContext(instance)
- for _, a := range integrationContextActionPool {
+ ilog := rlog.ForIntegrationKit(instance)
+ for _, a := range actionPool {
a.InjectClient(r.client)
a.InjectLogger(ilog)
if a.CanHandle(instance) {
diff --git a/pkg/controller/integrationcontext/log.go b/pkg/controller/integrationkit/log.go
similarity index 89%
rename from pkg/controller/integrationcontext/log.go
rename to pkg/controller/integrationkit/log.go
index 798e4e4..7743369 100644
--- a/pkg/controller/integrationcontext/log.go
+++ b/pkg/controller/integrationkit/log.go
@@ -15,9 +15,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package integrationcontext
+package integrationkit
import "github.com/apache/camel-k/pkg/util/log"
// Log --
-var Log = log.Log.WithName("controller").WithName("integrationcontext")
+var Log = log.Log.WithName("controller").WithName("integrationkit")
diff --git a/pkg/controller/integrationcontext/monitor.go b/pkg/controller/integrationkit/monitor.go
similarity index 64%
rename from pkg/controller/integrationcontext/monitor.go
rename to pkg/controller/integrationkit/monitor.go
index 705edba..79671e3 100644
--- a/pkg/controller/integrationcontext/monitor.go
+++ b/pkg/controller/integrationkit/monitor.go
@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package integrationcontext
+package integrationkit
import (
"context"
@@ -24,7 +24,7 @@ import (
"github.com/apache/camel-k/pkg/util/digest"
)
-// NewMonitorAction creates a new monitoring handling action for the context
+// NewMonitorAction creates a new monitoring handling action for the kit
func NewMonitorAction() Action {
return &monitorAction{}
}
@@ -37,23 +37,23 @@ func (action *monitorAction) Name() string {
return "monitor"
}
-func (action *monitorAction) CanHandle(ictx *v1alpha1.IntegrationContext) bool {
- return ictx.Status.Phase == v1alpha1.IntegrationContextPhaseReady || ictx.Status.Phase == v1alpha1.IntegrationContextPhaseError
+func (action *monitorAction) CanHandle(kit *v1alpha1.IntegrationKit) bool {
+ return kit.Status.Phase == v1alpha1.IntegrationKitPhaseReady || kit.Status.Phase == v1alpha1.IntegrationKitPhaseError
}
-func (action *monitorAction) Handle(ctx context.Context, ictx *v1alpha1.IntegrationContext) error {
- hash, err := digest.ComputeForIntegrationContext(ictx)
+func (action *monitorAction) Handle(ctx context.Context, kit *v1alpha1.IntegrationKit) error {
+ hash, err := digest.ComputeForIntegrationKit(kit)
if err != nil {
return err
}
- if hash != ictx.Status.Digest {
- action.L.Info("IntegrationContext needs a rebuild")
+ if hash != kit.Status.Digest {
+ action.L.Info("IntegrationKit needs a rebuild")
- target := ictx.DeepCopy()
+ target := kit.DeepCopy()
target.Status.Digest = hash
- target.Status.Phase = v1alpha1.IntegrationContextPhaseBuildSubmitted
+ target.Status.Phase = v1alpha1.IntegrationKitPhaseBuildSubmitted
- action.L.Info("IntegrationContext state transition", "phase", target.Status.Phase)
+ action.L.Info("IntegrationKit state transition", "phase", target.Status.Phase)
return action.client.Status().Update(ctx, target)
}
diff --git a/pkg/controller/integrationplatform/action.go b/pkg/controller/integrationplatform/action.go
index 3d4464a..11a4c59 100644
--- a/pkg/controller/integrationplatform/action.go
+++ b/pkg/controller/integrationplatform/action.go
@@ -32,7 +32,7 @@ type Action interface {
// a user friendly name for the action
Name() string
- // returns true if the action can handle the integration context
+ // returns true if the action can handle the integration platform
CanHandle(platform *v1alpha1.IntegrationPlatform) bool
// executes the handling function
diff --git a/pkg/controller/integrationplatform/create.go b/pkg/controller/integrationplatform/create.go
index 0d1fc45..184cd80 100644
--- a/pkg/controller/integrationplatform/create.go
+++ b/pkg/controller/integrationplatform/create.go
@@ -56,16 +56,16 @@ func (action *createAction) Handle(ctx context.Context, platform *v1alpha1.Integ
}
}
- if l := len(platform.Spec.Resources.Contexts); l > 0 {
+ if l := len(platform.Spec.Resources.Kits); l > 0 {
res := make([]string, 0, l)
- for _, c := range platform.Spec.Resources.Contexts {
+ for _, c := range platform.Spec.Resources.Kits {
//
// Assuming that if the resource ends with a yaml extension, the full
// resource name is provided
//
if !strings.HasSuffix(c, ".yaml") && !strings.HasSuffix(c, ".yml") {
- c = fmt.Sprintf("platform-integration-context-%s.yaml", c)
+ c = fmt.Sprintf("platform-integration-kit-%s.yaml", c)
}
res = append(res, c)
diff --git a/pkg/controller/integrationplatform/start.go b/pkg/controller/integrationplatform/start.go
index 2fa8a7e..d1ca50f 100644
--- a/pkg/controller/integrationplatform/start.go
+++ b/pkg/controller/integrationplatform/start.go
@@ -60,10 +60,10 @@ func (action *startAction) Handle(ctx context.Context, platform *v1alpha1.Integr
}
func (action *startAction) aggregatePlatformPhaseFromContexts(ctx context.Context, namespace string) (v1alpha1.IntegrationPlatformPhase, error) {
- ctxs := v1alpha1.NewIntegrationContextList()
+ ctxs := v1alpha1.NewIntegrationKitList()
options := k8sclient.ListOptions{
LabelSelector: labels.SelectorFromSet(labels.Set{
- "camel.apache.org/context.type": "platform",
+ "camel.apache.org/kit.type": "platform",
}),
Namespace: namespace,
}
@@ -73,9 +73,9 @@ func (action *startAction) aggregatePlatformPhaseFromContexts(ctx context.Contex
countReady := 0
for _, ctx := range ctxs.Items {
- if ctx.Status.Phase == v1alpha1.IntegrationContextPhaseError {
+ if ctx.Status.Phase == v1alpha1.IntegrationKitPhaseError {
return v1alpha1.IntegrationPlatformPhaseError, nil
- } else if ctx.Status.Phase == v1alpha1.IntegrationContextPhaseReady {
+ } else if ctx.Status.Phase == v1alpha1.IntegrationKitPhaseReady {
countReady++
}
}
diff --git a/pkg/install/cluster.go b/pkg/install/cluster.go
index 38725de..d93d716 100644
--- a/pkg/install/cluster.go
+++ b/pkg/install/cluster.go
@@ -54,8 +54,8 @@ func SetupClusterwideResourcesOrCollect(ctx context.Context, clientProvider clie
return err
}
- // Install CRD for Integration Context (if needed)
- if err := installCRD(ctx, c, "IntegrationContext", "crd-integration-context.yaml", collection); err != nil {
+ // Install CRD for Integration Kit (if needed)
+ if err := installCRD(ctx, c, "IntegrationKit", "crd-integration-kit.yaml", collection); err != nil {
return err
}
@@ -124,7 +124,7 @@ func AreAllCRDInstalled(ctx context.Context, c client.Client) (bool, error) {
} else if !ok {
return false, nil
}
- if ok, err := IsCRDInstalled(ctx, c, "IntegrationContext"); err != nil {
+ if ok, err := IsCRDInstalled(ctx, c, "IntegrationKit"); err != nil {
return ok, err
} else if !ok {
return false, nil
diff --git a/pkg/install/common.go b/pkg/install/common.go
index c4cedda..b6d385f 100644
--- a/pkg/install/common.go
+++ b/pkg/install/common.go
@@ -91,8 +91,8 @@ func RuntimeObjectOrCollect(ctx context.Context, c client.Client, namespace stri
if obj.GetObjectKind().GroupVersionKind().Kind == "Service" {
return nil
}
- // Don't recreate integration contexts, platforms, etc
- if obj.GetObjectKind().GroupVersionKind().Kind == v1alpha1.IntegrationContextKind {
+ // Don't recreate integration kits, platforms, etc
+ if obj.GetObjectKind().GroupVersionKind().Kind == v1alpha1.IntegrationKindKind {
return nil
}
if obj.GetObjectKind().GroupVersionKind().Kind == v1alpha1.IntegrationPlatformKind {
diff --git a/pkg/platform/resources.go b/pkg/platform/resources.go
index 2183651..cc634f1 100644
--- a/pkg/platform/resources.go
+++ b/pkg/platform/resources.go
@@ -19,30 +19,30 @@ package platform
import "strings"
-// DefaultContexts --
-var DefaultContexts = []string{
- "platform-integration-context-jvm.yaml",
- "platform-integration-context-groovy.yaml",
- "platform-integration-context-kotlin.yaml",
+// DefaultKits --
+var DefaultKits = []string{
+ "platform-integration-kit-jvm.yaml",
+ "platform-integration-kit-groovy.yaml",
+ "platform-integration-kit-kotlin.yaml",
}
-// KnativeContexts --
-var KnativeContexts = []string{
- "platform-integration-context-knative.yaml",
+// KnativeKits --
+var KnativeKits = []string{
+ "platform-integration-kit-knative.yaml",
}
-// GetContexts --
-func GetContexts() []string {
- return append(DefaultContexts, KnativeContexts...)
+// GetKits --
+func GetKits() []string {
+ return append(DefaultKits, KnativeKits...)
}
-// GetContextsNames --
-func GetContextsNames() []string {
- ctxs := GetContexts()
+// GetKitsNames --
+func GetKitsNames() []string {
+ ctxs := GetKits()
names := make([]string, 0, len(ctxs))
for _, r := range ctxs {
- r = strings.TrimPrefix(r, "platform-integration-context-")
+ r = strings.TrimPrefix(r, "platform-integration-kit-")
r = strings.TrimSuffix(r, ".yaml")
names = append(names, r)
diff --git a/pkg/trait/builder.go b/pkg/trait/builder.go
index f957841..e0856a2 100644
--- a/pkg/trait/builder.go
+++ b/pkg/trait/builder.go
@@ -40,7 +40,7 @@ func (t *builderTrait) Configure(e *Environment) (bool, error) {
return false, nil
}
- return e.IntegrationContextInPhase(v1alpha1.IntegrationContextPhaseBuildSubmitted), nil
+ return e.IntegrationKitInPhase(v1alpha1.IntegrationKitPhaseBuildSubmitted), nil
}
func (t *builderTrait) Apply(e *Environment) error {
diff --git a/pkg/trait/builder_test.go b/pkg/trait/builder_test.go
index 52bf4ab..a921cc8 100644
--- a/pkg/trait/builder_test.go
+++ b/pkg/trait/builder_test.go
@@ -37,7 +37,7 @@ import (
"github.com/scylladb/go-set/strset"
)
-func TestBuilderTraitNotAppliedBecauseOfNilContext(t *testing.T) {
+func TestBuilderTraitNotAppliedBecauseOfNilKit(t *testing.T) {
environments := []*Environment{
createBuilderTestEnv(v1alpha1.IntegrationPlatformClusterOpenShift, v1alpha1.IntegrationPlatformBuildPublishStrategyS2I),
createBuilderTestEnv(v1alpha1.IntegrationPlatformClusterKubernetes, v1alpha1.IntegrationPlatformBuildPublishStrategyKaniko),
@@ -45,7 +45,7 @@ func TestBuilderTraitNotAppliedBecauseOfNilContext(t *testing.T) {
for _, e := range environments {
e := e // pin
- e.IntegrationContext = nil
+ e.IntegrationKit = nil
t.Run(string(e.Platform.Spec.Cluster), func(t *testing.T) {
err := NewBuilderTestCatalog().apply(e)
@@ -66,7 +66,7 @@ func TestBuilderTraitNotAppliedBecauseOfNilPhase(t *testing.T) {
for _, e := range environments {
e := e // pin
- e.IntegrationContext.Status.Phase = ""
+ e.IntegrationKit.Status.Phase = ""
t.Run(string(e.Platform.Spec.Cluster), func(t *testing.T) {
err := NewBuilderTestCatalog().apply(e)
@@ -138,9 +138,9 @@ func createBuilderTestEnv(cluster v1alpha1.IntegrationPlatformCluster, strategy
Phase: v1alpha1.IntegrationPhaseDeploying,
},
},
- IntegrationContext: &v1alpha1.IntegrationContext{
- Status: v1alpha1.IntegrationContextStatus{
- Phase: v1alpha1.IntegrationContextPhaseBuildSubmitted,
+ IntegrationKit: &v1alpha1.IntegrationKit{
+ Status: v1alpha1.IntegrationKitStatus{
+ Phase: v1alpha1.IntegrationKitPhaseBuildSubmitted,
},
},
Platform: &v1alpha1.IntegrationPlatform{
diff --git a/pkg/trait/camel.go b/pkg/trait/camel.go
index 6094832..1881b2a 100644
--- a/pkg/trait/camel.go
+++ b/pkg/trait/camel.go
@@ -72,7 +72,7 @@ func (t *camelTrait) Apply(e *Environment) error {
e.Integration.Status.RuntimeVersion = e.RuntimeVersion
}
- if e.IntegrationContext != nil {
+ if e.IntegrationKit != nil {
if e.CamelCatalog == nil {
version := e.DetermineCamelVersion()
@@ -80,7 +80,7 @@ func (t *camelTrait) Apply(e *Environment) error {
version = t.Version
}
- c, err := camel.Catalog(e.C, e.Client, e.IntegrationContext.Namespace, version)
+ c, err := camel.Catalog(e.C, e.Client, e.IntegrationKit.Namespace, version)
if err != nil {
return err
}
@@ -91,8 +91,8 @@ func (t *camelTrait) Apply(e *Environment) error {
e.CamelCatalog = c
}
- e.IntegrationContext.Status.CamelVersion = e.CamelCatalog.Version
- e.IntegrationContext.Status.RuntimeVersion = e.RuntimeVersion
+ e.IntegrationKit.Status.CamelVersion = e.CamelCatalog.Version
+ e.IntegrationKit.Status.RuntimeVersion = e.RuntimeVersion
}
return nil
diff --git a/pkg/trait/classpath.go b/pkg/trait/classpath.go
index 697e23b..cb0eff9 100644
--- a/pkg/trait/classpath.go
+++ b/pkg/trait/classpath.go
@@ -51,29 +51,29 @@ func (t *classpathTrait) Configure(e *Environment) (bool, error) {
return false, nil
}
- return e.InPhase(v1alpha1.IntegrationContextPhaseReady, v1alpha1.IntegrationPhaseDeploying), nil
+ return e.InPhase(v1alpha1.IntegrationKitPhaseReady, v1alpha1.IntegrationPhaseDeploying), nil
}
func (t *classpathTrait) Apply(e *Environment) error {
- ctx := e.IntegrationContext
+ kit := e.IntegrationKit
- if ctx == nil && e.Integration.Status.Context != "" {
- name := e.Integration.Status.Context
- c := v1alpha1.NewIntegrationContext(e.Integration.Namespace, name)
+ if kit == nil && e.Integration.Status.Kit != "" {
+ name := e.Integration.Status.Kit
+ k := v1alpha1.NewIntegrationKit(e.Integration.Namespace, name)
key := k8sclient.ObjectKey{
Namespace: e.Integration.Namespace,
Name: name,
}
- if err := t.client.Get(t.ctx, key, &c); err != nil {
- return errors.Wrapf(err, "unable to find integration context %s, %s", name, err)
+ if err := t.client.Get(t.ctx, key, &k); err != nil {
+ return errors.Wrapf(err, "unable to find integration kit %s, %s", name, err)
}
- ctx = &c
+ kit = &k
}
- if ctx == nil {
- return fmt.Errorf("unable to find integration context %s", e.Integration.Status.Context)
+ if kit == nil {
+ return fmt.Errorf("unable to find integration kit %s", e.Integration.Status.Kit)
}
if e.Classpath == nil {
@@ -83,13 +83,13 @@ func (t *classpathTrait) Apply(e *Environment) error {
e.Classpath.Add("/etc/camel/resources")
e.Classpath.Add("./resources")
- for _, artifact := range ctx.Status.Artifacts {
+ for _, artifact := range kit.Status.Artifacts {
e.Classpath.Add(artifact.Target)
}
- if e.IntegrationContext.Labels["camel.apache.org/context.type"] == v1alpha1.IntegrationContextTypeExternal {
+ if e.IntegrationKit.Labels["camel.apache.org/kit.type"] == v1alpha1.IntegrationKitTypeExternal {
//
- // In case of an external created context. we do not have any information about
+ // In case of an external created kit, we do not have any information about
// the classpath so we assume the all jars in /deployments/dependencies/ have
// to be taken into account
//
diff --git a/pkg/trait/deployment.go b/pkg/trait/deployment.go
index c27a0b9..35062ec 100644
--- a/pkg/trait/deployment.go
+++ b/pkg/trait/deployment.go
@@ -55,8 +55,8 @@ func (t *deploymentTrait) Configure(e *Environment) (bool, error) {
}
enabled = strategy == ControllerStrategyDeployment
- } else if e.IntegrationContextInPhase(v1alpha1.IntegrationContextPhaseReady) &&
- e.IntegrationInPhase(v1alpha1.IntegrationPhaseBuildingContext, v1alpha1.IntegrationPhaseResolvingContext) {
+ } else if e.IntegrationKitInPhase(v1alpha1.IntegrationKitPhaseReady) &&
+ e.IntegrationInPhase(v1alpha1.IntegrationPhaseBuildingKit, v1alpha1.IntegrationPhaseResolvingKit) {
enabled = true
}
@@ -71,8 +71,8 @@ func (t *deploymentTrait) Configure(e *Environment) (bool, error) {
}
func (t *deploymentTrait) Apply(e *Environment) error {
- if e.IntegrationContextInPhase(v1alpha1.IntegrationContextPhaseReady) &&
- e.IntegrationInPhase(v1alpha1.IntegrationPhaseBuildingContext, v1alpha1.IntegrationPhaseResolvingContext) {
+ if e.IntegrationKitInPhase(v1alpha1.IntegrationKitPhaseReady) &&
+ e.IntegrationInPhase(v1alpha1.IntegrationPhaseBuildingKit, v1alpha1.IntegrationPhaseResolvingKit) {
e.PostProcessors = append(e.PostProcessors, func(environment *Environment) error {
// trigger integration deploy
@@ -83,7 +83,7 @@ func (t *deploymentTrait) Apply(e *Environment) error {
return nil
}
- if e.InPhase(v1alpha1.IntegrationContextPhaseReady, v1alpha1.IntegrationPhaseDeploying) {
+ if e.InPhase(v1alpha1.IntegrationKitPhaseReady, v1alpha1.IntegrationPhaseDeploying) {
e.Resources.AddAll(e.ComputeConfigMaps())
e.Resources.Add(t.getDeploymentFor(e))
}
@@ -101,7 +101,7 @@ func (t *deploymentTrait) getDeploymentFor(e *Environment) *appsv1.Deployment {
paths := e.ComputeSourcesURI()
environment := make([]corev1.EnvVar, 0)
- // combine Environment of integration with platform, context, integration
+ // combine Environment of integration with platform, kit, integration
for key, value := range e.CollectConfigurationPairs("env") {
envvar.SetVal(&environment, key, value)
}
diff --git a/pkg/trait/environment_test.go b/pkg/trait/environment_test.go
index e6a1bde..a872868 100644
--- a/pkg/trait/environment_test.go
+++ b/pkg/trait/environment_test.go
@@ -48,9 +48,9 @@ func TestDefaultEnvironment(t *testing.T) {
Profile: v1alpha1.TraitProfileOpenShift,
},
},
- IntegrationContext: &v1alpha1.IntegrationContext{
- Status: v1alpha1.IntegrationContextStatus{
- Phase: v1alpha1.IntegrationContextPhaseReady,
+ IntegrationKit: &v1alpha1.IntegrationKit{
+ Status: v1alpha1.IntegrationKitStatus{
+ Phase: v1alpha1.IntegrationKitPhaseReady,
},
},
Platform: &v1alpha1.IntegrationPlatform{
@@ -113,9 +113,9 @@ func TestEnabledContainerMetaDataEnvVars(t *testing.T) {
},
},
},
- IntegrationContext: &v1alpha1.IntegrationContext{
- Status: v1alpha1.IntegrationContextStatus{
- Phase: v1alpha1.IntegrationContextPhaseReady,
+ IntegrationKit: &v1alpha1.IntegrationKit{
+ Status: v1alpha1.IntegrationKitStatus{
+ Phase: v1alpha1.IntegrationKitPhaseReady,
},
},
Platform: &v1alpha1.IntegrationPlatform{
@@ -178,9 +178,9 @@ func TestDisabledContainerMetaDataEnvVars(t *testing.T) {
},
},
},
- IntegrationContext: &v1alpha1.IntegrationContext{
- Status: v1alpha1.IntegrationContextStatus{
- Phase: v1alpha1.IntegrationContextPhaseReady,
+ IntegrationKit: &v1alpha1.IntegrationKit{
+ Status: v1alpha1.IntegrationKitStatus{
+ Phase: v1alpha1.IntegrationKitPhaseReady,
},
},
Platform: &v1alpha1.IntegrationPlatform{
diff --git a/pkg/trait/knative_service.go b/pkg/trait/knative_service.go
index 042470d..811995a 100644
--- a/pkg/trait/knative_service.go
+++ b/pkg/trait/knative_service.go
@@ -62,7 +62,7 @@ func (t *knativeServiceTrait) Configure(e *Environment) (bool, error) {
return false, nil
}
- if !e.InPhase(v1alpha1.IntegrationContextPhaseReady, v1alpha1.IntegrationPhaseDeploying) {
+ if !e.InPhase(v1alpha1.IntegrationKitPhaseReady, v1alpha1.IntegrationPhaseDeploying) {
return false, nil
}
@@ -190,7 +190,7 @@ func (t *knativeServiceTrait) getServiceFor(e *Environment) *serving.Service {
paths := e.ComputeSourcesURI()
environment := &svc.Spec.RunLatest.Configuration.RevisionTemplate.Spec.Container.Env
- // combine Environment of integration with context, integration
+ // combine Environment of integration with kit, integration
for key, value := range e.CollectConfigurationPairs("env") {
envvar.SetVal(environment, key, value)
}
diff --git a/pkg/trait/knative_service_test.go b/pkg/trait/knative_service_test.go
index 4a33982..41921ff 100644
--- a/pkg/trait/knative_service_test.go
+++ b/pkg/trait/knative_service_test.go
@@ -88,9 +88,9 @@ func TestKnativeService(t *testing.T) {
},
},
},
- IntegrationContext: &v1alpha1.IntegrationContext{
- Status: v1alpha1.IntegrationContextStatus{
- Phase: v1alpha1.IntegrationContextPhaseReady,
+ IntegrationKit: &v1alpha1.IntegrationKit{
+ Status: v1alpha1.IntegrationKitStatus{
+ Phase: v1alpha1.IntegrationKitPhaseReady,
},
},
Platform: &v1alpha1.IntegrationPlatform{
diff --git a/pkg/trait/knative_test.go b/pkg/trait/knative_test.go
index 300413e..8efbba5 100644
--- a/pkg/trait/knative_test.go
+++ b/pkg/trait/knative_test.go
@@ -83,9 +83,9 @@ func TestKnativeEnvConfiguration(t *testing.T) {
},
},
},
- IntegrationContext: &v1alpha1.IntegrationContext{
- Status: v1alpha1.IntegrationContextStatus{
- Phase: v1alpha1.IntegrationContextPhaseReady,
+ IntegrationKit: &v1alpha1.IntegrationKit{
+ Status: v1alpha1.IntegrationKitStatus{
+ Phase: v1alpha1.IntegrationKitPhaseReady,
},
},
Platform: &v1alpha1.IntegrationPlatform{
diff --git a/pkg/trait/route_test.go b/pkg/trait/route_test.go
index 58ff495..f55c4ea 100644
--- a/pkg/trait/route_test.go
+++ b/pkg/trait/route_test.go
@@ -51,9 +51,9 @@ func createTestRouteEnvironment(t *testing.T) *Environment {
},
Spec: v1alpha1.IntegrationSpec{},
},
- IntegrationContext: &v1alpha1.IntegrationContext{
- Status: v1alpha1.IntegrationContextStatus{
- Phase: v1alpha1.IntegrationContextPhaseReady,
+ IntegrationKit: &v1alpha1.IntegrationKit{
+ Status: v1alpha1.IntegrationKitStatus{
+ Phase: v1alpha1.IntegrationKitPhaseReady,
},
},
Platform: &v1alpha1.IntegrationPlatform{
diff --git a/pkg/trait/trait.go b/pkg/trait/trait.go
index b9cf9bb..96cb15f 100644
--- a/pkg/trait/trait.go
+++ b/pkg/trait/trait.go
@@ -34,8 +34,8 @@ import (
const True = "true"
// Apply --
-func Apply(ctx context.Context, c client.Client, integration *v1alpha1.Integration, ictx *v1alpha1.IntegrationContext) (*Environment, error) {
- environment, err := newEnvironment(ctx, c, integration, ictx)
+func Apply(ctx context.Context, c client.Client, integration *v1alpha1.Integration, kit *v1alpha1.IntegrationKit) (*Environment, error) {
+ environment, err := newEnvironment(ctx, c, integration, kit)
if err != nil {
return nil, err
}
@@ -54,16 +54,16 @@ func Apply(ctx context.Context, c client.Client, integration *v1alpha1.Integrati
}
// newEnvironment creates a Environment from the given data
-func newEnvironment(ctx context.Context, c client.Client, integration *v1alpha1.Integration, ictx *v1alpha1.IntegrationContext) (*Environment, error) {
+func newEnvironment(ctx context.Context, c client.Client, integration *v1alpha1.Integration, kit *v1alpha1.IntegrationKit) (*Environment, error) {
if integration == nil && ctx == nil {
- return nil, errors.New("neither integration nor context are ste")
+ return nil, errors.New("neither integration nor kit are ste")
}
namespace := ""
if integration != nil {
namespace = integration.Namespace
- } else if ictx != nil {
- namespace = ictx.Namespace
+ } else if kit != nil {
+ namespace = kit.Namespace
}
pl, err := platform.GetCurrentPlatform(ctx, c, namespace)
@@ -71,22 +71,22 @@ func newEnvironment(ctx context.Context, c client.Client, integration *v1alpha1.
return nil, err
}
- if ictx == nil {
- ictx, err = GetIntegrationContext(ctx, c, integration)
+ if kit == nil {
+ kit, err = GetIntegrationKit(ctx, c, integration)
if err != nil {
return nil, err
}
}
env := Environment{
- C: ctx,
- Platform: pl,
- Client: c,
- IntegrationContext: ictx,
- Integration: integration,
- ExecutedTraits: make([]Trait, 0),
- Resources: kubernetes.NewCollection(),
- EnvVars: make([]corev1.EnvVar, 0),
+ C: ctx,
+ Platform: pl,
+ Client: c,
+ IntegrationKit: kit,
+ Integration: integration,
+ ExecutedTraits: make([]Trait, 0),
+ Resources: kubernetes.NewCollection(),
+ EnvVars: make([]corev1.EnvVar, 0),
}
return &env, nil
diff --git a/pkg/trait/trait_catalog.go b/pkg/trait/trait_catalog.go
index bea399a..ffb2b79 100644
--- a/pkg/trait/trait_catalog.go
+++ b/pkg/trait/trait_catalog.go
@@ -242,8 +242,8 @@ func (c *Catalog) configure(env *Environment) error {
return err
}
}
- if env.IntegrationContext != nil && env.IntegrationContext.Spec.Traits != nil {
- if err := c.configureTraits(env.IntegrationContext.Spec.Traits); err != nil {
+ if env.IntegrationKit != nil && env.IntegrationKit.Spec.Traits != nil {
+ if err := c.configureTraits(env.IntegrationKit.Spec.Traits); err != nil {
return err
}
}
diff --git a/pkg/trait/trait_test.go b/pkg/trait/trait_test.go
index bb7eb97..f6798ea 100644
--- a/pkg/trait/trait_test.go
+++ b/pkg/trait/trait_test.go
@@ -178,8 +178,8 @@ func TestTraitHierarchyDecode(t *testing.T) {
},
}
- env.IntegrationContext.Spec.Traits = make(map[string]v1alpha1.TraitSpec)
- env.IntegrationContext.Spec.Traits["knative-service"] = v1alpha1.TraitSpec{
+ env.IntegrationKit.Spec.Traits = make(map[string]v1alpha1.TraitSpec)
+ env.IntegrationKit.Spec.Traits["knative-service"] = v1alpha1.TraitSpec{
Configuration: map[string]string{
"enabled": "true",
"min-scale": "5",
@@ -417,9 +417,9 @@ func createTestEnv(t *testing.T, cluster v1alpha1.IntegrationPlatformCluster, sc
Phase: v1alpha1.IntegrationPhaseDeploying,
},
},
- IntegrationContext: &v1alpha1.IntegrationContext{
- Status: v1alpha1.IntegrationContextStatus{
- Phase: v1alpha1.IntegrationContextPhaseReady,
+ IntegrationKit: &v1alpha1.IntegrationKit{
+ Status: v1alpha1.IntegrationKitStatus{
+ Phase: v1alpha1.IntegrationKitPhaseReady,
},
},
Platform: &v1alpha1.IntegrationPlatform{
diff --git a/pkg/trait/trait_types.go b/pkg/trait/trait_types.go
index e750fd7..92331ba 100644
--- a/pkg/trait/trait_types.go
+++ b/pkg/trait/trait_types.go
@@ -100,22 +100,22 @@ func (trait *BaseTrait) InjectContext(ctx context.Context) {
// A Environment provides the context where the trait is executed
type Environment struct {
- CamelCatalog *camel.RuntimeCatalog
- RuntimeVersion string
- Catalog *Catalog
- C context.Context
- Client client.Client
- Platform *v1alpha1.IntegrationPlatform
- IntegrationContext *v1alpha1.IntegrationContext
- Integration *v1alpha1.Integration
- Resources *kubernetes.Collection
- PostActions []func(*Environment) error
- PostProcessors []func(*Environment) error
- Steps []builder.Step
- BuildDir string
- ExecutedTraits []Trait
- EnvVars []corev1.EnvVar
- Classpath *strset.Set
+ CamelCatalog *camel.RuntimeCatalog
+ RuntimeVersion string
+ Catalog *Catalog
+ C context.Context
+ Client client.Client
+ Platform *v1alpha1.IntegrationPlatform
+ IntegrationKit *v1alpha1.IntegrationKit
+ Integration *v1alpha1.Integration
+ Resources *kubernetes.Collection
+ PostActions []func(*Environment) error
+ PostProcessors []func(*Environment) error
+ Steps []builder.Step
+ BuildDir string
+ ExecutedTraits []Trait
+ EnvVars []corev1.EnvVar
+ Classpath *strset.Set
}
// ControllerStrategy is used to determine the kind of controller that needs to be created for the integration
@@ -153,14 +153,14 @@ func (e *Environment) IntegrationInPhase(phases ...v1alpha1.IntegrationPhase) bo
return false
}
-// IntegrationContextInPhase --
-func (e *Environment) IntegrationContextInPhase(phases ...v1alpha1.IntegrationContextPhase) bool {
- if e.IntegrationContext == nil {
+// IntegrationKitInPhase --
+func (e *Environment) IntegrationKitInPhase(phases ...v1alpha1.IntegrationKitPhase) bool {
+ if e.IntegrationKit == nil {
return false
}
for _, phase := range phases {
- if e.IntegrationContext.Status.Phase == phase {
+ if e.IntegrationKit.Status.Phase == phase {
return true
}
}
@@ -169,21 +169,21 @@ func (e *Environment) IntegrationContextInPhase(phases ...v1alpha1.IntegrationCo
}
// InPhase --
-func (e *Environment) InPhase(c v1alpha1.IntegrationContextPhase, i v1alpha1.IntegrationPhase) bool {
- return e.IntegrationContextInPhase(c) && e.IntegrationInPhase(i)
+func (e *Environment) InPhase(c v1alpha1.IntegrationKitPhase, i v1alpha1.IntegrationPhase) bool {
+ return e.IntegrationKitInPhase(c) && e.IntegrationInPhase(i)
}
// DetermineProfile determines the TraitProfile of the environment.
// First looking at the Integration.Spec for a Profile,
-// next looking at the IntegrationContext.Spec
+// next looking at the IntegrationKit.Spec
// and lastly the Platform Profile
func (e *Environment) DetermineProfile() v1alpha1.TraitProfile {
if e.Integration != nil && e.Integration.Spec.Profile != "" {
return e.Integration.Spec.Profile
}
- if e.IntegrationContext != nil && e.IntegrationContext.Spec.Profile != "" {
- return e.IntegrationContext.Spec.Profile
+ if e.IntegrationKit != nil && e.IntegrationKit.Spec.Profile != "" {
+ return e.IntegrationKit.Spec.Profile
}
return platform.GetProfile(e.Platform)
@@ -227,8 +227,8 @@ func (e *Environment) DetermineCamelVersion() string {
if e.Integration != nil {
version = e.Integration.Status.CamelVersion
}
- if e.IntegrationContext != nil && version == "" {
- version = e.IntegrationContext.Status.CamelVersion
+ if e.IntegrationKit != nil && version == "" {
+ version = e.IntegrationKit.Status.CamelVersion
}
if version == "" {
version = e.Platform.Spec.Build.CamelVersion
@@ -244,8 +244,8 @@ func (e *Environment) DetermineRuntimeVersion() string {
if e.Integration != nil {
version = e.Integration.Status.RuntimeVersion
}
- if e.IntegrationContext != nil && version == "" {
- version = e.IntegrationContext.Status.RuntimeVersion
+ if e.IntegrationKit != nil && version == "" {
+ version = e.IntegrationKit.Status.RuntimeVersion
}
if version == "" {
version = e.Platform.Spec.Build.RuntimeVersion
@@ -259,7 +259,7 @@ func (e *Environment) ComputeConfigMaps() []runtime.Object {
sources := e.Integration.Sources()
maps := make([]runtime.Object, 0, len(sources)+1)
- // combine properties of integration with context, integration
+ // combine properties of integration with kit, integration
// properties have the priority
properties := ""
@@ -578,10 +578,10 @@ func (e *Environment) ConfigureVolumesAndMounts(vols *[]corev1.Volume, mnts *[]c
// CollectConfigurationValues --
func (e *Environment) CollectConfigurationValues(configurationType string) []string {
- return CollectConfigurationValues(configurationType, e.Platform, e.IntegrationContext, e.Integration)
+ return CollectConfigurationValues(configurationType, e.Platform, e.IntegrationKit, e.Integration)
}
// CollectConfigurationPairs --
func (e *Environment) CollectConfigurationPairs(configurationType string) map[string]string {
- return CollectConfigurationPairs(configurationType, e.Platform, e.IntegrationContext, e.Integration)
+ return CollectConfigurationPairs(configurationType, e.Platform, e.IntegrationKit, e.Integration)
}
diff --git a/pkg/trait/util.go b/pkg/trait/util.go
index fea765d..da5b20a 100644
--- a/pkg/trait/util.go
+++ b/pkg/trait/util.go
@@ -33,20 +33,20 @@ import (
k8sclient "sigs.k8s.io/controller-runtime/pkg/client"
)
-// GetIntegrationContext retrieves the context set on the integration
-func GetIntegrationContext(ctx context.Context, c client.Client, integration *v1alpha1.Integration) (*v1alpha1.IntegrationContext, error) {
- if integration.Status.Context == "" {
+// GetIntegrationKit retrieves the kit set on the integration
+func GetIntegrationKit(ctx context.Context, c client.Client, integration *v1alpha1.Integration) (*v1alpha1.IntegrationKit, error) {
+ if integration.Status.Kit == "" {
return nil, nil
}
- name := integration.Status.Context
- ictx := v1alpha1.NewIntegrationContext(integration.Namespace, name)
+ name := integration.Status.Kit
+ kit := v1alpha1.NewIntegrationKit(integration.Namespace, name)
key := k8sclient.ObjectKey{
Namespace: integration.Namespace,
Name: name,
}
- err := c.Get(ctx, key, &ictx)
- return &ictx, err
+ err := c.Get(ctx, key, &kit)
+ return &kit, err
}
// CollectConfigurationValues --
diff --git a/pkg/trait/util_test.go b/pkg/trait/util_test.go
index 3c75fe3..ec2709e 100644
--- a/pkg/trait/util_test.go
+++ b/pkg/trait/util_test.go
@@ -35,11 +35,11 @@ func TestCollectConfigurationValues(t *testing.T) {
},
},
},
- IntegrationContext: &v1alpha1.IntegrationContext{
- Spec: v1alpha1.IntegrationContextSpec{
+ IntegrationKit: &v1alpha1.IntegrationKit{
+ Spec: v1alpha1.IntegrationKitSpec{
Configuration: []v1alpha1.ConfigurationSpec{
- {Type: "configmap", Value: "my-cm-context"},
- {Type: "property", Value: "my-p-context"},
+ {Type: "configmap", Value: "my-cm-kit"},
+ {Type: "property", Value: "my-p-kit"},
},
},
},
@@ -57,7 +57,7 @@ func TestCollectConfigurationValues(t *testing.T) {
assert.Contains(t, e.CollectConfigurationValues("configmap"), "my-cm-integration")
assert.Contains(t, e.CollectConfigurationValues("secret"), "my-secret-platform")
- assert.Contains(t, e.CollectConfigurationValues("property"), "my-p-context")
+ assert.Contains(t, e.CollectConfigurationValues("property"), "my-p-kit")
assert.Contains(t, e.CollectConfigurationValues("env"), "my-env-integration")
}
@@ -71,11 +71,11 @@ func TestCollectConfigurationPairs(t *testing.T) {
},
},
},
- IntegrationContext: &v1alpha1.IntegrationContext{
- Spec: v1alpha1.IntegrationContextSpec{
+ IntegrationKit: &v1alpha1.IntegrationKit{
+ Spec: v1alpha1.IntegrationKitSpec{
Configuration: []v1alpha1.ConfigurationSpec{
- {Type: "property", Value: "p1=context"},
- {Type: "property", Value: "p2=context"},
+ {Type: "property", Value: "p1=kit"},
+ {Type: "property", Value: "p2=kit"},
},
},
},
@@ -93,7 +93,7 @@ func TestCollectConfigurationPairs(t *testing.T) {
pairs := e.CollectConfigurationPairs("property")
assert.Equal(t, "integration", pairs["p1"])
- assert.Equal(t, "context", pairs["p2"])
+ assert.Equal(t, "kit", pairs["p2"])
assert.Equal(t, "platform", pairs["p3"])
assert.Equal(t, "integration", pairs["p4"])
}
diff --git a/pkg/util/cancellable/cancellable.go b/pkg/util/cancellable/cancellable.go
index 3e90d31..41f478f 100644
--- a/pkg/util/cancellable/cancellable.go
+++ b/pkg/util/cancellable/cancellable.go
@@ -19,7 +19,7 @@ package cancellable
import "context"
-// Context --
+// Kit --
type Context interface {
context.Context
diff --git a/pkg/util/digest/digest.go b/pkg/util/digest/digest.go
index 1cec6b7..2c1acf2 100644
--- a/pkg/util/digest/digest.go
+++ b/pkg/util/digest/digest.go
@@ -35,8 +35,8 @@ func ComputeForIntegration(integration *v1alpha1.Integration) (string, error) {
if _, err := hash.Write([]byte(defaults.Version)); err != nil {
return "", err
}
- // Integration Context is relevant
- if _, err := hash.Write([]byte(integration.Spec.Context)); err != nil {
+ // Integration Kit is relevant
+ if _, err := hash.Write([]byte(integration.Spec.Kit)); err != nil {
return "", err
}
@@ -75,21 +75,21 @@ func ComputeForIntegration(integration *v1alpha1.Integration) (string, error) {
return digest, nil
}
-// ComputeForIntegrationContext a digest of the fields that are relevant for the deployment
+// ComputeForIntegrationKit a digest of the fields that are relevant for the deployment
// Produces a digest that can be used as docker image tag
-func ComputeForIntegrationContext(context *v1alpha1.IntegrationContext) (string, error) {
+func ComputeForIntegrationKit(kit *v1alpha1.IntegrationKit) (string, error) {
hash := sha256.New()
// Operator version is relevant
if _, err := hash.Write([]byte(defaults.Version)); err != nil {
return "", err
}
- for _, item := range context.Spec.Dependencies {
+ for _, item := range kit.Spec.Dependencies {
if _, err := hash.Write([]byte(item)); err != nil {
return "", err
}
}
- for _, item := range context.Spec.Configuration {
+ for _, item := range kit.Spec.Configuration {
if _, err := hash.Write([]byte(item.String())); err != nil {
return "", err
}
diff --git a/pkg/util/kubernetes/util.go b/pkg/util/kubernetes/util.go
index 45b8a59..2d29d25 100644
--- a/pkg/util/kubernetes/util.go
+++ b/pkg/util/kubernetes/util.go
@@ -120,13 +120,13 @@ func GetSecret(context context.Context, client client.Client, name string, names
}
// GetIntegrationContext --
-func GetIntegrationContext(context context.Context, client client.Client, name string, namespace string) (*v1alpha1.IntegrationContext, error) {
+func GetIntegrationContext(context context.Context, client client.Client, name string, namespace string) (*v1alpha1.IntegrationKit, error) {
key := k8sclient.ObjectKey{
Name: name,
Namespace: namespace,
}
- answer := v1alpha1.NewIntegrationContext(namespace, name)
+ answer := v1alpha1.NewIntegrationKit(namespace, name)
if err := client.Get(context, key, &answer); err != nil {
return nil, err
diff --git a/pkg/util/log/log.go b/pkg/util/log/log.go
index 0de51c4..ec09599 100644
--- a/pkg/util/log/log.go
+++ b/pkg/util/log/log.go
@@ -104,8 +104,8 @@ func (l Logger) ForIntegration(target *v1alpha1.Integration) Logger {
)
}
-// ForIntegrationContext --
-func (l Logger) ForIntegrationContext(target *v1alpha1.IntegrationContext) Logger {
+// ForIntegrationKit --
+func (l Logger) ForIntegrationKit(target *v1alpha1.IntegrationKit) Logger {
return l.WithValues(
"api-version", target.APIVersion,
"kind", target.Kind,
@@ -145,9 +145,9 @@ func ForIntegration(target *v1alpha1.Integration) Logger {
return Log.ForIntegration(target)
}
-// ForIntegrationContext --
-func ForIntegrationContext(target *v1alpha1.IntegrationContext) Logger {
- return Log.ForIntegrationContext(target)
+// ForIntegrationKit --
+func ForIntegrationKit(target *v1alpha1.IntegrationKit) Logger {
+ return Log.ForIntegrationKit(target)
}
// ForIntegrationPlatform --
diff --git a/pkg/util/maven/maven_types.go b/pkg/util/maven/maven_types.go
index 24ff0a3..969a69a 100644
--- a/pkg/util/maven/maven_types.go
+++ b/pkg/util/maven/maven_types.go
@@ -98,7 +98,7 @@ func NewContext(buildDir string, project Project) Context {
}
}
-// Context --
+// Kit --
type Context struct {
Path string
Project Project
diff --git a/test/cluster_integration_test.go b/test/cluster_integration_test.go
index 93897b8..d18aa72 100644
--- a/test/cluster_integration_test.go
+++ b/test/cluster_integration_test.go
@@ -29,7 +29,7 @@ import (
)
func TestInstallation(t *testing.T) {
- installedCtxCRD, err := install.IsCRDInstalled(testContext, testClient, "IntegrationContext")
+ installedCtxCRD, err := install.IsCRDInstalled(testContext, testClient, "IntegrationKit")
assert.Nil(t, err)
assert.True(t, installedCtxCRD)