Skip to content
Snippets Groups Projects
Commit b02bd704 authored by OZGCloud's avatar OZGCloud
Browse files

catch/log(info) NotFoundException on user cleanup

parent 84082c76
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,8 @@ package de.ozgcloud.operator.keycloak.user;
import java.util.logging.Level;
import javax.ws.rs.NotFoundException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
......@@ -103,6 +105,9 @@ public class KeycloakUserReconciler implements Reconciler<OzgKeycloakUser>, Clea
try {
service.deleteUser(user.getSpec(), namespace);
return DeleteControl.defaultDelete();
} catch (NotFoundException e) {
log.log(Level.INFO, String.format("Could not delete user %s in namespace %s, user not found.", userName, namespace));
return DeleteControl.defaultDelete();
} catch (Exception e) {
log.log(Level.SEVERE, String.format("Could not delete user %s in namespace %s", userName, namespace), e);
return DeleteControl.defaultDelete();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment