Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func (r *AtlasDeploymentReconciler) checkDeploymentIsManaged(

if err != nil {
result := workflow.Terminate(workflow.Internal, fmt.Sprintf("unable to resolve ownership for deletion protection: %s", err))
workflowCtx.SetConditionFromResult(status.DatabaseUserReadyType, result)
workflowCtx.SetConditionFromResult(status.DeploymentReadyType, result)
log.Error(result.GetMessage())

return result
Expand All @@ -245,7 +245,7 @@ func (r *AtlasDeploymentReconciler) checkDeploymentIsManaged(
workflow.AtlasDeletionProtection,
"unable to reconcile Deployment due to deletion protection being enabled. see https://dochub.mongodb.org/core/ako-deletion-protection for further information",
)
workflowCtx.SetConditionFromResult(status.DatabaseUserReadyType, result)
workflowCtx.SetConditionFromResult(status.DeploymentReadyType, result)
log.Error(result.GetMessage())

return result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ func TestProtectedAdvancedDeploymentManagedInAtlas(t *testing.T) {
if tc.expectedErr == "" {
assert.True(t, result.IsOk())
} else {
assert.NotNil(t, te.workflowCtx.LastCondition())
if te.workflowCtx.LastCondition() != nil {
assert.Equal(t, status.DeploymentReadyType, te.workflowCtx.LastCondition().Type)
}
assert.Regexp(t, regexp.MustCompile(tc.expectedErr), result.GetMessage())
}
})
Expand Down Expand Up @@ -189,6 +193,10 @@ func TestProtectedServerlessManagedInAtlas(t *testing.T) {
if tc.expectedErr == "" {
assert.True(t, result.IsOk())
} else {
assert.NotNil(t, te.workflowCtx.LastCondition())
if te.workflowCtx.LastCondition() != nil {
assert.Equal(t, status.DeploymentReadyType, te.workflowCtx.LastCondition().Type)
}
assert.Regexp(t, regexp.MustCompile(tc.expectedErr), result.GetMessage())
}
})
Expand Down