Skip to content

Commit ca47e67

Browse files
committed
fix(observability): Adjusted wait handler: sometimes GetInstanceExecute returns nil for the instance
Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de>
1 parent 248cfb4 commit ca47e67

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

services/observability/wait/wait.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ func CreateInstanceWaitHandler(ctx context.Context, a APIClientInterface, instan
3737
if err != nil {
3838
return false, nil, err
3939
}
40+
if s == nil {
41+
return false, nil, nil
42+
}
4043
if s.Id == nil || s.Status == nil {
4144
return false, nil, fmt.Errorf("could not get instance id or status from response for project %s and instance %s", projectId, instanceId)
4245
}
@@ -59,6 +62,9 @@ func UpdateInstanceWaitHandler(ctx context.Context, a APIClientInterface, instan
5962
if err != nil {
6063
return false, nil, err
6164
}
65+
if s == nil {
66+
return false, nil, nil
67+
}
6268
if s.Id == nil || s.Status == nil {
6369
return false, nil, fmt.Errorf("could not get instance id or status from response for project %s and instance %s", projectId, instanceId)
6470
}
@@ -82,6 +88,9 @@ func DeleteInstanceWaitHandler(ctx context.Context, a APIClientInterface, instan
8288
if err != nil {
8389
return false, nil, err
8490
}
91+
if s == nil {
92+
return false, nil, nil
93+
}
8594
if s.Id == nil || s.Status == nil {
8695
return false, nil, fmt.Errorf("could not get instance id or status from response for project %s and instance %s", projectId, instanceId)
8796
}

0 commit comments

Comments
 (0)