From 9f5025671d2adf7c4ac62e792d7ba5afd8f46b8b Mon Sep 17 00:00:00 2001 From: Cuong Vu <77630688+cuongvd23@users.noreply.github.com> Date: Sat, 30 Nov 2024 21:49:35 +0700 Subject: [PATCH] feat: skip load serviceDef on ECS standalone task (#5373) Signed-off-by: Cuong Vu Signed-off-by: ponkio-o <29038315+ponkio-o@users.noreply.github.com> --- pkg/app/piped/planpreview/ecsdiff.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkg/app/piped/planpreview/ecsdiff.go b/pkg/app/piped/planpreview/ecsdiff.go index 5dd0f56637..232c07ff53 100644 --- a/pkg/app/piped/planpreview/ecsdiff.go +++ b/pkg/app/piped/planpreview/ecsdiff.go @@ -20,6 +20,7 @@ import ( "fmt" "io" + "github.com/aws/aws-sdk-go-v2/service/ecs/types" "github.com/pipe-cd/pipecd/pkg/app/piped/deploysource" provider "github.com/pipe-cd/pipecd/pkg/app/piped/platformprovider/ecs" "github.com/pipe-cd/pipecd/pkg/diff" @@ -118,9 +119,13 @@ func (b *builder) loadECSManifests(ctx context.Context, app model.Application, d if err != nil { return provider.ECSManifests{}, err } - serviceDef, err := provider.LoadServiceDefinition(ds.AppDir, appCfg.Input.ServiceDefinitionFile) - if err != nil { - return provider.ECSManifests{}, err + + serviceDef := types.Service{} + if !appCfg.Input.IsStandaloneTask() { + serviceDef, err = provider.LoadServiceDefinition(ds.AppDir, appCfg.Input.ServiceDefinitionFile) + if err != nil { + return provider.ECSManifests{}, err + } } manifests = provider.ECSManifests{