Skip to content
This repository was archived by the owner on Nov 19, 2025. It is now read-only.

Commit 0a8b381

Browse files
committed
Replace error from --enable-service-discovery flag with warning
1 parent bf1426b commit 0a8b381

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

ecs-cli/modules/cli/compose/entity/service/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ func (s *Service) buildUpdateServiceInput(count *int64, serviceName, taskDefinit
347347

348348
func (s *Service) updateService(ecsService *ecs.Service, newTaskDefinition *ecs.TaskDefinition) error {
349349
if s.Context().CLIContext.Bool(flags.EnableServiceDiscoveryFlag) {
350-
return fmt.Errorf("Service Discovery can not be enabled on an existing ECS Service")
350+
log.Warningln("Service Discovery can not be enabled on an existing ECS Service. Skipping this flag...")
351351
}
352352

353353
schedulingStrategy := strings.ToUpper(s.Context().CLIContext.String(flags.SchedulingStrategyFlag))

ecs-cli/modules/cli/compose/entity/service/service_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1609,8 +1609,10 @@ func TestUpdateExistingServiceWithServiceDiscoveryFlag(t *testing.T) {
16091609
ServiceName: aws.String(serviceName),
16101610
}
16111611

1612+
expectedInput := getDefaultUpdateInput()
1613+
expectedInput.serviceName = serviceName
16121614
// call tests
1613-
updateServiceExceptionTest(t, flagSet, &config.CommandConfig{}, &utils.ECSParams{}, existingService)
1615+
updateServiceTest(t, flagSet, &config.CommandConfig{}, &utils.ECSParams{}, expectedInput, existingService, true)
16141616
}
16151617

16161618
///////////////////////////////////////

0 commit comments

Comments
 (0)