@@ -99,7 +99,6 @@ func (c *client) CreateService(ctx context.Context, service types.Service) (*typ
99
99
PropagateTags : types .PropagateTagsService ,
100
100
Role : service .RoleArn ,
101
101
SchedulingStrategy : service .SchedulingStrategy ,
102
- ServiceRegistries : service .ServiceRegistries ,
103
102
Tags : service .Tags ,
104
103
}
105
104
output , err := c .ecsClient .CreateService (ctx , input )
@@ -110,8 +109,10 @@ func (c *client) CreateService(ctx context.Context, service types.Service) (*typ
110
109
// Hack: Since we use EXTERNAL deployment controller, the below configurations are not allowed to be passed
111
110
// in CreateService step, but it required in further step (CreateTaskSet step). We reassign those values
112
111
// as part of service definition for that purpose.
112
+ // ref: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html
113
113
output .Service .LaunchType = service .LaunchType
114
114
output .Service .NetworkConfiguration = service .NetworkConfiguration
115
+ output .Service .ServiceRegistries = service .ServiceRegistries
115
116
116
117
return output .Service , nil
117
118
}
@@ -134,8 +135,10 @@ func (c *client) UpdateService(ctx context.Context, service types.Service) (*typ
134
135
// Hack: Since we use EXTERNAL deployment controller, the below configurations are not allowed to be passed
135
136
// in UpdateService step, but it required in further step (CreateTaskSet step). We reassign those values
136
137
// as part of service definition for that purpose.
138
+ // ref: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html
137
139
output .Service .LaunchType = service .LaunchType
138
140
output .Service .NetworkConfiguration = service .NetworkConfiguration
141
+ output .Service .ServiceRegistries = service .ServiceRegistries
139
142
140
143
return output .Service , nil
141
144
}
@@ -204,6 +207,7 @@ func (c *client) CreateTaskSet(ctx context.Context, service types.Service, taskD
204
207
// and you must specify a NetworkConfiguration when run a task with the task definition.
205
208
NetworkConfiguration : service .NetworkConfiguration ,
206
209
LaunchType : service .LaunchType ,
210
+ ServiceRegistries : service .ServiceRegistries ,
207
211
}
208
212
if targetGroup != nil {
209
213
input .LoadBalancers = []types.LoadBalancer {* targetGroup }
@@ -248,7 +252,11 @@ func (c *client) WaitServiceStable(ctx context.Context, service types.Service) e
248
252
Cluster : service .ClusterArn ,
249
253
Services : []string {* service .ServiceArn },
250
254
}
251
-
255
+ // Wait before first checking the service state due to the logic checking service
256
+ // stable currently is based on `pendingCount`, which could always be `0` when
257
+ // the service deployment has started running.
258
+ // TODO: Wait until a new task is started instead of sleeping.
259
+ time .Sleep (30 * time .Second )
252
260
retry := backoff .NewRetry (retryServiceStable , backoff .NewConstant (retryServiceStableInterval ))
253
261
_ , err := retry .Do (ctx , func () (interface {}, error ) {
254
262
output , err := c .ecsClient .DescribeServices (ctx , input )
0 commit comments