diff --git a/pkg/app/piped/platformprovider/ecs/client.go b/pkg/app/piped/platformprovider/ecs/client.go index 9e9a009414..6008c5832b 100644 --- a/pkg/app/piped/platformprovider/ecs/client.go +++ b/pkg/app/piped/platformprovider/ecs/client.go @@ -99,7 +99,6 @@ func (c *client) CreateService(ctx context.Context, service types.Service) (*typ PropagateTags: types.PropagateTagsService, Role: service.RoleArn, SchedulingStrategy: service.SchedulingStrategy, - ServiceRegistries: service.ServiceRegistries, Tags: service.Tags, } output, err := c.ecsClient.CreateService(ctx, input) @@ -110,8 +109,10 @@ func (c *client) CreateService(ctx context.Context, service types.Service) (*typ // Hack: Since we use EXTERNAL deployment controller, the below configurations are not allowed to be passed // in CreateService step, but it required in further step (CreateTaskSet step). We reassign those values // as part of service definition for that purpose. + // ref: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html output.Service.LaunchType = service.LaunchType output.Service.NetworkConfiguration = service.NetworkConfiguration + output.Service.ServiceRegistries = service.ServiceRegistries return output.Service, nil } @@ -134,8 +135,10 @@ func (c *client) UpdateService(ctx context.Context, service types.Service) (*typ // Hack: Since we use EXTERNAL deployment controller, the below configurations are not allowed to be passed // in UpdateService step, but it required in further step (CreateTaskSet step). We reassign those values // as part of service definition for that purpose. + // ref: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html output.Service.LaunchType = service.LaunchType output.Service.NetworkConfiguration = service.NetworkConfiguration + output.Service.ServiceRegistries = service.ServiceRegistries return output.Service, nil } @@ -204,6 +207,7 @@ func (c *client) CreateTaskSet(ctx context.Context, service types.Service, taskD // and you must specify a NetworkConfiguration when run a task with the task definition. NetworkConfiguration: service.NetworkConfiguration, LaunchType: service.LaunchType, + ServiceRegistries: service.ServiceRegistries, } if targetGroup != nil { input.LoadBalancers = []types.LoadBalancer{*targetGroup} @@ -248,7 +252,11 @@ func (c *client) WaitServiceStable(ctx context.Context, service types.Service) e Cluster: service.ClusterArn, Services: []string{*service.ServiceArn}, } - + // Wait before first checking the service state due to the logic checking service + // stable currently is based on `pendingCount`, which could always be `0` when + // the service deployment has started running. + // TODO: Wait until a new task is started instead of sleeping. + time.Sleep(30 * time.Second) retry := backoff.NewRetry(retryServiceStable, backoff.NewConstant(retryServiceStableInterval)) _, err := retry.Do(ctx, func() (interface{}, error) { output, err := c.ecsClient.DescribeServices(ctx, input)