Skip to content

Commit d0032bc

Browse files
committed
set client to watch all namespaces
1 parent b262dd5 commit d0032bc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

samples/nginx-www/src/main/java/com/github/containersolutions/operator/sample/WebServerOperator.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package com.github.containersolutions.operator.sample;
22

33
import com.github.containersolutions.operator.Operator;
4+
import io.fabric8.kubernetes.client.Config;
5+
import io.fabric8.kubernetes.client.ConfigBuilder;
46
import io.fabric8.kubernetes.client.DefaultKubernetesClient;
57
import org.slf4j.Logger;
68
import org.slf4j.LoggerFactory;
@@ -18,7 +20,8 @@ public class WebServerOperator {
1820
public static void main(String[] args) throws IOException {
1921
log.info("WebServer Operator starting");
2022

21-
Operator operator = new Operator(new DefaultKubernetesClient());
23+
Config config = new ConfigBuilder().withNamespace(null).build();
24+
Operator operator = new Operator(new DefaultKubernetesClient(config));
2225
operator.registerControllerForAllNamespaces(new WebServerController());
2326

2427
new FtBasic(

0 commit comments

Comments
 (0)