Skip to content

Commit 1691cf0

Browse files
authored
docs: remove ConfigurationServiceProvider obsolete usage (#2022)
1 parent 0c362d5 commit 1691cf0

File tree

3 files changed

+9
-19
lines changed

3 files changed

+9
-19
lines changed

docs/documentation/configuration.md

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ permalink: /docs/configuration
77

88
# Configuration options
99

10-
The Java Operator SDK (JOSDK for short) provides several abstractions that work great out of the
10+
The Java Operator SDK (JOSDK) provides several abstractions that work great out of the
1111
box. However, while we strive to cover the most common cases with the default behavior, we also
1212
recognize that that default behavior is not always what any given user might want for their
1313
operator. Numerous configuration options are therefore provided to help people tailor the
@@ -23,29 +23,20 @@ Configuration options act at several levels, depending on which behavior you wis
2323
## Operator-level configuration
2424

2525
Configuration that impacts the whole operator is performed via the `ConfigurationService` class.
26-
An instance is provided by the `ConfigurationServiceProvider.instance()` method. This is the
27-
normal way for user-code to retrieve the current `ConfigurationService` instance. Sensible
28-
defaults are provided but you can change the default behavior by overriding the current
29-
configuration using `ConfigurationServiceProvider.overrideCurrent` method, providing a
30-
`ConfigurationServiceOverrider` `Consumer` that will apply the modifications you wish to perform
31-
on the configuration.
26+
`ConfigurationService` is an abstract class, and the implementation can be different based
27+
on which flavor of the framework is used. For example Quarkus Operator SDK replaces the
28+
default implementation. Configurations are initialized with sensible defaults, but can
29+
be changed during initialization.
3230

3331
For instance, if you wish to not validate that the CRDs are present on your cluster when the
3432
operator starts and configure leader election, you would do something similar to:
3533

3634
```java
37-
ConfigurationServiceProvider.overrideCurrent(o -> o.checkingCRDAndValidateLocalModel(false)
35+
Operator operator = new Operator( override -> override
36+
.checkingCRDAndValidateLocalModel(false)
3837
.withLeaderElectionConfiguration(new LeaderElectionConfiguration("bar", "barNS")));
3938
```
4039

41-
Note that you can also obtain the same result by passing the `ConfigurationServiceOverrider`
42-
`Consumer` instance to the `Operator` constructor:
43-
44-
```java
45-
new Operator(o -> o.checkingCRDAndValidateLocalModel(false)
46-
.withLeaderElectionConfiguration(new LeaderElectionConfiguration("bar","barNS")));
47-
```
48-
4940
## Reconciler-level configuration
5041

5142
While reconcilers are typically configured using the `@ControllerConfiguration` annotation, it

docs/documentation/faq.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,9 @@ Furthermore, you may not be able to list CRDs at startup which is required when
7373
is `true` (`false` by default). To disable, set it to `false` at [Operator-level configuration](./configuration.md#operator-level-configuration):
7474

7575
```java
76-
ConfigurationServiceProvider.overrideCurrent(o -> o.checkingCRDAndValidateLocalModel(false));
76+
Operator operator = new Operator( override -> override.checkingCRDAndValidateLocalModel(false));
7777
```
7878

79-
8079
### Q: How to fix `sun.security.provider.certpath.SunCertPathBuilderException` on Rancher Desktop and k3d/k3s Kubernetes
8180

8281
It's a common issue when using k3d and the fabric8 client tries to connect to the cluster an exception is thrown:

docs/documentation/features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ follows:
769769

770770
```java
771771
Metrics metrics= …;
772-
ConfigurationServiceProvider.overrideCurrent(overrider->overrider.withMetrics(metrics));
772+
Operator operator = new Operator(client, o -> o.withMetrics());
773773
```
774774

775775
### Micrometer implementation

0 commit comments

Comments
 (0)