Skip to content

Commit

Permalink
Replace error from --enable-service-discovery flag with warning (#1071)
Browse files Browse the repository at this point in the history
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
bvtujo and mergify[bot] committed Jun 30, 2020
1 parent c91e48e commit e39b08b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ecs-cli/modules/cli/compose/entity/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ func (s *Service) buildUpdateServiceInput(count *int64, serviceName, taskDefinit

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

schedulingStrategy := strings.ToUpper(s.Context().CLIContext.String(flags.SchedulingStrategyFlag))
Expand Down
4 changes: 3 additions & 1 deletion ecs-cli/modules/cli/compose/entity/service/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1609,8 +1609,10 @@ func TestUpdateExistingServiceWithServiceDiscoveryFlag(t *testing.T) {
ServiceName: aws.String(serviceName),
}

expectedInput := getDefaultUpdateInput()
expectedInput.serviceName = serviceName
// call tests
updateServiceExceptionTest(t, flagSet, &config.CommandConfig{}, &utils.ECSParams{}, existingService)
updateServiceTest(t, flagSet, &config.CommandConfig{}, &utils.ECSParams{}, expectedInput, existingService, true)
}

///////////////////////////////////////
Expand Down

0 comments on commit e39b08b

Please sign in to comment.