Skip to content

Commit 25256c7

Browse files
committed
fix!: remove registerController to use controller config instead
1 parent 25643e9 commit 25256c7

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/Operator.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,17 @@ public <R extends CustomResource> void register(ResourceController<R> controller
4444
registerController(controller, configuration.watchAllNamespaces(), retry, targetNamespaces);
4545
}
4646
}
47-
48-
public <R extends CustomResource> void registerController(
47+
48+
// currently only used by IntegrationTestSupport but this should also disappear as by default the
49+
// controllers should register into the current namespace the client is connected to which should
50+
// work as expected for tests, in particular if we want to start testing using random namespace
51+
// names
52+
<R extends CustomResource> void registerController(
4953
ResourceController<R> controller, Retry retry, String... targetNamespaces)
5054
throws OperatorException {
5155
registerController(controller, false, retry, targetNamespaces);
5256
}
5357

54-
public <R extends CustomResource> void registerController(
55-
ResourceController<R> controller, String... targetNamespaces) throws OperatorException {
56-
registerController(controller, false, null, targetNamespaces);
57-
}
58-
5958
@SuppressWarnings("rawtypes")
6059
private <R extends CustomResource> void registerController(
6160
ResourceController<R> controller,

samples/pure-java/src/main/java/io/javaoperatorsdk/operator/sample/PureJavaApplicationRunner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ public class PureJavaApplicationRunner {
1010
public static void main(String[] args) {
1111
KubernetesClient client = new DefaultKubernetesClient();
1212
Operator operator = new Operator(client, DefaultConfigurationService.instance());
13-
operator.registerController(new CustomServiceController(client));
13+
operator.register(new CustomServiceController(client));
1414
}
1515
}

0 commit comments

Comments
 (0)