@@ -7,7 +7,7 @@ permalink: /docs/configuration
7
7
8
8
# Configuration options
9
9
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
11
11
box. However, while we strive to cover the most common cases with the default behavior, we also
12
12
recognize that that default behavior is not always what any given user might want for their
13
13
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
23
23
## Operator-level configuration
24
24
25
25
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.
32
30
33
31
For instance, if you wish to not validate that the CRDs are present on your cluster when the
34
32
operator starts and configure leader election, you would do something similar to:
35
33
36
34
``` java
37
- ConfigurationServiceProvider . overrideCurrent(o - > o. checkingCRDAndValidateLocalModel(false )
35
+ Operator operator = new Operator ( override - > override
36
+ .checkingCRDAndValidateLocalModel(false )
38
37
.withLeaderElectionConfiguration(new LeaderElectionConfiguration (" bar" , " barNS" )));
39
38
```
40
39
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
-
49
40
## Reconciler-level configuration
50
41
51
42
While reconcilers are typically configured using the ` @ControllerConfiguration ` annotation, it
0 commit comments