Search in sources :

Example 1 with Keycloak

use of org.keycloak.operator.v2alpha1.crds.Keycloak in project keycloak by keycloak.

the class KeycloakController method updateErrorStatus.

@Override
public Optional<Keycloak> updateErrorStatus(Keycloak kc, RetryInfo retryInfo, RuntimeException e) {
    Log.error("--- Error reconciling", e);
    KeycloakStatus status = new KeycloakStatusBuilder().addErrorMessage("Error performing operations:\n" + e.getMessage()).build();
    kc.setStatus(status);
    return Optional.of(kc);
}
Also used : KeycloakStatusBuilder(org.keycloak.operator.v2alpha1.crds.KeycloakStatusBuilder) KeycloakStatus(org.keycloak.operator.v2alpha1.crds.KeycloakStatus)

Example 2 with Keycloak

use of org.keycloak.operator.v2alpha1.crds.Keycloak in project keycloak by keycloak.

the class PodTemplateTest method getDeployment.

Deployment getDeployment(PodTemplateSpec podTemplate) {
    var config = new Config() {

        @Override
        public Keycloak keycloak() {
            return new Keycloak() {

                @Override
                public String image() {
                    return "dummy-image";
                }

                @Override
                public String imagePullPolicy() {
                    return "Never";
                }

                @Override
                public String initContainerImage() {
                    return "quay.io/keycloak/keycloak-init-container:legacy";
                }

                @Override
                public String initContainerImagePullPolicy() {
                    return "Always";
                }
            };
        }
    };
    var kc = new Keycloak();
    var spec = new KeycloakSpec();
    spec.setUnsupported(new Unsupported(podTemplate));
    kc.setSpec(spec);
    var deployment = new KeycloakDeployment(null, config, kc, new Deployment());
    return (Deployment) deployment.getReconciledResource().get();
}
Also used : KeycloakDeployment(org.keycloak.operator.v2alpha1.KeycloakDeployment) KeycloakDeployment(org.keycloak.operator.v2alpha1.KeycloakDeployment) Deployment(io.fabric8.kubernetes.api.model.apps.Deployment) Unsupported(org.keycloak.operator.v2alpha1.crds.keycloakspec.Unsupported) KeycloakSpec(org.keycloak.operator.v2alpha1.crds.KeycloakSpec) Keycloak(org.keycloak.operator.v2alpha1.crds.Keycloak)

Aggregations

Deployment (io.fabric8.kubernetes.api.model.apps.Deployment)1 KeycloakDeployment (org.keycloak.operator.v2alpha1.KeycloakDeployment)1 Keycloak (org.keycloak.operator.v2alpha1.crds.Keycloak)1 KeycloakSpec (org.keycloak.operator.v2alpha1.crds.KeycloakSpec)1 KeycloakStatus (org.keycloak.operator.v2alpha1.crds.KeycloakStatus)1 KeycloakStatusBuilder (org.keycloak.operator.v2alpha1.crds.KeycloakStatusBuilder)1 Unsupported (org.keycloak.operator.v2alpha1.crds.keycloakspec.Unsupported)1