You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2020/10/05 14:51:09 UTC
[camel-k] 02/08: chore: Migrate from +k8s deprecated markers to
corresponding +kubebuilder ones
This is an automated email from the ASF dual-hosted git repository.
nferraro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 1bf95e9b323d535eace95d7ab4943cf37f2620df
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Mon Oct 5 12:40:52 2020 +0200
chore: Migrate from +k8s deprecated markers to corresponding +kubebuilder ones
---
pkg/apis/camel/v1/build_types.go | 9 +++------
pkg/apis/camel/v1/common_types.go | 4 +++-
pkg/apis/camel/v1/integration_types.go | 6 +++---
pkg/apis/camel/v1/integrationkit_types.go | 6 +++---
pkg/apis/camel/v1/integrationplatform_types.go | 6 +++---
pkg/apis/camel/v1/register.go | 2 +-
pkg/apis/camel/v1alpha1/kamelet_types.go | 8 ++++----
pkg/apis/camel/v1alpha1/register.go | 4 +---
8 files changed, 21 insertions(+), 24 deletions(-)
diff --git a/pkg/apis/camel/v1/build_types.go b/pkg/apis/camel/v1/build_types.go
index 0ca018c..e9f3101 100644
--- a/pkg/apis/camel/v1/build_types.go
+++ b/pkg/apis/camel/v1/build_types.go
@@ -22,13 +22,11 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
-// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
+// Important: Run "make generate-deepcopy" to regenerate code after modifying this file
// BuildSpec defines the desired state of Build
type BuildSpec struct {
- // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
- // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
Tasks []Task `json:"tasks,omitempty"`
}
@@ -136,9 +134,8 @@ const (
BuildConditionPlatformAvailableReason string = "IntegrationPlatformAvailable"
)
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// +k8s:openapi-gen=true
// +genclient
+// +kubebuilder:object:root=true
// +kubebuilder:resource:path=builds,scope=Namespaced,shortName=ikb,categories=kamel;camel
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`,description="The build phase"
@@ -157,7 +154,7 @@ type Build struct {
Status BuildStatus `json:"status,omitempty"`
}
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +kubebuilder:object:root=true
// BuildList contains a list of Build
type BuildList struct {
diff --git a/pkg/apis/camel/v1/common_types.go b/pkg/apis/camel/v1/common_types.go
index eb7639e..1a852f0 100644
--- a/pkg/apis/camel/v1/common_types.go
+++ b/pkg/apis/camel/v1/common_types.go
@@ -59,17 +59,18 @@ type TraitSpec struct {
}
// +kubebuilder:validation:Type=object
-
// TraitConfiguration --
type TraitConfiguration struct {
json.RawMessage `json:",inline"`
}
+// +kubebuilder:object:generate=false
// Configurable --
type Configurable interface {
Configurations() []ConfigurationSpec
}
+// +kubebuilder:object:generate=false
// PlatformInjectable --
type PlatformInjectable interface {
SetIntegrationPlatform(platform *IntegrationPlatform)
@@ -133,6 +134,7 @@ const (
CapabilityMaster = "master"
)
+// +kubebuilder:object:generate=false
// ResourceCondition is a common type for all conditions
type ResourceCondition interface {
GetType() string
diff --git a/pkg/apis/camel/v1/integration_types.go b/pkg/apis/camel/v1/integration_types.go
index 47aeb44..91d8c57 100644
--- a/pkg/apis/camel/v1/integration_types.go
+++ b/pkg/apis/camel/v1/integration_types.go
@@ -23,6 +23,7 @@ import (
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
+// Important: Run "make generate-deepcopy" to regenerate code after modifying this file
// IntegrationSpec defines the desired state of Integration
type IntegrationSpec struct {
@@ -61,9 +62,8 @@ type IntegrationStatus struct {
Capabilities []string `json:"capabilities,omitempty"`
}
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// +k8s:openapi-gen=true
// +genclient
+// +kubebuilder:object:root=true
// +kubebuilder:resource:path=integrations,scope=Namespaced,shortName=it,categories=kamel;camel
// +kubebuilder:subresource:status
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector
@@ -80,7 +80,7 @@ type Integration struct {
Status IntegrationStatus `json:"status,omitempty"`
}
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +kubebuilder:object:root=true
// IntegrationList contains a list of Integration
type IntegrationList struct {
diff --git a/pkg/apis/camel/v1/integrationkit_types.go b/pkg/apis/camel/v1/integrationkit_types.go
index deead1a..5d1d68a 100644
--- a/pkg/apis/camel/v1/integrationkit_types.go
+++ b/pkg/apis/camel/v1/integrationkit_types.go
@@ -23,6 +23,7 @@ import (
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
+// Important: Run "make generate-deepcopy" to regenerate code after modifying this file
// IntegrationKitSpec defines the desired state of IntegrationKit
type IntegrationKitSpec struct {
@@ -49,9 +50,8 @@ type IntegrationKitStatus struct {
Version string `json:"version,omitempty"`
}
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// +k8s:openapi-gen=true
// +genclient
+// +kubebuilder:object:root=true
// +kubebuilder:resource:path=integrationkits,scope=Namespaced,shortName=ik,categories=kamel;camel
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`,description="The integration kit phase"
@@ -67,7 +67,7 @@ type IntegrationKit struct {
Status IntegrationKitStatus `json:"status,omitempty"`
}
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +kubebuilder:object:root=true
// IntegrationKitList contains a list of IntegrationKit
type IntegrationKitList struct {
diff --git a/pkg/apis/camel/v1/integrationplatform_types.go b/pkg/apis/camel/v1/integrationplatform_types.go
index 202016f..07a8ac1 100644
--- a/pkg/apis/camel/v1/integrationplatform_types.go
+++ b/pkg/apis/camel/v1/integrationplatform_types.go
@@ -23,6 +23,7 @@ import (
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
+// Important: Run "make generate-deepcopy" to regenerate code after modifying this file
// IntegrationPlatformSpec defines the desired state of IntegrationPlatform
type IntegrationPlatformSpec struct {
@@ -47,9 +48,8 @@ type IntegrationPlatformStatus struct {
Version string `json:"version,omitempty"`
}
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// +k8s:openapi-gen=true
// +genclient
+// +kubebuilder:object:root=true
// +kubebuilder:resource:path=integrationplatforms,scope=Namespaced,shortName=ip,categories=kamel;camel
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`,description="The integration platform phase"
@@ -63,7 +63,7 @@ type IntegrationPlatform struct {
Status IntegrationPlatformStatus `json:"status,omitempty"`
}
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +kubebuilder:object:root=true
// IntegrationPlatformList contains a list of IntegrationPlatform
type IntegrationPlatformList struct {
diff --git a/pkg/apis/camel/v1/register.go b/pkg/apis/camel/v1/register.go
index d74c015..7f02c94 100644
--- a/pkg/apis/camel/v1/register.go
+++ b/pkg/apis/camel/v1/register.go
@@ -18,7 +18,7 @@ limitations under the License.
// NOTE: Boilerplate only. Ignore this file.
// Package v1 contains API Schema definitions for the camel v1 API group
-// +k8s:deepcopy-gen=package,register
+// +kubebuilder:object:generate=true
// +groupName=camel.apache.org
package v1
diff --git a/pkg/apis/camel/v1alpha1/kamelet_types.go b/pkg/apis/camel/v1alpha1/kamelet_types.go
index 81557a1..22be293 100644
--- a/pkg/apis/camel/v1alpha1/kamelet_types.go
+++ b/pkg/apis/camel/v1alpha1/kamelet_types.go
@@ -101,13 +101,13 @@ const (
KameletPhaseReady KameletPhase = "Ready"
)
-// Kamelet is the Schema for the kamelets API
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// +k8s:openapi-gen=true
// +genclient
+// +kubebuilder:object:root=true
// +kubebuilder:resource:path=kamelets,scope=Namespaced,shortName=kl,categories=kamel;camel
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`,description="The Kamelet phase"
+
+// Kamelet is the Schema for the kamelets API
type Kamelet struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -116,7 +116,7 @@ type Kamelet struct {
Status KameletStatus `json:"status,omitempty"`
}
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +kubebuilder:object:root=true
// KameletList contains a list of Kamelet
type KameletList struct {
diff --git a/pkg/apis/camel/v1alpha1/register.go b/pkg/apis/camel/v1alpha1/register.go
index 5ae4530..f472e4d 100644
--- a/pkg/apis/camel/v1alpha1/register.go
+++ b/pkg/apis/camel/v1alpha1/register.go
@@ -15,10 +15,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-// NOTE: Boilerplate only. Ignore this file.
-
// Package v1alpha1 contains Camel unstable API Schema definitions
-// +k8s:deepcopy-gen=package,register
+// +kubebuilder:object:generate=true
// +groupName=camel.apache.org
package v1alpha1