Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(service): Replace errors from invalid compose service up flags with warnings #1071

Merged
merged 2 commits into from
Jun 30, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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