Skip to content

Commit a7bc593

Browse files
committed
Fixed build regarding opts and logger.
1 parent 2452161 commit a7bc593

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

awscommons/v2/ecs.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func WaitForContainerInstancesToDrain(opts *Options, clusterName string, contain
116116
numBatches := int(math.Ceil(float64(len(containerInstanceArns) / batchSize)))
117117

118118
err = retry.DoWithRetry(
119-
opts.Logger,
119+
opts.Logger.Logger,
120120
"Wait for Container Instances to be Drained",
121121
maxRetries, sleepBetweenRetries,
122122
func() error {
@@ -144,7 +144,7 @@ func WaitForContainerInstancesToDrain(opts *Options, clusterName string, contain
144144
}
145145

146146
// Yay, all done.
147-
if drained, _ := allInstancesFullyDrained(responses); drained == true {
147+
if drained, _ := allInstancesFullyDrained(opts, responses); drained == true {
148148
if opts.Logger != nil {
149149
opts.Logger.Debugf("All container instances have been drained in Cluster %s!", clusterName)
150150
}
@@ -177,23 +177,23 @@ func NewECSClient(opts *Options) (*ecs.Client, error) {
177177
return ecs.NewFromConfig(cfg), nil
178178
}
179179

180-
func allInstancesFullyDrained(responses []*ecs.DescribeContainerInstancesOutput) (bool, error) {
180+
func allInstancesFullyDrained(opts *Options, responses []*ecs.DescribeContainerInstancesOutput) (bool, error) {
181181
for _, response := range responses {
182182
instances := response.ContainerInstances
183183
if len(instances) == 0 {
184184
return false, errors.WithStackTrace(fmt.Errorf("querying DescribeContainerInstances returned no instances"))
185185
}
186186

187187
for _, instance := range instances {
188-
if !instanceFullyDrained(instance) {
188+
if !instanceFullyDrained(opts, instance) {
189189
return false, nil
190190
}
191191
}
192192
}
193193
return true, nil
194194
}
195195

196-
func instanceFullyDrained(instance ecs_types.ContainerInstance) bool {
196+
func instanceFullyDrained(opts *Options, instance ecs_types.ContainerInstance) bool {
197197
instanceArn := instance.ContainerInstanceArn
198198

199199
if *instance.Status == "ACTIVE" {

0 commit comments

Comments
 (0)