Skip to content

Commit

Permalink
修复golangci-lint规范问题
Browse files Browse the repository at this point in the history
  • Loading branch information
dove0012 committed Apr 27, 2024
1 parent d804e24 commit 3c6aed7
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion bcs-services/bcs-cluster-manager/internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ 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
return
}

_ = d.updateClusterStatus(cls.ClusterID, common.StatusRunning)
//if options.GetEditionInfo().IsCommunicationEdition() {}
// if options.GetEditionInfo().IsCommunicationEdition() {}
metrics.ReportCloudClusterHealthStatus(cls.Provider, cls.ClusterID, 1)
}(clusterList[i])
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 4 additions & 2 deletions bcs-services/bcs-cluster-manager/internal/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,17 @@ 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)

// notifyTemplate info storage management
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)

Expand Down

0 comments on commit 3c6aed7

Please sign in to comment.