Merge pull request #883 from docker/no_changes

This commit is contained in:
Nicolas De loof 2020-11-05 14:06:41 +01:00 committed by GitHub
commit ba0d7c61f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -264,9 +264,20 @@ func (s sdk) CreateChangeSet(ctx context.Context, name string, template []byte)
return "", err
}
err = s.CF.WaitUntilChangeSetCreateCompleteWithContext(ctx, &cloudformation.DescribeChangeSetInput{
// we have to WaitUntilChangeSetCreateComplete even this in fail with error `ResourceNotReady`
// so that we can invoke DescribeChangeSet to check status, and then we can know about the actual creation failure cause.
s.CF.WaitUntilChangeSetCreateCompleteWithContext(ctx, &cloudformation.DescribeChangeSetInput{ // nolint:errcheck
ChangeSetName: changeset.Id,
})
desc, err := s.CF.DescribeChangeSetWithContext(ctx, &cloudformation.DescribeChangeSetInput{
ChangeSetName: aws.String(update),
StackName: aws.String(name),
})
if aws.StringValue(desc.Status) == "FAILED" {
return *changeset.Id, fmt.Errorf(aws.StringValue(desc.StatusReason))
}
return *changeset.Id, err
}