(ctx context.Context, functionName string)
| 261 | } |
| 262 | |
| 263 | func (d *LambdaDeployer) waitForFunctionUpdated(ctx context.Context, functionName string) error { |
| 264 | log.Printf("Waiting for function update to complete...") |
| 265 | |
| 266 | checkFn := func() (bool, error) { |
| 267 | input := &lambda.GetFunctionInput{ |
| 268 | FunctionName: aws.String(functionName), |
| 269 | } |
| 270 | |
| 271 | result, err := d.clients.Lambda.GetFunctionWithContext(ctx, input) |
| 272 | if err != nil { |
| 273 | return false, err |
| 274 | } |
| 275 | |
| 276 | lastUpdateStatus := *result.Configuration.LastUpdateStatus |
| 277 | log.Printf("Function update status: %s", lastUpdateStatus) |
| 278 | |
| 279 | if lastUpdateStatus == lambda.LastUpdateStatusFailed { |
| 280 | return false, fmt.Errorf("function update failed") |
| 281 | } |
| 282 | |
| 283 | return lastUpdateStatus == lambda.LastUpdateStatusSuccessful, nil |
| 284 | } |
| 285 | |
| 286 | return awsclients.WaitForOperation(ctx, checkFn, 5*time.Minute) |
| 287 | } |
| 288 | |
| 289 | func (d *LambdaDeployer) extractFunctionInfo(config *lambda.FunctionConfiguration) *LambdaDeployResult { |
| 290 | result := &LambdaDeployResult{ |
no test coverage detected