@@ -116,7 +116,7 @@ func WaitForContainerInstancesToDrain(opts *Options, clusterName string, contain
116
116
numBatches := int (math .Ceil (float64 (len (containerInstanceArns ) / batchSize )))
117
117
118
118
err = retry .DoWithRetry (
119
- opts .Logger ,
119
+ opts .Logger . Logger ,
120
120
"Wait for Container Instances to be Drained" ,
121
121
maxRetries , sleepBetweenRetries ,
122
122
func () error {
@@ -144,7 +144,7 @@ func WaitForContainerInstancesToDrain(opts *Options, clusterName string, contain
144
144
}
145
145
146
146
// Yay, all done.
147
- if drained , _ := allInstancesFullyDrained (responses ); drained == true {
147
+ if drained , _ := allInstancesFullyDrained (opts , responses ); drained == true {
148
148
if opts .Logger != nil {
149
149
opts .Logger .Debugf ("All container instances have been drained in Cluster %s!" , clusterName )
150
150
}
@@ -177,23 +177,23 @@ func NewECSClient(opts *Options) (*ecs.Client, error) {
177
177
return ecs .NewFromConfig (cfg ), nil
178
178
}
179
179
180
- func allInstancesFullyDrained (responses []* ecs.DescribeContainerInstancesOutput ) (bool , error ) {
180
+ func allInstancesFullyDrained (opts * Options , responses []* ecs.DescribeContainerInstancesOutput ) (bool , error ) {
181
181
for _ , response := range responses {
182
182
instances := response .ContainerInstances
183
183
if len (instances ) == 0 {
184
184
return false , errors .WithStackTrace (fmt .Errorf ("querying DescribeContainerInstances returned no instances" ))
185
185
}
186
186
187
187
for _ , instance := range instances {
188
- if ! instanceFullyDrained (instance ) {
188
+ if ! instanceFullyDrained (opts , instance ) {
189
189
return false , nil
190
190
}
191
191
}
192
192
}
193
193
return true , nil
194
194
}
195
195
196
- func instanceFullyDrained (instance ecs_types.ContainerInstance ) bool {
196
+ func instanceFullyDrained (opts * Options , instance ecs_types.ContainerInstance ) bool {
197
197
instanceArn := instance .ContainerInstanceArn
198
198
199
199
if * instance .Status == "ACTIVE" {
0 commit comments