Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force reply with AtlasDeploymentReady type #1366

Merged
merged 1 commit into from
Feb 8, 2024
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
4 changes: 2 additions & 2 deletions pkg/controller/atlasdeployment/atlasdeployment_controller.go
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)
s-urbaniak marked this conversation as resolved.
Show resolved Hide resolved
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
Loading