File tree 8 files changed +9
-23
lines changed
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api
operator-framework-quarkus-extension/runtime/src/main/java/io/javaoperatorsdk/quarkus/extension
mysql-schema/src/main/java/io/javaoperatorsdk/operator/sample
tomcat/src/main/java/io/javaoperatorsdk/operator/sample
webserver/src/main/java/io/javaoperatorsdk/operator/sample
8 files changed +9
-23
lines changed Original file line number Diff line number Diff line change 28
28
29
29
/**
30
30
* Specified which namespaces this Controller monitors for custom resources events. If no
31
- * namespace is specified then the controller will monitor the namespace it is deployed in (or the
32
- * namespace to which the Kubernetes client is connected to). To specify that the controller needs
33
- * to monitor all namespaces, add {@link
34
- * io.javaoperatorsdk.operator.api.config.ControllerConfiguration#WATCH_ALL_NAMESPACES_MARKER} to
35
- * this field.
31
+ * namespace is specified then the controller will monitor all namespaces by default.
36
32
*
37
33
* @return the list of namespaces this controller monitors
38
34
*/
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ public AbstractControllerConfiguration(
31
31
this .generationAware = generationAware ;
32
32
this .namespaces =
33
33
namespaces != null ? Collections .unmodifiableSet (namespaces ) : Collections .emptySet ();
34
- this .watchAllNamespaces = this .namespaces .contains ( WATCH_ALL_NAMESPACES_MARKER );
34
+ this .watchAllNamespaces = this .namespaces .isEmpty ( );
35
35
this .retryConfiguration =
36
36
retryConfiguration == null
37
37
? ControllerConfiguration .super .getRetryConfiguration ()
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ default Set<String> getNamespaces() {
25
25
}
26
26
27
27
default boolean watchAllNamespaces () {
28
- return getNamespaces ().contains ( WATCH_ALL_NAMESPACES_MARKER );
28
+ return getNamespaces ().isEmpty ( );
29
29
}
30
30
31
31
default RetryConfiguration getRetryConfiguration () {
Original file line number Diff line number Diff line change 1
1
package io .javaoperatorsdk .quarkus .extension ;
2
2
3
- import io .javaoperatorsdk .operator .api .config .ControllerConfiguration ;
4
3
import io .quarkus .runtime .annotations .ConfigGroup ;
5
4
import io .quarkus .runtime .annotations .ConfigItem ;
6
5
import java .util .List ;
10
9
public class ExternalControllerConfiguration {
11
10
12
11
/**
13
- * An optional list of comma-separated namespace names the controller should watch. If the list
14
- * contains {@link ControllerConfiguration#WATCH_ALL_NAMESPACES_MARKER} then the controller will
15
- * watch all namespaces.
12
+ * An optional list of comma-separated namespace names the controller should watch. If this
13
+ * property is left empty then the controller will watch all namespaces.
16
14
*/
17
15
@ ConfigItem public Optional <List <String >> namespaces ;
18
16
Original file line number Diff line number Diff line change 6
6
import io .fabric8 .kubernetes .api .model .SecretBuilder ;
7
7
import io .fabric8 .kubernetes .client .KubernetesClient ;
8
8
import io .javaoperatorsdk .operator .api .Context ;
9
- import io .javaoperatorsdk .operator .api .Controller ;
10
9
import io .javaoperatorsdk .operator .api .DeleteControl ;
11
10
import io .javaoperatorsdk .operator .api .ResourceController ;
12
11
import io .javaoperatorsdk .operator .api .UpdateControl ;
13
- import io .javaoperatorsdk .operator .api .config .ControllerConfiguration ;
14
12
import java .sql .Connection ;
15
13
import java .sql .DriverManager ;
16
14
import java .sql .PreparedStatement ;
22
20
import org .slf4j .Logger ;
23
21
import org .slf4j .LoggerFactory ;
24
22
25
- @ Controller (namespaces = ControllerConfiguration .WATCH_ALL_NAMESPACES_MARKER )
26
23
public class SchemaController implements ResourceController <Schema > {
27
24
static final String USERNAME_FORMAT = "%s-user" ;
28
25
static final String SECRET_FORMAT = "%s-secret" ;
Original file line number Diff line number Diff line change 10
10
import io .fabric8 .kubernetes .client .dsl .ServiceResource ;
11
11
import io .fabric8 .kubernetes .client .utils .Serialization ;
12
12
import io .javaoperatorsdk .operator .api .Context ;
13
- import io .javaoperatorsdk .operator .api .Controller ;
14
13
import io .javaoperatorsdk .operator .api .DeleteControl ;
15
14
import io .javaoperatorsdk .operator .api .ResourceController ;
16
15
import io .javaoperatorsdk .operator .api .UpdateControl ;
17
- import io .javaoperatorsdk .operator .api .config .ControllerConfiguration ;
18
16
import io .javaoperatorsdk .operator .processing .event .EventSourceManager ;
19
17
import io .javaoperatorsdk .operator .processing .event .internal .CustomResourceEvent ;
20
18
import java .io .IOException ;
25
23
import org .slf4j .Logger ;
26
24
import org .slf4j .LoggerFactory ;
27
25
28
- @ Controller (namespaces = ControllerConfiguration .WATCH_ALL_NAMESPACES_MARKER )
29
26
public class TomcatController implements ResourceController <Tomcat > {
30
27
31
28
private final Logger log = LoggerFactory .getLogger (getClass ());
Original file line number Diff line number Diff line change 3
3
import io .fabric8 .kubernetes .api .model .Pod ;
4
4
import io .fabric8 .kubernetes .api .model .apps .Deployment ;
5
5
import io .fabric8 .kubernetes .client .KubernetesClient ;
6
- import io .javaoperatorsdk .operator .api .*;
7
- import io .javaoperatorsdk .operator .api .config .ControllerConfiguration ;
6
+ import io .javaoperatorsdk .operator .api .Context ;
7
+ import io .javaoperatorsdk .operator .api .DeleteControl ;
8
+ import io .javaoperatorsdk .operator .api .ResourceController ;
9
+ import io .javaoperatorsdk .operator .api .UpdateControl ;
8
10
import java .io .ByteArrayOutputStream ;
9
11
import java .util .List ;
10
12
import java .util .Objects ;
13
15
import org .slf4j .Logger ;
14
16
import org .slf4j .LoggerFactory ;
15
17
16
- @ Controller (namespaces = ControllerConfiguration .WATCH_ALL_NAMESPACES_MARKER )
17
18
public class WebappController implements ResourceController <Webapp > {
18
19
19
20
private KubernetesClient kubernetesClient ;
Original file line number Diff line number Diff line change 12
12
import io .fabric8 .kubernetes .client .dsl .ServiceResource ;
13
13
import io .fabric8 .kubernetes .client .utils .Serialization ;
14
14
import io .javaoperatorsdk .operator .api .Context ;
15
- import io .javaoperatorsdk .operator .api .Controller ;
16
15
import io .javaoperatorsdk .operator .api .DeleteControl ;
17
16
import io .javaoperatorsdk .operator .api .ResourceController ;
18
17
import io .javaoperatorsdk .operator .api .UpdateControl ;
19
- import io .javaoperatorsdk .operator .api .config .ControllerConfiguration ;
20
18
import java .io .IOException ;
21
19
import java .io .InputStream ;
22
20
import java .util .HashMap ;
25
23
import org .slf4j .Logger ;
26
24
import org .slf4j .LoggerFactory ;
27
25
28
- @ Controller (namespaces = ControllerConfiguration .WATCH_ALL_NAMESPACES_MARKER )
29
26
public class WebServerController implements ResourceController <WebServer > {
30
27
31
28
private final Logger log = LoggerFactory .getLogger (getClass ());
You can’t perform that action at this time.
0 commit comments