Skip to content

Commit

Permalink
fix(lint): replace grpc Dial with NewClient
Browse files Browse the repository at this point in the history
Signed-off-by: davidko <[email protected]>
  • Loading branch information
innobead committed Jun 13, 2024
1 parent 73575e3 commit 55a4002
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions pkg/client/manager_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (cli *BackingImageManagerClient) Sync(name, uuid, checksum, fromAddress str
return nil, fmt.Errorf("failed to sync backing image: missing required parameter")
}

conn, err := grpc.Dial(cli.Address, grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.NewClient(cli.Address, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
return nil, fmt.Errorf("cannot connect backing image manager service to %v: %v", cli.Address, err)
}
Expand Down Expand Up @@ -60,7 +60,7 @@ func (cli *BackingImageManagerClient) Send(name, uuid, toAddress string) error {
return fmt.Errorf("failed to send backing image: missing required parameter")
}

conn, err := grpc.Dial(cli.Address, grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.NewClient(cli.Address, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
return fmt.Errorf("cannot connect backing image manager service to %v: %v", cli.Address, err)
}
Expand All @@ -83,7 +83,7 @@ func (cli *BackingImageManagerClient) Delete(name, uuid string) error {
return fmt.Errorf("failed to delete backing image: missing required parameter")
}

conn, err := grpc.Dial(cli.Address, grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.NewClient(cli.Address, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
return fmt.Errorf("cannot connect backing image manager service to %v: %v", cli.Address, err)
}
Expand All @@ -105,7 +105,7 @@ func (cli *BackingImageManagerClient) Get(name, uuid string) (*api.BackingImage,
return nil, fmt.Errorf("failed to get backing image: missing required parameter")
}

conn, err := grpc.Dial(cli.Address, grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.NewClient(cli.Address, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
return nil, fmt.Errorf("cannot connect backing image manager service to %v: %v", cli.Address, err)
}
Expand All @@ -126,7 +126,7 @@ func (cli *BackingImageManagerClient) Get(name, uuid string) (*api.BackingImage,
}

func (cli *BackingImageManagerClient) List() (map[string]*api.BackingImage, error) {
conn, err := grpc.Dial(cli.Address, grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.NewClient(cli.Address, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
return nil, fmt.Errorf("cannot connect backing image manager service to %v: %v", cli.Address, err)
}
Expand All @@ -148,7 +148,7 @@ func (cli *BackingImageManagerClient) Fetch(name, uuid, checksum, dataSourceAddr
return nil, fmt.Errorf("failed to fetch backing image: missing required parameter")
}

conn, err := grpc.Dial(cli.Address, grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.NewClient(cli.Address, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
return nil, fmt.Errorf("cannot connect backing image manager service to %v: %v", cli.Address, err)
}
Expand Down Expand Up @@ -178,7 +178,7 @@ func (cli *BackingImageManagerClient) PrepareDownload(name, uuid string) (string
return "", "", fmt.Errorf("failed to get backing image: missing required parameter")
}

conn, err := grpc.Dial(cli.Address, grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.NewClient(cli.Address, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
return "", "", fmt.Errorf("cannot connect backing image manager service to %v: %v", cli.Address, err)
}
Expand All @@ -199,7 +199,7 @@ func (cli *BackingImageManagerClient) PrepareDownload(name, uuid string) (string
}

func (cli *BackingImageManagerClient) VersionGet() (*meta.VersionOutput, error) {
conn, err := grpc.Dial(cli.Address, grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.NewClient(cli.Address, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
return nil, fmt.Errorf("cannot connect backing image manager service to %v: %v", cli.Address, err)
}
Expand All @@ -224,7 +224,7 @@ func (cli *BackingImageManagerClient) VersionGet() (*meta.VersionOutput, error)
}

func (cli *BackingImageManagerClient) Watch() (*api.BackingImageStream, error) {
conn, err := grpc.Dial(cli.Address, grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.NewClient(cli.Address, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
return nil, fmt.Errorf("cannot connect backing image manager service to %v: %v", cli.Address, err)
}
Expand All @@ -245,7 +245,7 @@ func (cli *BackingImageManagerClient) BackupCreate(name, uuid, checksum, backupT
return fmt.Errorf("failed to create backup backing image: missing required parameter")
}

conn, err := grpc.Dial(cli.Address, grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.NewClient(cli.Address, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
return fmt.Errorf("failed to connect backing image manager service to %v: %v", cli.Address, err)
}
Expand Down Expand Up @@ -278,7 +278,7 @@ func (cli *BackingImageManagerClient) BackupStatus(name string) (*api.BackupStat
return nil, fmt.Errorf("failed to get backup backing image status: missing required parameter")
}

conn, err := grpc.Dial(cli.Address, grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.NewClient(cli.Address, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
return nil, fmt.Errorf("failed to connect backing image manager service to %v: %v", cli.Address, err)
}
Expand Down

0 comments on commit 55a4002

Please sign in to comment.