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

OZG-5400 add log für realm update

parent f64149ba
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,7 @@ public class KeycloakRealmReconciler implements Reconciler<OzgCloudKeycloakRealm
var realmName = resource.getMetadata().getNamespace();
service.createRealm(resource.getSpec(), realmName);
service.createOrUpdateRealm(resource.getSpec(), resource.getMetadata().getNamespace());
service.createOrUpdateRealm(resource.getSpec(), realmName);
resource.setStatus(OzgCloudKeycloakRealmStatus.builder().status(OzgCloudCustomResourceStatus.OK).message(null).build());
return UpdateControl.updateStatus(resource);
......
......@@ -30,7 +30,9 @@ import org.springframework.stereotype.Component;
import de.ozgcloud.operator.keycloak.KeycloakGenericRemoteService;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
@Log4j2
@RequiredArgsConstructor
@Component
class KeycloakRealmService {
......@@ -56,19 +58,25 @@ class KeycloakRealmService {
}
void updateRealm(RealmRepresentation existingRealm, OzgCloudKeycloakRealmSpec spec) {
try {
LOG.debug("{}: Updating existing realm...", existingRealm);
var realmRepresentation = mapper.update(existingRealm, spec);
remoteService.updateRealm(realmRepresentation);
} catch (Exception e) {
LOG.warn(existingRealm + ": Updating existing realm failed: ", e);
throw e;
//addOrUpdateRealmRoles(spec, existingRealm.getRealm());
}
// addOrUpdateRealmRoles(spec, existingRealm.getRealm());
}
RealmRepresentation addRealmName(RealmRepresentation realm, String realmName) {
realm.setRealm(realmName);
return realm;
}
public void deleteRealm(String realmName) {
remoteService.deleteRealm(realmName);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment