You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2023/04/26 08:51:21 UTC

[camel-k] 05/18: chore(api): add a deprecation notice

This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 46aad9b0c0182241250882fe0e25dd294b4ef9d1
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Tue Mar 28 15:59:04 2023 +0200

    chore(api): add a deprecation notice
---
 .../bases/camel.apache.org_kameletbindings.yaml    | 25 ++++++++++++++++------
 helm/camel-k/crds/crd-kamelet-binding.yaml         | 24 ++++++++++-----------
 pkg/apis/camel/v1alpha1/error_handler_types.go     |  2 ++
 .../camel/v1alpha1/error_handler_types_support.go  |  2 ++
 pkg/apis/camel/v1alpha1/jsonschema_types.go        |  2 ++
 pkg/apis/camel/v1alpha1/kamelet_binding_types.go   |  2 ++
 .../v1alpha1/kamelet_binding_types_support.go      |  2 ++
 .../v1alpha1/kamelet_binding_types_support_test.go |  2 ++
 pkg/apis/camel/v1alpha1/kamelet_types.go           |  2 ++
 pkg/apis/camel/v1alpha1/kamelet_types_support.go   |  2 ++
 pkg/apis/camel/v1alpha1/register.go                |  2 ++
 pkg/install/cluster.go                             |  4 ++--
 pkg/util/reference/reference.go                    |  4 ++--
 script/gen_crd.sh                                  |  3 ++-
 14 files changed, 54 insertions(+), 24 deletions(-)

diff --git a/config/crd/bases/camel.apache.org_kameletbindings.yaml b/config/crd/bases/camel.apache.org_kameletbindings.yaml
index 8269eee53..bbec3c111 100644
--- a/config/crd/bases/camel.apache.org_kameletbindings.yaml
+++ b/config/crd/bases/camel.apache.org_kameletbindings.yaml
@@ -1,11 +1,28 @@
+# ---------------------------------------------------------------------------
+# 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: apiextensions.k8s.io/v1
 kind: CustomResourceDefinition
 metadata:
   annotations:
     controller-gen.kubebuilder.io/version: v0.6.1
   creationTimestamp: null
+  labels:
+    app: camel-k
   name: kameletbindings.camel.apache.org
 spec:
   group: camel.apache.org
@@ -8513,9 +8530,3 @@ spec:
         specReplicasPath: .spec.replicas
         statusReplicasPath: .status.replicas
       status: {}
-status:
-  acceptedNames:
-    kind: ""
-    plural: ""
-  conditions: []
-  storedVersions: []
diff --git a/helm/camel-k/crds/crd-kamelet-binding.yaml b/helm/camel-k/crds/crd-kamelet-binding.yaml
index b1b019aa4..bbec3c111 100644
--- a/helm/camel-k/crds/crd-kamelet-binding.yaml
+++ b/helm/camel-k/crds/crd-kamelet-binding.yaml
@@ -23,23 +23,23 @@ metadata:
   creationTimestamp: null
   labels:
     app: camel-k
-  name: bindings.camel.apache.org
+  name: kameletbindings.camel.apache.org
 spec:
   group: camel.apache.org
   names:
     categories:
     - kamel
     - camel
-    kind: Binding
-    listKind: BindingList
-    plural: bindings
+    kind: KameletBinding
+    listKind: KameletBindingList
+    plural: kameletbindings
     shortNames:
     - klb
-    singular: binding
+    singular: kameletbinding
   scope: Namespaced
   versions:
   - additionalPrinterColumns:
-    - description: TheBinding phase
+    - description: The Kamelet Binding phase
       jsonPath: .status.phase
       name: Phase
       type: string
@@ -50,7 +50,7 @@ spec:
     name: v1alpha1
     schema:
       openAPIV3Schema:
-        description: Binding is the Schema for the kamelets binding API
+        description: KameletBinding is the Schema for the kamelets binding API
         properties:
           apiVersion:
             description: 'APIVersion defines the versioned schema of this representation
@@ -65,7 +65,7 @@ spec:
           metadata:
             type: object
           spec:
-            description: the specification of a Binding
+            description: the specification of a KameletBinding
             properties:
               errorHandler:
                 description: ErrorHandler is an optional handler called upon an error
@@ -8410,12 +8410,12 @@ spec:
                 type: array
             type: object
           status:
-            description: the status of a Binding
+            description: the status of a KameletBinding
             properties:
               conditions:
                 description: Conditions --
                 items:
-                  description: BindingCondition describes the state of a resource
+                  description: KameletBindingCondition describes the state of a resource
                     at a certain point.
                   properties:
                     lastTransitionTime:
@@ -8498,7 +8498,7 @@ spec:
                       description: Status of the condition, one of True, False, Unknown.
                       type: string
                     type:
-                      description: Type of binding condition.
+                      description: Type of kameletBinding condition.
                       type: string
                   required:
                   - status
@@ -8507,7 +8507,7 @@ spec:
                 type: array
               observedGeneration:
                 description: ObservedGeneration is the most recent generation observed
-                  for this Binding.
+                  for this KameletBinding.
                 format: int64
                 type: integer
               phase:
diff --git a/pkg/apis/camel/v1alpha1/error_handler_types.go b/pkg/apis/camel/v1alpha1/error_handler_types.go
index 52a32e60a..1d83d2081 100644
--- a/pkg/apis/camel/v1alpha1/error_handler_types.go
+++ b/pkg/apis/camel/v1alpha1/error_handler_types.go
@@ -15,6 +15,8 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
+// Package v1alpha1 is deprecated: use the v1 API instead
+// Deprecated
 package v1alpha1
 
 const (
diff --git a/pkg/apis/camel/v1alpha1/error_handler_types_support.go b/pkg/apis/camel/v1alpha1/error_handler_types_support.go
index 79f473a70..09cf74826 100644
--- a/pkg/apis/camel/v1alpha1/error_handler_types_support.go
+++ b/pkg/apis/camel/v1alpha1/error_handler_types_support.go
@@ -15,6 +15,8 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
+// Package v1alpha1 is deprecated: use the v1 API instead
+// Deprecated
 package v1alpha1
 
 import (
diff --git a/pkg/apis/camel/v1alpha1/jsonschema_types.go b/pkg/apis/camel/v1alpha1/jsonschema_types.go
index c9cdc4362..c36a05bc5 100644
--- a/pkg/apis/camel/v1alpha1/jsonschema_types.go
+++ b/pkg/apis/camel/v1alpha1/jsonschema_types.go
@@ -17,6 +17,8 @@ limitations under the License.
 
 // NOTE: this file has been originally copied from https://github.com/kubernetes/apiextensions-apiserver/blob/33bb2d8b009bae408e40818a93877459efeb4cb1/pkg/apis/apiextensions/v1/types_jsonschema.go
 
+// Package v1alpha1 is deprecated: use the v1 API instead
+// Deprecated
 package v1alpha1
 
 import (
diff --git a/pkg/apis/camel/v1alpha1/kamelet_binding_types.go b/pkg/apis/camel/v1alpha1/kamelet_binding_types.go
index fb1e44bc4..4659505a4 100644
--- a/pkg/apis/camel/v1alpha1/kamelet_binding_types.go
+++ b/pkg/apis/camel/v1alpha1/kamelet_binding_types.go
@@ -15,6 +15,8 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
+// Package v1alpha1 is deprecated: use the v1 API instead
+// Deprecated
 package v1alpha1
 
 import (
diff --git a/pkg/apis/camel/v1alpha1/kamelet_binding_types_support.go b/pkg/apis/camel/v1alpha1/kamelet_binding_types_support.go
index 20d55df1b..bfe3da8b3 100644
--- a/pkg/apis/camel/v1alpha1/kamelet_binding_types_support.go
+++ b/pkg/apis/camel/v1alpha1/kamelet_binding_types_support.go
@@ -15,6 +15,8 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
+// Package v1alpha1 is deprecated: use the v1 API instead
+// Deprecated
 package v1alpha1
 
 import (
diff --git a/pkg/apis/camel/v1alpha1/kamelet_binding_types_support_test.go b/pkg/apis/camel/v1alpha1/kamelet_binding_types_support_test.go
index ac77de187..1f9b4d143 100644
--- a/pkg/apis/camel/v1alpha1/kamelet_binding_types_support_test.go
+++ b/pkg/apis/camel/v1alpha1/kamelet_binding_types_support_test.go
@@ -15,6 +15,8 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
+// Package v1alpha1 is deprecated: use the v1 API instead
+// Deprecated
 package v1alpha1
 
 import (
diff --git a/pkg/apis/camel/v1alpha1/kamelet_types.go b/pkg/apis/camel/v1alpha1/kamelet_types.go
index d9bd295d7..0dba0c9ab 100644
--- a/pkg/apis/camel/v1alpha1/kamelet_types.go
+++ b/pkg/apis/camel/v1alpha1/kamelet_types.go
@@ -15,6 +15,8 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
+// Package v1alpha1 is deprecated: use the v1 API instead
+// Deprecated
 package v1alpha1
 
 import (
diff --git a/pkg/apis/camel/v1alpha1/kamelet_types_support.go b/pkg/apis/camel/v1alpha1/kamelet_types_support.go
index c15e5dd4b..746d486f7 100644
--- a/pkg/apis/camel/v1alpha1/kamelet_types_support.go
+++ b/pkg/apis/camel/v1alpha1/kamelet_types_support.go
@@ -15,6 +15,8 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
+// Package v1alpha1 is deprecated: use the v1 API instead
+// Deprecated
 package v1alpha1
 
 import (
diff --git a/pkg/apis/camel/v1alpha1/register.go b/pkg/apis/camel/v1alpha1/register.go
index f472e4d78..e90d44ad3 100644
--- a/pkg/apis/camel/v1alpha1/register.go
+++ b/pkg/apis/camel/v1alpha1/register.go
@@ -16,6 +16,8 @@ limitations under the License.
 */
 
 // Package v1alpha1 contains Camel unstable API Schema definitions
+// Package v1alpha1 is deprecated: use the v1 API instead
+// Deprecated
 // +kubebuilder:object:generate=true
 // +groupName=camel.apache.org
 package v1alpha1
diff --git a/pkg/install/cluster.go b/pkg/install/cluster.go
index 36ba39079..169fcf994 100644
--- a/pkg/install/cluster.go
+++ b/pkg/install/cluster.go
@@ -307,12 +307,12 @@ func areAllCrdInstalled(c client.Client) (bool, error) {
 	} else if !ok {
 		return false, nil
 	}
-	if ok, err := isCrdInstalled(c, "Kamelet", "v1alpha1"); err != nil {
+	if ok, err := isCrdInstalled(c, "Kamelet", "v1"); err != nil {
 		return ok, err
 	} else if !ok {
 		return false, nil
 	}
-	return isCrdInstalled(c, "Binding", "v1alpha1")
+	return isCrdInstalled(c, "Binding", "v1")
 }
 
 func isCrdInstalled(c client.Client, kind string, version string) (bool, error) {
diff --git a/pkg/util/reference/reference.go b/pkg/util/reference/reference.go
index 43dc1581a..d3f506f1e 100644
--- a/pkg/util/reference/reference.go
+++ b/pkg/util/reference/reference.go
@@ -24,7 +24,7 @@ import (
 	"strings"
 	"unicode"
 
-	camelv1alpha1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
+	v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
 	"github.com/pkg/errors"
 	corev1 "k8s.io/api/core/v1"
 	eventingv1 "knative.dev/eventing/pkg/apis/eventing/v1"
@@ -44,7 +44,7 @@ var (
 	templates = map[string]corev1.ObjectReference{
 		"kamelet": {
 			Kind:       "Kamelet",
-			APIVersion: camelv1alpha1.SchemeGroupVersion.String(),
+			APIVersion: v1.SchemeGroupVersion.String(),
 		},
 		"channel": {
 			Kind:       "Channel",
diff --git a/script/gen_crd.sh b/script/gen_crd.sh
index d4e20f71d..aa2c70787 100755
--- a/script/gen_crd.sh
+++ b/script/gen_crd.sh
@@ -68,4 +68,5 @@ deploy_crd integration integrations
 deploy_crd integration-kit integrationkits
 deploy_crd integration-platform integrationplatforms
 deploy_crd kamelet kamelets
-deploy_crd binding bindings
+deploy_crd kamelet-binding kameletbindings
+deploy_crd binding bindings
\ No newline at end of file