Skip to content

Commit

Permalink
test: fix 'make lint' errors
Browse files Browse the repository at this point in the history
Signed-off-by: zyy17 <[email protected]>
  • Loading branch information
zyy17 committed Aug 21, 2023
1 parent 3950798 commit 9e4d922
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion pkg/cmd/gtctl/cluster/connect/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
"context"
"fmt"

greptimedbclusterv1alpha1 "github.com/GreptimeTeam/greptimedb-operator/apis/v1alpha1"
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/types"

greptimedbclusterv1alpha1 "github.com/GreptimeTeam/greptimedb-operator/apis/v1alpha1"
"github.com/GreptimeTeam/gtctl/pkg/cmd/gtctl/cluster/connect/mysql"
"github.com/GreptimeTeam/gtctl/pkg/cmd/gtctl/cluster/connect/pg"
"github.com/GreptimeTeam/gtctl/pkg/deployer/k8s"
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/gtctl/cluster/connect/mysql/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import (
"sync"
"syscall"

greptimedbclusterv1alpha1 "github.com/GreptimeTeam/greptimedb-operator/apis/v1alpha1"
"github.com/go-sql-driver/mysql"

greptimedbclusterv1alpha1 "github.com/GreptimeTeam/greptimedb-operator/apis/v1alpha1"
"github.com/GreptimeTeam/gtctl/pkg/logger"
)

