Skip to content

Commit

Permalink
chore: fix linter suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorres committed Nov 19, 2024
1 parent 5b72a99 commit fe80003
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
13 changes: 7 additions & 6 deletions cmd/maintenance/create/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"google.golang.org/protobuf/types/known/durationpb"

"github.com/ydb-platform/ydb-go-genproto/draft/protos/Ydb_Maintenance"

"github.com/ydb-platform/ydbops/cmd/restart"
"github.com/ydb-platform/ydbops/pkg/client/cms"
"github.com/ydb-platform/ydbops/pkg/cmdutil"
Expand Down Expand Up @@ -49,12 +50,12 @@ func (o *Options) nodeIdsToNodes(
) []*Ydb_Maintenance.Node {
targetedNodes := []*Ydb_Maintenance.Node{}

// TODO @jorres arguments to PrepareRestarters are a dirty hack.
// We actually only need Filter component from restarters. 2 and 3 arguments
// are required in PrepareRestarters to actually perform node restarts,
// but we only use restarters in the scope of this function to filter nodes
// so their value does not matter. Splitting something like 'Filterers' from
// Restarters into separate interface should solve this.
// TODO @jorres arguments to PrepareRestarters are a dirty hack.
// We actually only need Filter component from restarters. 2 and 3 arguments
// are required in PrepareRestarters to actually perform node restarts,
// but we only use restarters in the scope of this function to filter nodes
// so their value does not matter. Splitting something like 'Filterers' from
// Restarters into separate interface should solve this.
storageRestarter, tenantRestarter := restart.PrepareRestarters(
&o.FilteringOptions,
[]string{},
Expand Down
14 changes: 7 additions & 7 deletions cmd/restart/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ func PrepareRestarters(
sshArgs []string,
customSystemdUnitName string,
restartDuration int,
) (restarters.Restarter, restarters.Restarter) {
) (storage, tenant restarters.Restarter) {
if opts.KubeconfigPath != "" {
storageRestarter := restarters.NewStorageK8sRestarter(
storage = restarters.NewStorageK8sRestarter(
options.Logger,
&restarters.StorageK8sRestarterOptions{
K8sRestarterOptions: &restarters.K8sRestarterOptions{
Expand All @@ -37,7 +37,7 @@ func PrepareRestarters(
},
},
)
tenantRestarter := restarters.NewTenantK8sRestarter(
tenant = restarters.NewTenantK8sRestarter(
options.Logger,
&restarters.TenantK8sRestarterOptions{
K8sRestarterOptions: &restarters.K8sRestarterOptions{
Expand All @@ -47,20 +47,20 @@ func PrepareRestarters(
},
},
)
return storageRestarter, tenantRestarter
return storage, tenant
}

storageRestarter := restarters.NewStorageSSHRestarter(
storage = restarters.NewStorageSSHRestarter(
options.Logger,
sshArgs,
customSystemdUnitName,
)
tenantRestarter := restarters.NewTenantSSHRestarter(
tenant = restarters.NewTenantSSHRestarter(
options.Logger,
sshArgs,
customSystemdUnitName,
)
return storageRestarter, tenantRestarter
return storage, tenant
}

func (o *Options) Run(f cmdutil.Factory) error {
Expand Down
3 changes: 2 additions & 1 deletion pkg/options/filtering.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ import (

"github.com/spf13/pflag"
"github.com/ydb-platform/ydb-go-genproto/draft/protos/Ydb_Maintenance"

"github.com/ydb-platform/ydbops/internal/collections"
"github.com/ydb-platform/ydbops/pkg/profile"
"github.com/ydb-platform/ydbops/pkg/utils"
)

const (
DefaultMaxStaticNodeId = 50000
DefaultMaxStaticNodeId = 50000
)

var (
Expand Down
4 changes: 1 addition & 3 deletions pkg/rolling/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ type RestartOptions struct {
CustomSystemdUnitName string
}

var (
rawSSHUnparsedArgs string
)
var rawSSHUnparsedArgs string

func (o *RestartOptions) Validate() error {
err := o.FilteringOptions.Validate()
Expand Down

0 comments on commit fe80003

Please sign in to comment.