dependentResource, P primary, Context context);
-
+
+ boolean isMet(DependentResource dependentResource, P primary, Context context);
+
}
```
@@ -27,10 +27,24 @@ Former API:
```java
public interface Condition {
- boolean isMet(P primary, R secondary, Context context);
-
+ boolean isMet(P primary, R secondary, Context
context);
+
}
```
-Migration is trivial. Since the secondary resource can be accessed from the dependent resource. So to access the secondary
+Migration is trivial. Since the secondary resource can be accessed from the dependent resource. So to access the
+secondary
resource just use `dependentResource.getSecondaryResource(primary,context)`.
+
+## HTTP client choice
+
+It is now possible to change the HTTP client used by the Fabric8 client to communicate with the Kubernetes API server.
+By default, the SDK uses the historical default HTTP client which relies on Okhttp and there shouldn't be anything
+needed to keep using this implementation. The `tomcat-operator` sample has been migrated to use the Vert.X based
+implementation. You can see how to change the client by looking at
+that [sample POM file](https://github.com/java-operator-sdk/java-operator-sdk/blob/d259fcd084f7e22032dfd0df3c7e64fe68850c1b/sample-operators/tomcat-operator/pom.xml#L37-L50):
+
+- You need to exclude the default implementation (in this case okhttp) from the `operator-framework` dependency
+- You need to add the appropriate implementation dependency, `kubernetes-httpclient-vertx` in this case, HTTP client
+ implementations provided as part of the Fabric8 client all following the `kubernetes-httpclient-`
+ pattern for their artifact identifier.
\ No newline at end of file
diff --git a/operator-framework-core/pom.xml b/operator-framework-core/pom.xml
index 7c6e42da69..4d09220023 100644
--- a/operator-framework-core/pom.xml
+++ b/operator-framework-core/pom.xml
@@ -68,6 +68,12 @@
io.fabric8
kubernetes-client
+
+
+ io.fabric8
+ kubernetes-httpclient-okhttp
+
+
org.slf4j
diff --git a/operator-framework/pom.xml b/operator-framework/pom.xml
index 8911516d8d..bb9e19b9ed 100644
--- a/operator-framework/pom.xml
+++ b/operator-framework/pom.xml
@@ -17,7 +17,10 @@
io.javaoperatorsdk
operator-framework-core
-
+
+ io.fabric8
+ kubernetes-httpclient-okhttp
+
org.apache.commons
commons-lang3
diff --git a/pom.xml b/pom.xml
index b3fc536ac4..cc5e8c28e2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -110,7 +110,7 @@
io.fabric8
- kubernetes-client
+ kubernetes-client-api
${fabric8-client.version}
@@ -200,6 +200,28 @@
caffeine
${caffeine.version}
+
+
+ io.fabric8
+ kubernetes-httpclient-okhttp
+ ${fabric8-client.version}
+
+
+ io.fabric8
+ kubernetes-httpclient-vertx
+ ${fabric8-client.version}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sample-operators/tomcat-operator/pom.xml b/sample-operators/tomcat-operator/pom.xml
index 6a38e2d93b..9ce4dd8e1b 100644
--- a/sample-operators/tomcat-operator/pom.xml
+++ b/sample-operators/tomcat-operator/pom.xml
@@ -37,6 +37,16 @@
io.javaoperatorsdk
operator-framework
+
+
+ io.fabric8
+ kubernetes-httpclient-okhttp
+
+
+
+
+ io.fabric8
+ kubernetes-httpclient-vertx
io.fabric8