Expand Down Expand Up @@ -58,7 +58,7 @@ func connect(port, clusterName string, l logger.Logger) error {
go func() {
defer waitGroup.Done()
if err = cmd.Wait(); err != nil {
//exit status 1
// exit status 1
exitError, ok := err.(*exec.ExitError)
if !ok {
l.Errorf("Error waiting for port-forwarding to finish: %v", err)
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/gtctl/cluster/connect/pg/pg.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (
"sync"
"syscall"

greptimedbclusterv1alpha1 "github.com/GreptimeTeam/greptimedb-operator/apis/v1alpha1"
"github.com/go-pg/pg/v10"

greptimedbclusterv1alpha1 "github.com/GreptimeTeam/greptimedb-operator/apis/v1alpha1"
"github.com/GreptimeTeam/gtctl/pkg/logger"
)

Expand Down Expand Up @@ -65,7 +65,7 @@ func connect(port, clusterName string, l logger.Logger) error {
go func() {
defer waitGroup.Done()
if err = cmd.Wait(); err != nil {
//exit status 1
// exit status 1
exitError, ok := err.(*exec.ExitError)
if !ok {
l.Errorf("Error waiting for port-forwarding to finish: %v", err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/gtctl/cluster/delete/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ import (
"fmt"
"strings"

greptimedbclusterv1alpha1 "github.com/GreptimeTeam/greptimedb-operator/apis/v1alpha1"
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/types"

greptimedbclusterv1alpha1 "github.com/GreptimeTeam/greptimedb-operator/apis/v1alpha1"
"github.com/GreptimeTeam/gtctl/pkg/cmd/gtctl/cluster/common"
"github.com/GreptimeTeam/gtctl/pkg/deployer/k8s"
"github.com/GreptimeTeam/gtctl/pkg/logger"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/gtctl/cluster/get/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
"context"
"fmt"

greptimedbclusterv1alpha1 "github.com/GreptimeTeam/greptimedb-operator/apis/v1alpha1"
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/types"

greptimedbclusterv1alpha1 "github.com/GreptimeTeam/greptimedb-operator/apis/v1alpha1"
"github.com/GreptimeTeam/gtctl/pkg/deployer/k8s"
"github.com/GreptimeTeam/gtctl/pkg/logger"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/gtctl/cluster/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import (
"context"
"fmt"

greptimedbclusterv1alpha1 "github.com/GreptimeTeam/greptimedb-operator/apis/v1alpha1"
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/api/errors"

greptimedbclusterv1alpha1 "github.com/GreptimeTeam/greptimedb-operator/apis/v1alpha1"
"github.com/GreptimeTeam/gtctl/pkg/deployer/k8s"
"github.com/GreptimeTeam/gtctl/pkg/logger"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/gtctl/cluster/scale/scale.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
"context"
"fmt"

greptimedbclusterv1alpha1 "github.com/GreptimeTeam/greptimedb-operator/apis/v1alpha1"
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/types"

greptimedbclusterv1alpha1 "github.com/GreptimeTeam/greptimedb-operator/apis/v1alpha1"
"github.com/GreptimeTeam/gtctl/pkg/deployer"
"github.com/GreptimeTeam/gtctl/pkg/deployer/k8s"
"github.com/GreptimeTeam/gtctl/pkg/logger"
Expand Down
16 changes: 8 additions & 8 deletions pkg/cmd/gtctl/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

package constants

// GtctlTextBanner is the following text banner for gtctl.
// __ __ __
// ____ _/ /______/ /_/ /
// / __ `/ __/ ___/ __/ /
// / /_/ / /_/ /__/ /_/ /
// \__, /\__/\___/\__/_/
// /____/
const GtctlTextBanner = " __ __ __\n ____ _/ /______/ /_/ /\n / __ `/ __/ ___/ __/ / \n / /_/ / /_/ /__/ /_/ / \n \\__, /\\__/\\___/\\__/_/ \n/____/ \n"
// GtctlTextBanner represents the ASCII art banner for the gtctl command-line tool.
const GtctlTextBanner = `
__ __ __
____ _/ /______/ /_/ /
/ __ '/ __/ ___/ __/ /
/ /_/ / /_/ /__/ /_/ /
\__, /\__/\___/\__/_/
/____/`
3 changes: 2 additions & 1 deletion pkg/deployer/baremetal/artifacts.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ import (
"runtime"
"strings"

"github.com/google/go-github/v53/github"

"github.com/GreptimeTeam/gtctl/pkg/deployer/baremetal/config"
"github.com/GreptimeTeam/gtctl/pkg/logger"
fileutils "github.com/GreptimeTeam/gtctl/pkg/utils/file"
semverutils "github.com/GreptimeTeam/gtctl/pkg/utils/semver"
"github.com/google/go-github/v53/github"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/deployer/baremetal/component/datanode.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ CHECKER:
func (d *datanode) BuildArgs(ctx context.Context, params ...interface{}) []string {
logLevel := d.config.LogLevel
if logLevel == "" {
logLevel = "info"
logLevel = config.DefaultLogLevel
}

nodeID_, walDir, dataHomeDir := params[0], params[1], params[2]
Expand Down
2 changes: 1 addition & 1 deletion pkg/deployer/baremetal/component/frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (f *frontend) Start(ctx context.Context, binary string) error {
func (f *frontend) BuildArgs(ctx context.Context, params ...interface{}) []string {
logLevel := f.config.LogLevel
if logLevel == "" {
logLevel = "info"
logLevel = config.DefaultLogLevel
}
args := []string{
fmt.Sprintf("--log-level=%s", logLevel),
Expand Down
2 changes: 1 addition & 1 deletion pkg/deployer/baremetal/component/metasrv.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ CHECKER:
func (m *metaSrv) BuildArgs(ctx context.Context, params ...interface{}) []string {
logLevel := m.config.LogLevel
if logLevel == "" {
logLevel = "info"
logLevel = config.DefaultLogLevel
}
args := []string{
fmt.Sprintf("--log-level=%s", logLevel),
Expand Down
2 changes: 2 additions & 0 deletions pkg/deployer/baremetal/config/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const (

DefaultEtcdVersion = "v3.5.7"
DefaultGreptimeVersion = "latest"

DefaultLogLevel = "info"
)

// Config is the desired state of a GreptimeDB cluster on bare metal.
Expand Down
1 change: 1 addition & 0 deletions pkg/deployer/k8s/deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"time"

greptimedbclusterv1alpha1 "github.com/GreptimeTeam/greptimedb-operator/apis/v1alpha1"

. "github.com/GreptimeTeam/gtctl/pkg/deployer"
"github.com/GreptimeTeam/gtctl/pkg/helm"
"github.com/GreptimeTeam/gtctl/pkg/kube"
Expand Down

0 comments on commit 9e4d922

Please sign in to comment.