Skip to content

Commit 02ac7a6

Browse files
committed
docs: add migration information on how to use a different http client
[skip ci]
1 parent d259fcd commit 02ac7a6

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

docs/documentation/v4-3-migration.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ permalink: /docs/v4-3-migration
99

1010
## Condition API Change
1111

12-
In Workflows the target of the condition was the managed resource itself, not the target dependent resource.
12+
In Workflows the target of the condition was the managed resource itself, not the target dependent resource.
1313
This changed, now the API contains the dependent resource.
1414

1515
New API:
1616

1717
```java
1818
public interface Condition<R, P extends HasMetadata> {
19-
20-
boolean isMet(DependentResource<R, P> dependentResource, P primary, Context<P> context);
21-
19+
20+
boolean isMet(DependentResource<R, P> dependentResource, P primary, Context<P> context);
21+
2222
}
2323
```
2424

@@ -27,10 +27,24 @@ Former API:
2727
```java
2828
public interface Condition<R, P extends HasMetadata> {
2929

30-
boolean isMet(P primary, R secondary, Context<P> context);
31-
30+
boolean isMet(P primary, R secondary, Context<P> context);
31+
3232
}
3333
```
3434

35-
Migration is trivial. Since the secondary resource can be accessed from the dependent resource. So to access the secondary
35+
Migration is trivial. Since the secondary resource can be accessed from the dependent resource. So to access the
36+
secondary
3637
resource just use `dependentResource.getSecondaryResource(primary,context)`.
38+
39+
## HTTP client choice
40+
41+
It is now possible to change the HTTP client used by the Fabric8 client to communicate with the Kubernetes API server.
42+
By default, the SDK uses the historical default HTTP client which relies on Okhttp and there shouldn't be anything
43+
needed to keep using this implementation. The `tomcat-operator` sample has been migrated to use the Vert.X based
44+
implementation. You can see how to change the client by looking at
45+
that [sample POM file](https://github.com/java-operator-sdk/java-operator-sdk/blob/d259fcd084f7e22032dfd0df3c7e64fe68850c1b/sample-operators/tomcat-operator/pom.xml#L37-L50):
46+
47+
- You need to exclude the default implementation (in this case okhttp) from the `operator-framework` dependency
48+
- You need to add the appropriate implementation dependency, `kubernetes-httpclient-vertx` in this case, HTTP client
49+
implementations provided as part of the Fabric8 client all following the `kubernetes-httpclient-<implementation name>`
50+
pattern for their artifact identifier.

0 commit comments

Comments
 (0)