From 3c6aed73ba7b8b1b116b6f28550a8fda9e1e96f7 Mon Sep 17 00:00:00 2001 From: dove0012 Date: Sat, 27 Apr 2024 22:07:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dgolangci-lint=E8=A7=84?= =?UTF-8?q?=E8=8C=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bcs-services/bcs-cluster-manager/internal/app/app.go | 2 +- .../bcs-cluster-manager/internal/cloudprovider/notify.go | 2 +- .../internal/cloudprovider/qcloud/utils.go | 5 ++++- .../bcs-cluster-manager/internal/daemon/cluster_helath.go | 4 ++-- .../internal/remote/cidrmanager/client.go | 2 +- .../internal/remote/resource/tresource/options.go | 2 +- .../internal/store/notifytemplate/notifytemplate.go | 3 ++- bcs-services/bcs-cluster-manager/internal/store/store.go | 6 ++++-- 8 files changed, 16 insertions(+), 10 deletions(-) diff --git a/bcs-services/bcs-cluster-manager/internal/app/app.go b/bcs-services/bcs-cluster-manager/internal/app/app.go index 5e93fe6490..5d2adcf8e8 100644 --- a/bcs-services/bcs-cluster-manager/internal/app/app.go +++ b/bcs-services/bcs-cluster-manager/internal/app/app.go @@ -787,7 +787,7 @@ func (cm *ClusterManager) initHTTPGateway(router *mux.Router) error { if cm.tlsConfig != nil && cm.clientTLSConfig != nil { grpcDialOpts = append(grpcDialOpts, grpc.WithTransportCredentials(grpccred.NewTLS(cm.clientTLSConfig))) } else { - grpcDialOpts = append(grpcDialOpts, grpc.WithInsecure()) + grpcDialOpts = append(grpcDialOpts, grpc.WithInsecure()) // nolint } grpcDialOpts = append(grpcDialOpts, grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(utils.MaxBodySize), grpc.MaxCallSendMsgSize(utils.MaxBodySize))) diff --git a/bcs-services/bcs-cluster-manager/internal/cloudprovider/notify.go b/bcs-services/bcs-cluster-manager/internal/cloudprovider/notify.go index 3303433864..962cddabc8 100644 --- a/bcs-services/bcs-cluster-manager/internal/cloudprovider/notify.go +++ b/bcs-services/bcs-cluster-manager/internal/cloudprovider/notify.go @@ -77,7 +77,7 @@ func SendUserNotifyByTemplates(clsId, groupId, taskId string, isSuccess bool) er return nil } -func sendNotifyMessage(cluster *proto.Cluster, group *proto.NodeGroup, task *proto.Task, +func sendNotifyMessage(cluster *proto.Cluster, group *proto.NodeGroup, task *proto.Task, // nolint nt proto.NotifyTemplate, isSuccess bool) error { if !nt.GetEnable() { return fmt.Errorf("task[%s] notifyTemplate[%s] not enable", task.TaskID, nt.NotifyTemplateID) diff --git a/bcs-services/bcs-cluster-manager/internal/cloudprovider/qcloud/utils.go b/bcs-services/bcs-cluster-manager/internal/cloudprovider/qcloud/utils.go index 2a959bf4fa..c37b471fae 100644 --- a/bcs-services/bcs-cluster-manager/internal/cloudprovider/qcloud/utils.go +++ b/bcs-services/bcs-cluster-manager/internal/cloudprovider/qcloud/utils.go @@ -482,8 +482,11 @@ func (ic *ImportClusterTaskOption) BuildRegisterClusterKubeConfigStep(task *prot // DeleteClusterTaskOption 删除集群 type DeleteClusterTaskOption struct { - Cluster *proto.Cluster + // Cluster cluster + Cluster *proto.Cluster + // DeleteMode delete mode DeleteMode string + // LastClusterStatus last cluster status LastClusterStatus string } diff --git a/bcs-services/bcs-cluster-manager/internal/daemon/cluster_helath.go b/bcs-services/bcs-cluster-manager/internal/daemon/cluster_helath.go index d18bb1ac35..256a594636 100644 --- a/bcs-services/bcs-cluster-manager/internal/daemon/cluster_helath.go +++ b/bcs-services/bcs-cluster-manager/internal/daemon/cluster_helath.go @@ -64,7 +64,7 @@ func (d *Daemon) reportClusterHealthStatus(error chan<- error) { } _, err = kubeCli.Discovery().ServerVersion() if err != nil { - //if options.GetEditionInfo().IsCommunicationEdition() {} + // if options.GetEditionInfo().IsCommunicationEdition() {} _ = d.updateClusterStatus(cls.ClusterID, common.StatusConnectClusterFailed) metrics.ReportCloudClusterHealthStatus(cls.Provider, cls.ClusterID, 0) error <- err @@ -72,7 +72,7 @@ func (d *Daemon) reportClusterHealthStatus(error chan<- error) { } _ = d.updateClusterStatus(cls.ClusterID, common.StatusRunning) - //if options.GetEditionInfo().IsCommunicationEdition() {} + // if options.GetEditionInfo().IsCommunicationEdition() {} metrics.ReportCloudClusterHealthStatus(cls.Provider, cls.ClusterID, 1) }(clusterList[i]) } diff --git a/bcs-services/bcs-cluster-manager/internal/remote/cidrmanager/client.go b/bcs-services/bcs-cluster-manager/internal/remote/cidrmanager/client.go index 21b8caee0e..b92d29faef 100644 --- a/bcs-services/bcs-cluster-manager/internal/remote/cidrmanager/client.go +++ b/bcs-services/bcs-cluster-manager/internal/remote/cidrmanager/client.go @@ -121,7 +121,7 @@ func NewCidrManager(config *Config) (CidrManagerClient, func()) { if config.TLSConfig != nil { opts = append(opts, grpc.WithTransportCredentials(credentials.NewTLS(config.TLSConfig))) } else { - opts = append(opts, grpc.WithInsecure()) + opts = append(opts, grpc.WithInsecure()) // nolint } var conn *grpc.ClientConn var err error diff --git a/bcs-services/bcs-cluster-manager/internal/remote/resource/tresource/options.go b/bcs-services/bcs-cluster-manager/internal/remote/resource/tresource/options.go index 0b41ef7fb6..16e050e503 100644 --- a/bcs-services/bcs-cluster-manager/internal/remote/resource/tresource/options.go +++ b/bcs-services/bcs-cluster-manager/internal/remote/resource/tresource/options.go @@ -74,7 +74,7 @@ func NewResourceManager(config *Config) (ResourceManagerClient, func()) { if config.TLSConfig != nil { opts = append(opts, grpc.WithTransportCredentials(credentials.NewTLS(config.TLSConfig))) } else { - opts = append(opts, grpc.WithInsecure()) + opts = append(opts, grpc.WithInsecure()) // nolint } var conn *grpc.ClientConn var err error diff --git a/bcs-services/bcs-cluster-manager/internal/store/notifytemplate/notifytemplate.go b/bcs-services/bcs-cluster-manager/internal/store/notifytemplate/notifytemplate.go index 9106957d82..4e2e89149f 100644 --- a/bcs-services/bcs-cluster-manager/internal/store/notifytemplate/notifytemplate.go +++ b/bcs-services/bcs-cluster-manager/internal/store/notifytemplate/notifytemplate.go @@ -172,7 +172,8 @@ func (m *ModelNotifyTemplate) GetNotifyTemplateByID(ctx context.Context, templat } // ListNotifyTemplate list notifyTemplates -func (m *ModelNotifyTemplate) ListNotifyTemplate(ctx context.Context, cond *operator.Condition, opt *options.ListOption) ( +func (m *ModelNotifyTemplate) ListNotifyTemplate(ctx context.Context, cond *operator.Condition, + opt *options.ListOption) ( []types.NotifyTemplate, error) { templateList := make([]types.NotifyTemplate, 0) diff --git a/bcs-services/bcs-cluster-manager/internal/store/store.go b/bcs-services/bcs-cluster-manager/internal/store/store.go index 8723c75bc8..758f87ed09 100644 --- a/bcs-services/bcs-cluster-manager/internal/store/store.go +++ b/bcs-services/bcs-cluster-manager/internal/store/store.go @@ -133,7 +133,8 @@ type ClusterManagerModel interface { CreateNodeTemplate(ctx context.Context, template *types.NodeTemplate) error UpdateNodeTemplate(ctx context.Context, template *types.NodeTemplate) error DeleteNodeTemplate(ctx context.Context, projectID string, templateID string) error - ListNodeTemplate(ctx context.Context, cond *operator.Condition, opt *options.ListOption) ([]types.NodeTemplate, error) + ListNodeTemplate(ctx context.Context, cond *operator.Condition, opt *options.ListOption) ( + []types.NodeTemplate, error) GetNodeTemplate(ctx context.Context, projectID, templateID string) (*types.NodeTemplate, error) GetNodeTemplateByID(ctx context.Context, templateID string) (*types.NodeTemplate, error) @@ -141,7 +142,8 @@ type ClusterManagerModel interface { CreateNotifyTemplate(ctx context.Context, template *types.NotifyTemplate) error UpdateNotifyTemplate(ctx context.Context, template *types.NotifyTemplate) error DeleteNotifyTemplate(ctx context.Context, projectID string, templateID string) error - ListNotifyTemplate(ctx context.Context, cond *operator.Condition, opt *options.ListOption) ([]types.NotifyTemplate, error) + ListNotifyTemplate(ctx context.Context, cond *operator.Condition, opt *options.ListOption) ( + []types.NotifyTemplate, error) GetNotifyTemplate(ctx context.Context, projectID, templateID string) (*types.NotifyTemplate, error) GetNotifyTemplateByID(ctx context.Context, templateID string) (*types.NotifyTemplate, error)