From d7fde4cfa5121934ef83de6365bfd1728235504a Mon Sep 17 00:00:00 2001 From: leon-inf Date: Mon, 23 Oct 2023 07:05:10 +0000 Subject: [PATCH 1/2] chore: auto update cli doc changes --- apis/apps/v1alpha1/zz_generated.deepcopy.go | 5 ++--- apis/dataprotection/v1alpha1/zz_generated.deepcopy.go | 2 +- apis/extensions/v1alpha1/zz_generated.deepcopy.go | 2 +- apis/storage/v1alpha1/zz_generated.deepcopy.go | 2 +- apis/workloads/v1alpha1/zz_generated.deepcopy.go | 2 +- externalapis/preflight/v1beta2/zz_generated.deepcopy.go | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/apis/apps/v1alpha1/zz_generated.deepcopy.go b/apis/apps/v1alpha1/zz_generated.deepcopy.go index baef66a2c64..862c1393196 100644 --- a/apis/apps/v1alpha1/zz_generated.deepcopy.go +++ b/apis/apps/v1alpha1/zz_generated.deepcopy.go @@ -25,15 +25,14 @@ along with this program. If not, see . package v1alpha1 import ( + workloadsv1alpha1 "github.com/apecloud/kubeblocks/apis/workloads/v1alpha1" appsv1 "k8s.io/api/apps/v1" - v1 "k8s.io/api/core/v1" + "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/intstr" - - workloadsv1alpha1 "github.com/apecloud/kubeblocks/apis/workloads/v1alpha1" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/apis/dataprotection/v1alpha1/zz_generated.deepcopy.go b/apis/dataprotection/v1alpha1/zz_generated.deepcopy.go index 5f955a82a32..06449f5aa3a 100644 --- a/apis/dataprotection/v1alpha1/zz_generated.deepcopy.go +++ b/apis/dataprotection/v1alpha1/zz_generated.deepcopy.go @@ -25,7 +25,7 @@ along with this program. If not, see . package v1alpha1 import ( - v1 "k8s.io/api/core/v1" + "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) diff --git a/apis/extensions/v1alpha1/zz_generated.deepcopy.go b/apis/extensions/v1alpha1/zz_generated.deepcopy.go index eeec9922d51..dc6dc6af55e 100644 --- a/apis/extensions/v1alpha1/zz_generated.deepcopy.go +++ b/apis/extensions/v1alpha1/zz_generated.deepcopy.go @@ -26,7 +26,7 @@ package v1alpha1 import ( corev1 "k8s.io/api/core/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) diff --git a/apis/storage/v1alpha1/zz_generated.deepcopy.go b/apis/storage/v1alpha1/zz_generated.deepcopy.go index 0ab972c839a..f22b9440108 100644 --- a/apis/storage/v1alpha1/zz_generated.deepcopy.go +++ b/apis/storage/v1alpha1/zz_generated.deepcopy.go @@ -25,7 +25,7 @@ along with this program. If not, see . package v1alpha1 import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) diff --git a/apis/workloads/v1alpha1/zz_generated.deepcopy.go b/apis/workloads/v1alpha1/zz_generated.deepcopy.go index 34e7c5f1212..f2a4dfdf03d 100644 --- a/apis/workloads/v1alpha1/zz_generated.deepcopy.go +++ b/apis/workloads/v1alpha1/zz_generated.deepcopy.go @@ -26,7 +26,7 @@ package v1alpha1 import ( corev1 "k8s.io/api/core/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" ) diff --git a/externalapis/preflight/v1beta2/zz_generated.deepcopy.go b/externalapis/preflight/v1beta2/zz_generated.deepcopy.go index 395b99094bf..e1cbcb93528 100644 --- a/externalapis/preflight/v1beta2/zz_generated.deepcopy.go +++ b/externalapis/preflight/v1beta2/zz_generated.deepcopy.go @@ -26,7 +26,7 @@ package v1beta2 import ( troubleshootv1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2" - v1 "k8s.io/api/core/v1" + "k8s.io/api/core/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) From 662f2d8d66a292507e31f59eac23346df3dc78ee Mon Sep 17 00:00:00 2001 From: Y-Rookie Date: Mon, 23 Oct 2023 15:11:30 +0800 Subject: [PATCH 2/2] fix convertor typeofObject --- pkg/controller/component/convertor.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/controller/component/convertor.go b/pkg/controller/component/convertor.go index c42a9de7e45..5e9cdcfffd0 100644 --- a/pkg/controller/component/convertor.go +++ b/pkg/controller/component/convertor.go @@ -124,12 +124,12 @@ func covertObject(convertors map[string]convertor, obj any, args ...any) error { func typeofObject(obj any) reflect.Type { val := reflect.ValueOf(obj) if val.Kind() == reflect.Ptr { - val = val.Elem() + return reflect.TypeOf(obj).Elem() } if val.Kind() != reflect.Struct { panic("not a struct") } - return reflect.TypeOf(val) + return reflect.TypeOf(obj) } type convertor interface {