From 947f91707ee7f04ff746622bc06f81f32fa81a78 Mon Sep 17 00:00:00 2001
From: OZGCloud <ozgcloud@mgm-tp.com>
Date: Wed, 14 Jun 2023 13:24:46 +0200
Subject: [PATCH] spring native hints

---
 ...perator.ozgcloud.de_kopkeycloakrealms.yaml | 44 +++++++++++++++++++
 pom.xml                                       | 12 ++---
 .../operator/SpringNativeConfiguration.java   |  7 +++
 3 files changed, 57 insertions(+), 6 deletions(-)
 create mode 100644 doc/crds/operator.ozgcloud.de_kopkeycloakrealms.yaml

diff --git a/doc/crds/operator.ozgcloud.de_kopkeycloakrealms.yaml b/doc/crds/operator.ozgcloud.de_kopkeycloakrealms.yaml
new file mode 100644
index 0000000..3b4169e
--- /dev/null
+++ b/doc/crds/operator.ozgcloud.de_kopkeycloakrealms.yaml
@@ -0,0 +1,44 @@
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+  name: kopkeycloakrealms.operator.ozgcloud.de
+spec:
+  group: operator.ozgcloud.de
+  names:
+    kind: KopKeycloakRealm
+    listKind: KopKeycloakRealmList
+    plural: kopkeycloakrealms
+    singular: kopkeycloakrealm
+  scope: Namespaced
+  versions:
+  - name: v1
+    schema:
+      openAPIV3Schema:
+        description: KopKeycloakRealm is the Schema for the keycloak realms API
+        properties:
+          apiVersion:
+            description: 'APIVersion defines the versioned schema of this representation
+              of an object. Servers should convert recognized schemas to the latest
+              internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+            type: string
+          kind:
+            description: 'Kind is a string value representing the REST resource this
+              object represents. Servers may infer this from the endpoint the client
+              submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+            type: string
+          metadata:
+            type: object
+          spec:
+            description: Spec defines the desired state of Keycloak
+            type: object
+            x-kubernetes-preserve-unknown-fields: true
+          status:
+            description: Status defines the observed state of Keycloak
+            type: object
+            x-kubernetes-preserve-unknown-fields: true
+        type: object
+    served: true
+    storage: true
+    subresources:
+      status: {}
diff --git a/pom.xml b/pom.xml
index 4562f73..f2f7309 100644
--- a/pom.xml
+++ b/pom.xml
@@ -45,12 +45,12 @@
 		    <version>0.10.2</version>
 		</dependency>
 
-		<dependency>
-		    <groupId>io.fabric8</groupId>
-		    <artifactId>crd-generator-apt</artifactId>
-		    <scope>provided</scope>
-		    <version>6.7.1</version>
-		</dependency>
+<!--		<dependency>-->
+<!--		    <groupId>io.fabric8</groupId>-->
+<!--		    <artifactId>crd-generator-apt</artifactId>-->
+<!--		    <scope>provided</scope>-->
+<!--		    <version>6.7.1</version>-->
+<!--		</dependency>-->
 
 
 		<dependency>
diff --git a/src/main/java/de/ozgcloud/operator/SpringNativeConfiguration.java b/src/main/java/de/ozgcloud/operator/SpringNativeConfiguration.java
index 15b597f..f9126e9 100644
--- a/src/main/java/de/ozgcloud/operator/SpringNativeConfiguration.java
+++ b/src/main/java/de/ozgcloud/operator/SpringNativeConfiguration.java
@@ -35,6 +35,13 @@ public class SpringNativeConfiguration {
 			combined.add(io.fabric8.kubernetes.client.impl.KubernetesClientImpl.class);
 			combined.add(io.javaoperatorsdk.operator.processing.retry.GenericRetry.class);
 			combined.add(io.javaoperatorsdk.operator.processing.event.rate.LinearRateLimiter.class);
+//			Class.forName("io.fabric8.kubernetes.client.okhttp.OkHttpClientBuilderImpl");
+//			reflections.getSubTypesOf(io.fabric8.kubernetes.client.okhttp.OkHttpClientBuilderImpl.class);
+			try {
+				combined.add(Class.forName("io.fabric8.kubernetes.client.okhttp.OkHttpClientBuilderImpl"));
+			} catch (ClassNotFoundException e) {
+				throw new RuntimeException(e);
+			}
 
 			combined
 					.stream()
-- 
GitLab