Refactor the packages structure of the operator
This commit is contained in:
parent
74870a2ac6
commit
0a8e132c7c
36 changed files with 94 additions and 110 deletions
|
@ -1,12 +1,11 @@
|
||||||
package org.keycloak.operator.v2alpha1;
|
package org.keycloak.operator.controllers;
|
||||||
|
|
||||||
import io.fabric8.kubernetes.api.model.HasMetadata;
|
import io.fabric8.kubernetes.api.model.HasMetadata;
|
||||||
import io.fabric8.kubernetes.api.model.Secret;
|
import io.fabric8.kubernetes.api.model.Secret;
|
||||||
import io.fabric8.kubernetes.api.model.SecretBuilder;
|
import io.fabric8.kubernetes.api.model.SecretBuilder;
|
||||||
import io.fabric8.kubernetes.client.KubernetesClient;
|
import io.fabric8.kubernetes.client.KubernetesClient;
|
||||||
import io.fabric8.kubernetes.client.utils.KubernetesResourceUtil;
|
import io.fabric8.kubernetes.client.utils.KubernetesResourceUtil;
|
||||||
import org.keycloak.operator.OperatorManagedResource;
|
import org.keycloak.operator.crds.v2alpha1.deployment.Keycloak;
|
||||||
import org.keycloak.operator.v2alpha1.crds.Keycloak;
|
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
|
@ -14,7 +14,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.keycloak.operator.v2alpha1;
|
package org.keycloak.operator.controllers;
|
||||||
|
|
||||||
import io.fabric8.kubernetes.api.model.Service;
|
import io.fabric8.kubernetes.api.model.Service;
|
||||||
import io.fabric8.kubernetes.api.model.apps.Deployment;
|
import io.fabric8.kubernetes.api.model.apps.Deployment;
|
||||||
|
@ -35,10 +35,10 @@ import io.javaoperatorsdk.operator.processing.event.source.informer.Mappers;
|
||||||
import io.quarkus.logging.Log;
|
import io.quarkus.logging.Log;
|
||||||
import org.keycloak.operator.Config;
|
import org.keycloak.operator.Config;
|
||||||
import org.keycloak.operator.Constants;
|
import org.keycloak.operator.Constants;
|
||||||
import org.keycloak.operator.v2alpha1.crds.Keycloak;
|
import org.keycloak.operator.crds.v2alpha1.deployment.Keycloak;
|
||||||
import org.keycloak.operator.v2alpha1.crds.KeycloakStatus;
|
import org.keycloak.operator.crds.v2alpha1.deployment.KeycloakStatus;
|
||||||
import org.keycloak.operator.v2alpha1.crds.KeycloakStatusBuilder;
|
import org.keycloak.operator.crds.v2alpha1.deployment.KeycloakStatusBuilder;
|
||||||
import org.keycloak.operator.v2alpha1.crds.KeycloakStatusCondition;
|
import org.keycloak.operator.crds.v2alpha1.deployment.KeycloakStatusCondition;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import java.util.List;
|
import java.util.List;
|
|
@ -14,7 +14,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.keycloak.operator.v2alpha1;
|
package org.keycloak.operator.controllers;
|
||||||
|
|
||||||
import io.fabric8.kubernetes.api.model.Container;
|
import io.fabric8.kubernetes.api.model.Container;
|
||||||
import io.fabric8.kubernetes.api.model.EnvVar;
|
import io.fabric8.kubernetes.api.model.EnvVar;
|
||||||
|
@ -32,11 +32,9 @@ import io.fabric8.kubernetes.client.utils.Serialization;
|
||||||
import io.quarkus.logging.Log;
|
import io.quarkus.logging.Log;
|
||||||
import org.keycloak.operator.Config;
|
import org.keycloak.operator.Config;
|
||||||
import org.keycloak.operator.Constants;
|
import org.keycloak.operator.Constants;
|
||||||
import org.keycloak.operator.OperatorManagedResource;
|
import org.keycloak.operator.crds.v2alpha1.deployment.Keycloak;
|
||||||
import org.keycloak.operator.StatusUpdater;
|
import org.keycloak.operator.crds.v2alpha1.deployment.KeycloakStatusBuilder;
|
||||||
import org.keycloak.operator.v2alpha1.crds.Keycloak;
|
import org.keycloak.operator.crds.v2alpha1.deployment.ValueOrSecret;
|
||||||
import org.keycloak.operator.v2alpha1.crds.KeycloakStatusBuilder;
|
|
||||||
import org.keycloak.operator.v2alpha1.crds.ValueOrSecret;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
|
@ -14,20 +14,17 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.keycloak.operator.v2alpha1;
|
package org.keycloak.operator.controllers;
|
||||||
|
|
||||||
import io.fabric8.kubernetes.api.model.HasMetadata;
|
import io.fabric8.kubernetes.api.model.HasMetadata;
|
||||||
import io.fabric8.kubernetes.api.model.IntOrString;
|
|
||||||
import io.fabric8.kubernetes.api.model.Service;
|
import io.fabric8.kubernetes.api.model.Service;
|
||||||
import io.fabric8.kubernetes.api.model.ServiceBuilder;
|
import io.fabric8.kubernetes.api.model.ServiceBuilder;
|
||||||
import io.fabric8.kubernetes.api.model.ServiceSpec;
|
import io.fabric8.kubernetes.api.model.ServiceSpec;
|
||||||
import io.fabric8.kubernetes.api.model.ServiceSpecBuilder;
|
import io.fabric8.kubernetes.api.model.ServiceSpecBuilder;
|
||||||
import io.fabric8.kubernetes.client.KubernetesClient;
|
import io.fabric8.kubernetes.client.KubernetesClient;
|
||||||
import org.keycloak.operator.Constants;
|
import org.keycloak.operator.Constants;
|
||||||
import org.keycloak.operator.OperatorManagedResource;
|
import org.keycloak.operator.crds.v2alpha1.deployment.Keycloak;
|
||||||
import org.keycloak.operator.StatusUpdater;
|
import org.keycloak.operator.crds.v2alpha1.deployment.KeycloakStatusBuilder;
|
||||||
import org.keycloak.operator.v2alpha1.crds.Keycloak;
|
|
||||||
import org.keycloak.operator.v2alpha1.crds.KeycloakStatusBuilder;
|
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
|
@ -14,17 +14,15 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.keycloak.operator.v2alpha1;
|
package org.keycloak.operator.controllers;
|
||||||
|
|
||||||
import io.fabric8.kubernetes.api.model.HasMetadata;
|
import io.fabric8.kubernetes.api.model.HasMetadata;
|
||||||
import io.fabric8.kubernetes.api.model.networking.v1.IngressBuilder;
|
import io.fabric8.kubernetes.api.model.networking.v1.IngressBuilder;
|
||||||
import io.fabric8.kubernetes.client.KubernetesClient;
|
import io.fabric8.kubernetes.client.KubernetesClient;
|
||||||
import io.fabric8.kubernetes.api.model.networking.v1.Ingress;
|
import io.fabric8.kubernetes.api.model.networking.v1.Ingress;
|
||||||
import org.keycloak.operator.Constants;
|
import org.keycloak.operator.Constants;
|
||||||
import org.keycloak.operator.OperatorManagedResource;
|
import org.keycloak.operator.crds.v2alpha1.deployment.Keycloak;
|
||||||
import org.keycloak.operator.StatusUpdater;
|
import org.keycloak.operator.crds.v2alpha1.deployment.KeycloakStatusBuilder;
|
||||||
import org.keycloak.operator.v2alpha1.crds.Keycloak;
|
|
||||||
import org.keycloak.operator.v2alpha1.crds.KeycloakStatusBuilder;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
|
@ -14,7 +14,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.keycloak.operator.v2alpha1;
|
package org.keycloak.operator.controllers;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import io.fabric8.kubernetes.api.model.batch.v1.Job;
|
import io.fabric8.kubernetes.api.model.batch.v1.Job;
|
||||||
|
@ -32,10 +32,10 @@ import io.javaoperatorsdk.operator.processing.event.source.EventSource;
|
||||||
import io.javaoperatorsdk.operator.processing.event.source.informer.InformerEventSource;
|
import io.javaoperatorsdk.operator.processing.event.source.informer.InformerEventSource;
|
||||||
import io.javaoperatorsdk.operator.processing.event.source.informer.Mappers;
|
import io.javaoperatorsdk.operator.processing.event.source.informer.Mappers;
|
||||||
import io.quarkus.logging.Log;
|
import io.quarkus.logging.Log;
|
||||||
import org.keycloak.operator.v2alpha1.crds.KeycloakRealmImport;
|
import org.keycloak.operator.crds.v2alpha1.realmimport.KeycloakRealmImport;
|
||||||
import org.keycloak.operator.v2alpha1.crds.KeycloakRealmImportStatus;
|
import org.keycloak.operator.crds.v2alpha1.realmimport.KeycloakRealmImportStatus;
|
||||||
import org.keycloak.operator.v2alpha1.crds.KeycloakRealmImportStatusBuilder;
|
import org.keycloak.operator.crds.v2alpha1.realmimport.KeycloakRealmImportStatusBuilder;
|
||||||
import org.keycloak.operator.v2alpha1.crds.KeycloakRealmImportStatusCondition;
|
import org.keycloak.operator.crds.v2alpha1.realmimport.KeycloakRealmImportStatusCondition;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.keycloak.operator.v2alpha1;
|
package org.keycloak.operator.controllers;
|
||||||
|
|
||||||
import io.fabric8.kubernetes.api.model.Container;
|
import io.fabric8.kubernetes.api.model.Container;
|
||||||
import io.fabric8.kubernetes.api.model.HasMetadata;
|
import io.fabric8.kubernetes.api.model.HasMetadata;
|
||||||
|
@ -30,10 +30,9 @@ import io.fabric8.kubernetes.client.KubernetesClient;
|
||||||
import io.fabric8.kubernetes.client.ResourceNotFoundException;
|
import io.fabric8.kubernetes.client.ResourceNotFoundException;
|
||||||
import io.fabric8.kubernetes.client.utils.KubernetesResourceUtil;
|
import io.fabric8.kubernetes.client.utils.KubernetesResourceUtil;
|
||||||
import io.quarkus.logging.Log;
|
import io.quarkus.logging.Log;
|
||||||
import org.keycloak.operator.OperatorManagedResource;
|
import org.keycloak.operator.crds.v2alpha1.deployment.Keycloak;
|
||||||
import org.keycloak.operator.v2alpha1.crds.Keycloak;
|
import org.keycloak.operator.crds.v2alpha1.realmimport.KeycloakRealmImport;
|
||||||
import org.keycloak.operator.v2alpha1.crds.KeycloakRealmImport;
|
import org.keycloak.operator.crds.v2alpha1.realmimport.KeycloakRealmImportStatusBuilder;
|
||||||
import org.keycloak.operator.v2alpha1.crds.KeycloakRealmImportStatusBuilder;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.keycloak.operator.v2alpha1;
|
package org.keycloak.operator.controllers;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
@ -7,8 +7,7 @@ import io.fabric8.kubernetes.api.model.Secret;
|
||||||
import io.fabric8.kubernetes.api.model.SecretBuilder;
|
import io.fabric8.kubernetes.api.model.SecretBuilder;
|
||||||
import io.fabric8.kubernetes.client.KubernetesClient;
|
import io.fabric8.kubernetes.client.KubernetesClient;
|
||||||
import io.fabric8.kubernetes.client.utils.KubernetesResourceUtil;
|
import io.fabric8.kubernetes.client.utils.KubernetesResourceUtil;
|
||||||
import org.keycloak.operator.OperatorManagedResource;
|
import org.keycloak.operator.crds.v2alpha1.realmimport.KeycloakRealmImport;
|
||||||
import org.keycloak.operator.v2alpha1.crds.KeycloakRealmImport;
|
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.keycloak.operator.v2alpha1;
|
package org.keycloak.operator.controllers;
|
||||||
|
|
||||||
import io.fabric8.kubernetes.api.model.HasMetadata;
|
import io.fabric8.kubernetes.api.model.HasMetadata;
|
||||||
import io.fabric8.kubernetes.api.model.Service;
|
import io.fabric8.kubernetes.api.model.Service;
|
||||||
|
@ -23,10 +23,8 @@ import io.fabric8.kubernetes.api.model.ServiceSpec;
|
||||||
import io.fabric8.kubernetes.api.model.ServiceSpecBuilder;
|
import io.fabric8.kubernetes.api.model.ServiceSpecBuilder;
|
||||||
import io.fabric8.kubernetes.client.KubernetesClient;
|
import io.fabric8.kubernetes.client.KubernetesClient;
|
||||||
import org.keycloak.operator.Constants;
|
import org.keycloak.operator.Constants;
|
||||||
import org.keycloak.operator.OperatorManagedResource;
|
import org.keycloak.operator.crds.v2alpha1.deployment.Keycloak;
|
||||||
import org.keycloak.operator.StatusUpdater;
|
import org.keycloak.operator.crds.v2alpha1.deployment.KeycloakStatusBuilder;
|
||||||
import org.keycloak.operator.v2alpha1.crds.Keycloak;
|
|
||||||
import org.keycloak.operator.v2alpha1.crds.KeycloakStatusBuilder;
|
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.keycloak.operator;
|
package org.keycloak.operator.controllers;
|
||||||
|
|
||||||
import io.fabric8.kubernetes.api.model.HasMetadata;
|
import io.fabric8.kubernetes.api.model.HasMetadata;
|
||||||
import io.fabric8.kubernetes.api.model.OwnerReference;
|
import io.fabric8.kubernetes.api.model.OwnerReference;
|
||||||
|
@ -24,6 +24,7 @@ import io.fabric8.kubernetes.client.CustomResource;
|
||||||
import io.fabric8.kubernetes.client.KubernetesClient;
|
import io.fabric8.kubernetes.client.KubernetesClient;
|
||||||
import io.fabric8.kubernetes.client.utils.Serialization;
|
import io.fabric8.kubernetes.client.utils.Serialization;
|
||||||
import io.quarkus.logging.Log;
|
import io.quarkus.logging.Log;
|
||||||
|
import org.keycloak.operator.Constants;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.keycloak.operator;
|
package org.keycloak.operator.controllers;
|
||||||
|
|
||||||
public interface StatusUpdater<T> {
|
public interface StatusUpdater<T> {
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.keycloak.operator.v2alpha1;
|
package org.keycloak.operator.controllers;
|
||||||
|
|
||||||
import io.fabric8.kubernetes.api.model.HasMetadata;
|
import io.fabric8.kubernetes.api.model.HasMetadata;
|
||||||
import io.fabric8.kubernetes.api.model.Secret;
|
import io.fabric8.kubernetes.api.model.Secret;
|
||||||
|
@ -29,8 +29,7 @@ import io.javaoperatorsdk.operator.processing.event.source.informer.InformerEven
|
||||||
import io.javaoperatorsdk.operator.processing.event.source.informer.Mappers;
|
import io.javaoperatorsdk.operator.processing.event.source.informer.Mappers;
|
||||||
import io.quarkus.logging.Log;
|
import io.quarkus.logging.Log;
|
||||||
import org.keycloak.operator.Constants;
|
import org.keycloak.operator.Constants;
|
||||||
import org.keycloak.operator.OperatorManagedResource;
|
import org.keycloak.operator.crds.v2alpha1.deployment.Keycloak;
|
||||||
import org.keycloak.operator.v2alpha1.crds.Keycloak;
|
|
||||||
|
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
|
@ -14,7 +14,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.keycloak.operator.v2alpha1.crds;
|
package org.keycloak.operator.crds.v2alpha1.deployment;
|
||||||
|
|
||||||
import io.fabric8.kubernetes.api.model.Namespaced;
|
import io.fabric8.kubernetes.api.model.Namespaced;
|
||||||
import io.fabric8.kubernetes.client.CustomResource;
|
import io.fabric8.kubernetes.client.CustomResource;
|
||||||
|
@ -34,7 +34,7 @@ import org.keycloak.operator.Constants;
|
||||||
lazyCollectionInitEnabled = false, refs = {
|
lazyCollectionInitEnabled = false, refs = {
|
||||||
@BuildableReference(io.fabric8.kubernetes.api.model.ObjectMeta.class),
|
@BuildableReference(io.fabric8.kubernetes.api.model.ObjectMeta.class),
|
||||||
@BuildableReference(io.fabric8.kubernetes.client.CustomResource.class),
|
@BuildableReference(io.fabric8.kubernetes.client.CustomResource.class),
|
||||||
@BuildableReference(org.keycloak.operator.v2alpha1.crds.KeycloakSpec.class)
|
@BuildableReference(KeycloakSpec.class)
|
||||||
})
|
})
|
||||||
public class Keycloak extends CustomResource<KeycloakSpec, KeycloakStatus> implements Namespaced {
|
public class Keycloak extends CustomResource<KeycloakSpec, KeycloakStatus> implements Namespaced {
|
||||||
|
|
|
@ -14,14 +14,12 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.keycloak.operator.v2alpha1.crds;
|
package org.keycloak.operator.crds.v2alpha1.deployment;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
|
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
|
||||||
|
|
||||||
import org.keycloak.operator.Constants;
|
import org.keycloak.operator.Constants;
|
||||||
import org.keycloak.operator.codegen.configuration.ServerConfig;
|
|
||||||
import org.keycloak.operator.v2alpha1.crds.keycloakspec.Unsupported;
|
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -52,7 +50,7 @@ public class KeycloakSpec {
|
||||||
@JsonPropertyDescription(
|
@JsonPropertyDescription(
|
||||||
"In this section you can configure podTemplate advanced features, not production-ready, and not supported settings.\n" +
|
"In this section you can configure podTemplate advanced features, not production-ready, and not supported settings.\n" +
|
||||||
"Use at your own risk and open an issue with your use-case if you don't find an alternative way.")
|
"Use at your own risk and open an issue with your use-case if you don't find an alternative way.")
|
||||||
private Unsupported unsupported;
|
private KeycloakSpecUnsupported unsupported;
|
||||||
|
|
||||||
public String getHostname() {
|
public String getHostname() {
|
||||||
return hostname;
|
return hostname;
|
||||||
|
@ -88,11 +86,11 @@ public class KeycloakSpec {
|
||||||
return this.tlsSecret.equals(Constants.INSECURE_DISABLE);
|
return this.tlsSecret.equals(Constants.INSECURE_DISABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Unsupported getUnsupported() {
|
public KeycloakSpecUnsupported getUnsupported() {
|
||||||
return unsupported;
|
return unsupported;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUnsupported(Unsupported unsupported) {
|
public void setUnsupported(KeycloakSpecUnsupported unsupported) {
|
||||||
this.unsupported = unsupported;
|
this.unsupported = unsupported;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.keycloak.operator.v2alpha1.crds.keycloakspec;
|
package org.keycloak.operator.crds.v2alpha1.deployment;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
|
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
|
||||||
import io.fabric8.kubernetes.api.model.PodTemplateSpec;
|
import io.fabric8.kubernetes.api.model.PodTemplateSpec;
|
||||||
|
@ -10,16 +10,16 @@ import io.sundr.builder.annotations.BuildableReference;
|
||||||
@BuildableReference(io.fabric8.kubernetes.api.model.ObjectMeta.class),
|
@BuildableReference(io.fabric8.kubernetes.api.model.ObjectMeta.class),
|
||||||
@BuildableReference(io.fabric8.kubernetes.api.model.PodTemplateSpec.class)
|
@BuildableReference(io.fabric8.kubernetes.api.model.PodTemplateSpec.class)
|
||||||
})
|
})
|
||||||
public class Unsupported {
|
public class KeycloakSpecUnsupported {
|
||||||
|
|
||||||
@JsonPropertyDescription("You can configure that will be merged with the one configured by default by the operator.\n" +
|
@JsonPropertyDescription("You can configure that will be merged with the one configured by default by the operator.\n" +
|
||||||
"Use at your own risk, we reserve the possibility to remove/change the way any field gets merged in future releases without notice.\n" +
|
"Use at your own risk, we reserve the possibility to remove/change the way any field gets merged in future releases without notice.\n" +
|
||||||
"Reference: https://kubernetes.io/docs/concepts/workloads/pods/#pod-templates")
|
"Reference: https://kubernetes.io/docs/concepts/workloads/pods/#pod-templates")
|
||||||
private PodTemplateSpec podTemplate;
|
private PodTemplateSpec podTemplate;
|
||||||
|
|
||||||
public Unsupported() {}
|
public KeycloakSpecUnsupported() {}
|
||||||
|
|
||||||
public Unsupported(PodTemplateSpec podTemplate) {
|
public KeycloakSpecUnsupported(PodTemplateSpec podTemplate) {
|
||||||
this.podTemplate = podTemplate;
|
this.podTemplate = podTemplate;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.keycloak.operator.v2alpha1.crds;
|
package org.keycloak.operator.crds.v2alpha1.deployment;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
|
@ -15,7 +15,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.keycloak.operator.v2alpha1.crds;
|
package org.keycloak.operator.crds.v2alpha1.deployment;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
|
@ -15,7 +15,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.keycloak.operator.v2alpha1.crds;
|
package org.keycloak.operator.crds.v2alpha1.deployment;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.keycloak.operator.v2alpha1.crds;
|
package org.keycloak.operator.crds.v2alpha1.deployment;
|
||||||
|
|
||||||
import io.fabric8.kubernetes.api.model.SecretKeySelector;
|
import io.fabric8.kubernetes.api.model.SecretKeySelector;
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.keycloak.operator.v2alpha1.crds;
|
package org.keycloak.operator.crds.v2alpha1.realmimport;
|
||||||
|
|
||||||
import io.fabric8.kubernetes.api.model.Namespaced;
|
import io.fabric8.kubernetes.api.model.Namespaced;
|
||||||
import io.fabric8.kubernetes.client.CustomResource;
|
import io.fabric8.kubernetes.client.CustomResource;
|
||||||
|
@ -30,7 +30,7 @@ import org.keycloak.operator.Constants;
|
||||||
lazyCollectionInitEnabled = false, refs = {
|
lazyCollectionInitEnabled = false, refs = {
|
||||||
@BuildableReference(io.fabric8.kubernetes.api.model.ObjectMeta.class),
|
@BuildableReference(io.fabric8.kubernetes.api.model.ObjectMeta.class),
|
||||||
@BuildableReference(io.fabric8.kubernetes.client.CustomResource.class),
|
@BuildableReference(io.fabric8.kubernetes.client.CustomResource.class),
|
||||||
@BuildableReference(org.keycloak.operator.v2alpha1.crds.KeycloakRealmImportSpec.class)
|
@BuildableReference(KeycloakRealmImportSpec.class)
|
||||||
})
|
})
|
||||||
public class KeycloakRealmImport extends CustomResource<KeycloakRealmImportSpec, KeycloakRealmImportStatus> implements Namespaced {
|
public class KeycloakRealmImport extends CustomResource<KeycloakRealmImportSpec, KeycloakRealmImportStatus> implements Namespaced {
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.keycloak.operator.v2alpha1.crds;
|
package org.keycloak.operator.crds.v2alpha1.realmimport;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
|
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
|
||||||
import org.keycloak.representations.idm.RealmRepresentation;
|
import org.keycloak.representations.idm.RealmRepresentation;
|
|
@ -14,12 +14,12 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.keycloak.operator.v2alpha1.crds;
|
package org.keycloak.operator.crds.v2alpha1.realmimport;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import static org.keycloak.operator.v2alpha1.crds.KeycloakRealmImportStatusCondition.DONE;
|
import static org.keycloak.operator.crds.v2alpha1.realmimport.KeycloakRealmImportStatusCondition.DONE;
|
||||||
|
|
||||||
public class KeycloakRealmImportStatus {
|
public class KeycloakRealmImportStatus {
|
||||||
private List<KeycloakRealmImportStatusCondition> conditions;
|
private List<KeycloakRealmImportStatusCondition> conditions;
|
|
@ -15,7 +15,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.keycloak.operator.v2alpha1.crds;
|
package org.keycloak.operator.crds.v2alpha1.realmimport;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
|
@ -15,7 +15,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.keycloak.operator.v2alpha1.crds;
|
package org.keycloak.operator.crds.v2alpha1.realmimport;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
|
@ -2,7 +2,7 @@ package org.keycloak.operator;
|
||||||
|
|
||||||
import io.fabric8.kubernetes.client.utils.Serialization;
|
import io.fabric8.kubernetes.client.utils.Serialization;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.keycloak.operator.v2alpha1.crds.Keycloak;
|
import org.keycloak.operator.crds.v2alpha1.deployment.Keycloak;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
|
@ -19,7 +19,7 @@ import org.junit.jupiter.api.AfterAll;
|
||||||
import org.junit.jupiter.api.AfterEach;
|
import org.junit.jupiter.api.AfterEach;
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.keycloak.operator.v2alpha1.crds.Keycloak;
|
import org.keycloak.operator.crds.v2alpha1.deployment.Keycloak;
|
||||||
|
|
||||||
import javax.enterprise.inject.Instance;
|
import javax.enterprise.inject.Instance;
|
||||||
import javax.enterprise.inject.spi.CDI;
|
import javax.enterprise.inject.spi.CDI;
|
||||||
|
|
|
@ -8,12 +8,12 @@ import io.restassured.RestAssured;
|
||||||
import org.awaitility.Awaitility;
|
import org.awaitility.Awaitility;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.keycloak.operator.utils.CRAssert;
|
import org.keycloak.operator.utils.CRAssert;
|
||||||
import org.keycloak.operator.v2alpha1.KeycloakService;
|
import org.keycloak.operator.controllers.KeycloakService;
|
||||||
import org.keycloak.operator.v2alpha1.crds.Keycloak;
|
import org.keycloak.operator.crds.v2alpha1.deployment.Keycloak;
|
||||||
import org.keycloak.operator.utils.K8sUtils;
|
import org.keycloak.operator.utils.K8sUtils;
|
||||||
import org.keycloak.operator.v2alpha1.crds.KeycloakRealmImport;
|
import org.keycloak.operator.crds.v2alpha1.realmimport.KeycloakRealmImport;
|
||||||
import org.keycloak.operator.v2alpha1.crds.KeycloakRealmImportStatusCondition;
|
import org.keycloak.operator.crds.v2alpha1.realmimport.KeycloakRealmImportStatusCondition;
|
||||||
import org.keycloak.operator.v2alpha1.crds.KeycloakStatusCondition;
|
import org.keycloak.operator.crds.v2alpha1.deployment.KeycloakStatusCondition;
|
||||||
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
|
|
||||||
|
|
|
@ -8,11 +8,11 @@ import org.awaitility.Awaitility;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
|
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
|
||||||
import org.keycloak.operator.utils.K8sUtils;
|
import org.keycloak.operator.utils.K8sUtils;
|
||||||
import org.keycloak.operator.v2alpha1.KeycloakAdminSecret;
|
import org.keycloak.operator.controllers.KeycloakAdminSecret;
|
||||||
import org.keycloak.operator.v2alpha1.KeycloakDeployment;
|
import org.keycloak.operator.controllers.KeycloakDeployment;
|
||||||
import org.keycloak.operator.v2alpha1.KeycloakService;
|
import org.keycloak.operator.controllers.KeycloakService;
|
||||||
import org.keycloak.operator.v2alpha1.crds.Keycloak;
|
import org.keycloak.operator.crds.v2alpha1.deployment.Keycloak;
|
||||||
import org.keycloak.operator.v2alpha1.crds.ValueOrSecret;
|
import org.keycloak.operator.crds.v2alpha1.deployment.ValueOrSecret;
|
||||||
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
|
|
|
@ -7,7 +7,7 @@ import io.restassured.RestAssured;
|
||||||
import org.awaitility.Awaitility;
|
import org.awaitility.Awaitility;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.keycloak.operator.utils.K8sUtils;
|
import org.keycloak.operator.utils.K8sUtils;
|
||||||
import org.keycloak.operator.v2alpha1.KeycloakIngress;
|
import org.keycloak.operator.controllers.KeycloakIngress;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,8 @@ import io.quarkus.logging.Log;
|
||||||
import io.quarkus.test.junit.QuarkusTest;
|
import io.quarkus.test.junit.QuarkusTest;
|
||||||
import org.awaitility.Awaitility;
|
import org.awaitility.Awaitility;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.keycloak.operator.v2alpha1.KeycloakDiscoveryService;
|
import org.keycloak.operator.controllers.KeycloakDiscoveryService;
|
||||||
import org.keycloak.operator.v2alpha1.KeycloakService;
|
import org.keycloak.operator.controllers.KeycloakService;
|
||||||
import org.keycloak.operator.utils.K8sUtils;
|
import org.keycloak.operator.utils.K8sUtils;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
|
@ -8,11 +8,11 @@ import io.quarkus.test.junit.QuarkusTest;
|
||||||
import org.awaitility.Awaitility;
|
import org.awaitility.Awaitility;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.keycloak.operator.utils.CRAssert;
|
import org.keycloak.operator.utils.CRAssert;
|
||||||
import org.keycloak.operator.v2alpha1.crds.Keycloak;
|
import org.keycloak.operator.crds.v2alpha1.deployment.Keycloak;
|
||||||
|
|
||||||
import static java.util.concurrent.TimeUnit.MINUTES;
|
import static java.util.concurrent.TimeUnit.MINUTES;
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.keycloak.operator.v2alpha1.crds.KeycloakStatusCondition.HAS_ERRORS;
|
import static org.keycloak.operator.crds.v2alpha1.deployment.KeycloakStatusCondition.HAS_ERRORS;
|
||||||
|
|
||||||
@QuarkusTest
|
@QuarkusTest
|
||||||
public class PodTemplateE2EIT extends ClusterOperatorTest {
|
public class PodTemplateE2EIT extends ClusterOperatorTest {
|
||||||
|
|
|
@ -7,12 +7,10 @@ import io.fabric8.kubernetes.api.model.ProbeBuilder;
|
||||||
import io.fabric8.kubernetes.api.model.apps.Deployment;
|
import io.fabric8.kubernetes.api.model.apps.Deployment;
|
||||||
import io.quarkus.test.junit.QuarkusTest;
|
import io.quarkus.test.junit.QuarkusTest;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.keycloak.operator.v2alpha1.KeycloakDeployment;
|
import org.keycloak.operator.controllers.KeycloakDeployment;
|
||||||
import org.keycloak.operator.v2alpha1.crds.Keycloak;
|
import org.keycloak.operator.crds.v2alpha1.deployment.Keycloak;
|
||||||
import org.keycloak.operator.v2alpha1.crds.KeycloakSpec;
|
import org.keycloak.operator.crds.v2alpha1.deployment.KeycloakSpec;
|
||||||
import org.keycloak.operator.v2alpha1.crds.keycloakspec.Unsupported;
|
import org.keycloak.operator.crds.v2alpha1.deployment.KeycloakSpecUnsupported;
|
||||||
|
|
||||||
import java.net.URL;
|
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
@ -38,7 +36,7 @@ public class PodTemplateTest {
|
||||||
};
|
};
|
||||||
var kc = new Keycloak();
|
var kc = new Keycloak();
|
||||||
var spec = new KeycloakSpec();
|
var spec = new KeycloakSpec();
|
||||||
spec.setUnsupported(new Unsupported(podTemplate));
|
spec.setUnsupported(new KeycloakSpecUnsupported(podTemplate));
|
||||||
spec.setHostname("example.com");
|
spec.setHostname("example.com");
|
||||||
spec.setTlsSecret("example-tls-secret");
|
spec.setTlsSecret("example-tls-secret");
|
||||||
kc.setSpec(spec);
|
kc.setSpec(spec);
|
||||||
|
|
|
@ -9,9 +9,9 @@ import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
|
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
|
||||||
import org.keycloak.operator.utils.CRAssert;
|
import org.keycloak.operator.utils.CRAssert;
|
||||||
import org.keycloak.operator.v2alpha1.KeycloakService;
|
import org.keycloak.operator.controllers.KeycloakService;
|
||||||
import org.keycloak.operator.v2alpha1.crds.KeycloakRealmImport;
|
import org.keycloak.operator.crds.v2alpha1.realmimport.KeycloakRealmImport;
|
||||||
import org.keycloak.operator.v2alpha1.crds.keycloakspec.Unsupported;
|
import org.keycloak.operator.crds.v2alpha1.deployment.KeycloakSpecUnsupported;
|
||||||
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@ -22,9 +22,9 @@ import static org.keycloak.operator.Constants.KEYCLOAK_HTTPS_PORT;
|
||||||
import static org.keycloak.operator.utils.K8sUtils.deployKeycloak;
|
import static org.keycloak.operator.utils.K8sUtils.deployKeycloak;
|
||||||
import static org.keycloak.operator.utils.K8sUtils.getDefaultKeycloakDeployment;
|
import static org.keycloak.operator.utils.K8sUtils.getDefaultKeycloakDeployment;
|
||||||
import static org.keycloak.operator.utils.K8sUtils.inClusterCurl;
|
import static org.keycloak.operator.utils.K8sUtils.inClusterCurl;
|
||||||
import static org.keycloak.operator.v2alpha1.crds.KeycloakRealmImportStatusCondition.DONE;
|
import static org.keycloak.operator.crds.v2alpha1.realmimport.KeycloakRealmImportStatusCondition.DONE;
|
||||||
import static org.keycloak.operator.v2alpha1.crds.KeycloakRealmImportStatusCondition.HAS_ERRORS;
|
import static org.keycloak.operator.crds.v2alpha1.realmimport.KeycloakRealmImportStatusCondition.HAS_ERRORS;
|
||||||
import static org.keycloak.operator.v2alpha1.crds.KeycloakRealmImportStatusCondition.STARTED;
|
import static org.keycloak.operator.crds.v2alpha1.realmimport.KeycloakRealmImportStatusCondition.STARTED;
|
||||||
|
|
||||||
@QuarkusTest
|
@QuarkusTest
|
||||||
public class RealmImportE2EIT extends ClusterOperatorTest {
|
public class RealmImportE2EIT extends ClusterOperatorTest {
|
||||||
|
@ -67,7 +67,7 @@ public class RealmImportE2EIT extends ClusterOperatorTest {
|
||||||
.withImagePullSecrets(new LocalObjectReferenceBuilder().withName("my-empty-secret").build())
|
.withImagePullSecrets(new LocalObjectReferenceBuilder().withName("my-empty-secret").build())
|
||||||
.endSpec()
|
.endSpec()
|
||||||
.build();
|
.build();
|
||||||
kc.getSpec().setUnsupported(new Unsupported(podTemplate));
|
kc.getSpec().setUnsupported(new KeycloakSpecUnsupported(podTemplate));
|
||||||
deployKeycloak(k8sclient, kc, false);
|
deployKeycloak(k8sclient, kc, false);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
|
|
|
@ -24,10 +24,10 @@ import org.awaitility.Awaitility;
|
||||||
import org.bouncycastle.util.encoders.Base64;
|
import org.bouncycastle.util.encoders.Base64;
|
||||||
import org.junit.jupiter.api.AfterEach;
|
import org.junit.jupiter.api.AfterEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.keycloak.operator.v2alpha1.WatchedSecretsStore;
|
import org.keycloak.operator.controllers.WatchedSecretsStore;
|
||||||
import org.keycloak.operator.v2alpha1.crds.Keycloak;
|
import org.keycloak.operator.crds.v2alpha1.deployment.Keycloak;
|
||||||
import org.keycloak.operator.v2alpha1.crds.KeycloakStatusCondition;
|
import org.keycloak.operator.crds.v2alpha1.deployment.KeycloakStatusCondition;
|
||||||
import org.keycloak.operator.v2alpha1.crds.ValueOrSecret;
|
import org.keycloak.operator.crds.v2alpha1.deployment.ValueOrSecret;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -19,8 +19,8 @@ package org.keycloak.operator.utils;
|
||||||
|
|
||||||
import io.fabric8.kubernetes.client.utils.Serialization;
|
import io.fabric8.kubernetes.client.utils.Serialization;
|
||||||
import io.quarkus.logging.Log;
|
import io.quarkus.logging.Log;
|
||||||
import org.keycloak.operator.v2alpha1.crds.Keycloak;
|
import org.keycloak.operator.crds.v2alpha1.deployment.Keycloak;
|
||||||
import org.keycloak.operator.v2alpha1.crds.KeycloakRealmImport;
|
import org.keycloak.operator.crds.v2alpha1.realmimport.KeycloakRealmImport;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,8 @@ import io.fabric8.kubernetes.client.utils.KubernetesResourceUtil;
|
||||||
import io.fabric8.kubernetes.client.utils.Serialization;
|
import io.fabric8.kubernetes.client.utils.Serialization;
|
||||||
import io.quarkus.logging.Log;
|
import io.quarkus.logging.Log;
|
||||||
import org.awaitility.Awaitility;
|
import org.awaitility.Awaitility;
|
||||||
import org.keycloak.operator.v2alpha1.crds.Keycloak;
|
import org.keycloak.operator.crds.v2alpha1.deployment.Keycloak;
|
||||||
import org.keycloak.operator.v2alpha1.crds.KeycloakStatusCondition;
|
import org.keycloak.operator.crds.v2alpha1.deployment.KeycloakStatusCondition;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
Loading…
Reference in a new issue