Skip to content

Commit 15ebede

Browse files
authored
set finalizer when user is expired (#2346)
1 parent 1e4d6a1 commit 15ebede

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

internal/controller/atlasdatabaseuser/databaseuser.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ func (r *AtlasDatabaseUserReconciler) dbuLifeCycle(ctx *workflow.Context, dbUser
9292
return r.terminate(ctx, atlasDatabaseUser, api.DatabaseUserReadyType, workflow.DatabaseUserConnectionSecretsNotDeleted, true, err)
9393
}
9494

95-
return r.terminate(ctx, atlasDatabaseUser, api.DatabaseUserReadyType, workflow.DatabaseUserExpired, false, errors.New("an expired user cannot be managed"))
95+
ctx.SetConditionFromResult(api.DatabaseUserReadyType, workflow.Terminate(workflow.DatabaseUserExpired, errors.New("an expired user cannot be managed")))
96+
return r.unmanage(ctx, atlasProject.ID, atlasDatabaseUser)
9697
}
9798

9899
scopesAreValid, err := r.areDeploymentScopesValid(ctx, deploymentService, atlasProject.ID, atlasDatabaseUser)

test/e2e/db_users_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package e2e
15+
package e2e_test
1616

1717
import (
1818
"context"

0 commit comments

Comments
 (0)