Skip to content

Commit

Permalink
remove unused container client from createTask
Browse files Browse the repository at this point in the history
Signed-off-by: mohammadVatandoost <mohamadvatandoost512@gmail.com>
Signed-off-by: Mohammad Vatandoost <mohamadvatandoost512@gmail.com>
  • Loading branch information
mohammadVatandoost authored and alexellis committed Apr 20, 2022
1 parent 4061b52 commit a574a0c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/provider/handlers/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func deploy(ctx context.Context, req types.FunctionDeployment, client *container
return fmt.Errorf("unable to create container: %s, error: %w", name, err)
}

return createTask(ctx, client, container, cni)
return createTask(ctx, container, cni)

}

Expand Down Expand Up @@ -203,7 +203,7 @@ func buildLabels(request *types.FunctionDeployment) (map[string]string, error) {
return labels, nil
}

func createTask(ctx context.Context, client *containerd.Client, container containerd.Container, cni gocni.CNI) error {
func createTask(ctx context.Context, container containerd.Container, cni gocni.CNI) error {

name := container.ID()

Expand Down
2 changes: 1 addition & 1 deletion pkg/provider/handlers/scale.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func MakeReplicaUpdateHandler(client *containerd.Client, cni gocni.CNI) func(w h
}

if createNewTask {
deployErr := createTask(ctx, client, ctr, cni)
deployErr := createTask(ctx, ctr, cni)
if deployErr != nil {
log.Printf("[Scale] error deploying %s, error: %s\n", name, deployErr)
http.Error(w, deployErr.Error(), http.StatusBadRequest)
Expand Down

0 comments on commit a574a0c

Please sign in to comment.