Skip to content

Commit 25601c8

Browse files
authored
[ECS-Plugin] Fix lint (#6588)
* fix: return filter tasksets Signed-off-by: Hoang Ngo <adlehoang118@gmail.com> * chore: fix lint issues Signed-off-by: Hoang Ngo <adlehoang118@gmail.com> --------- Signed-off-by: Hoang Ngo <adlehoang118@gmail.com>
1 parent 4e132a1 commit 25601c8

File tree

8 files changed

+16
-8
lines changed

8 files changed

+16
-8
lines changed

pkg/app/pipedv1/plugin/ecs/deployment/plugin.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ import (
1818
"context"
1919
"errors"
2020

21-
ecsconfig "github.com/pipe-cd/pipecd/pkg/app/pipedv1/plugin/ecs/config"
2221
sdk "github.com/pipe-cd/piped-plugin-sdk-go"
22+
23+
ecsconfig "github.com/pipe-cd/pipecd/pkg/app/pipedv1/plugin/ecs/config"
2324
)
2425

2526
var _ sdk.DeploymentPlugin[ecsconfig.ECSPluginConfig, ecsconfig.ECSDeployTargetConfig, ecsconfig.ECSApplicationSpec] = (*ECSPlugin)(nil)

pkg/app/pipedv1/plugin/ecs/deployment/sync.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ import (
1919
"fmt"
2020

2121
"github.com/aws/aws-sdk-go-v2/service/ecs/types"
22+
sdk "github.com/pipe-cd/piped-plugin-sdk-go"
23+
2224
ecsconfig "github.com/pipe-cd/pipecd/pkg/app/pipedv1/plugin/ecs/config"
2325
"github.com/pipe-cd/pipecd/pkg/app/pipedv1/plugin/ecs/provider"
24-
sdk "github.com/pipe-cd/piped-plugin-sdk-go"
2526
)
2627

2728
func (p *ECSPlugin) executeECSSyncStage(

pkg/app/pipedv1/plugin/ecs/deployment/test_helper.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"time"
2020

2121
"github.com/aws/aws-sdk-go-v2/service/ecs/types"
22+
2223
"github.com/pipe-cd/pipecd/pkg/app/pipedv1/plugin/ecs/provider"
2324

2425
appconfig "github.com/pipe-cd/pipecd/pkg/app/pipedv1/plugin/ecs/config"

pkg/app/pipedv1/plugin/ecs/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ package main
1717
import (
1818
"log"
1919

20-
"github.com/pipe-cd/pipecd/pkg/app/pipedv1/plugin/ecs/deployment"
2120
sdk "github.com/pipe-cd/piped-plugin-sdk-go"
21+
22+
"github.com/pipe-cd/pipecd/pkg/app/pipedv1/plugin/ecs/deployment"
2223
)
2324

2425
func main() {

pkg/app/pipedv1/plugin/ecs/provider/client.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"github.com/aws/aws-sdk-go-v2/credentials/stscreds"
2525
"github.com/aws/aws-sdk-go-v2/service/ecs"
2626
"github.com/aws/aws-sdk-go-v2/service/ecs/types"
27+
2728
"github.com/pipe-cd/pipecd/pkg/app/piped/platformprovider"
2829
"github.com/pipe-cd/pipecd/pkg/backoff"
2930

@@ -188,15 +189,15 @@ func (c *client) GetServiceTaskSets(ctx context.Context, service types.Service)
188189
if err != nil {
189190
return nil, fmt.Errorf("failed to get task sets of service %s: %w", *service.ServiceName, err)
190191
}
191-
taskSets := make([]*types.TaskSet, 0, len(tsOutput.TaskSets))
192+
taskSets := make([]types.TaskSet, 0, len(tsOutput.TaskSets))
192193
for i := range tsOutput.TaskSets {
193194
if !IsPipeCDManagedTaskSet(&tsOutput.TaskSets[i]) {
194195
continue
195196
}
196-
taskSets = append(taskSets, &tsOutput.TaskSets[i])
197+
taskSets = append(taskSets, tsOutput.TaskSets[i])
197198
}
198199

199-
return svc.TaskSets, nil
200+
return taskSets, nil
200201
}
201202

202203
func (c *client) CreateTaskSet(ctx context.Context, service types.Service, taskDefinition types.TaskDefinition, targetGroup *types.LoadBalancer, scale float64) (*types.TaskSet, error) {

pkg/app/pipedv1/plugin/ecs/provider/ecs.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ import (
2121

2222
"github.com/aws/aws-sdk-go-v2/aws"
2323
"github.com/aws/aws-sdk-go-v2/service/ecs/types"
24-
"github.com/pipe-cd/pipecd/pkg/app/pipedv1/plugin/ecs/config"
2524
sdk "github.com/pipe-cd/piped-plugin-sdk-go"
2625
"golang.org/x/sync/singleflight"
26+
27+
"github.com/pipe-cd/pipecd/pkg/app/pipedv1/plugin/ecs/config"
2728
)
2829

2930
const (

pkg/app/pipedv1/plugin/ecs/provider/target_group.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919

2020
"github.com/aws/aws-sdk-go-v2/aws"
2121
"github.com/aws/aws-sdk-go-v2/service/ecs/types"
22+
2223
"github.com/pipe-cd/pipecd/pkg/app/pipedv1/plugin/ecs/config"
2324
)
2425

pkg/app/pipedv1/plugin/ecs/provider/target_group_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ import (
1919

2020
"github.com/aws/aws-sdk-go-v2/aws"
2121
"github.com/aws/aws-sdk-go-v2/service/ecs/types"
22-
"github.com/pipe-cd/pipecd/pkg/app/pipedv1/plugin/ecs/config"
2322
"github.com/stretchr/testify/assert"
23+
24+
"github.com/pipe-cd/pipecd/pkg/app/pipedv1/plugin/ecs/config"
2425
)
2526

2627
func TestLoadTargetGroups(t *testing.T) {

0 commit comments

Comments
 (0)