mirror of
https://github.com/docker/compose.git
synced 2025-07-21 04:34:38 +02:00
Detect changeset creation failure when there's no changet
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
4b88896547
commit
e99a8b54f8
13
ecs/sdk.go
13
ecs/sdk.go
@ -264,9 +264,20 @@ func (s sdk) CreateChangeSet(ctx context.Context, name string, template []byte)
|
|||||||
return "", err
|
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,
|
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
|
return *changeset.Id, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user