Skip to content

Commit 4c94c81

Browse files
committed
chore: renaming vars named k8sClient to kubernetsClient
1 parent abc689b commit 4c94c81

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

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

+7-7
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
@SuppressWarnings("rawtypes")
2323
public class Operator implements AutoCloseable {
2424
private static final Logger log = LoggerFactory.getLogger(Operator.class);
25-
private final KubernetesClient k8sClient;
25+
private final KubernetesClient kubernetesClient;
2626
private final ConfigurationService configurationService;
2727
private final ControllerManager controllers = new ControllerManager();
2828

29-
public Operator(KubernetesClient k8sClient, ConfigurationService configurationService) {
30-
this.k8sClient = k8sClient;
29+
public Operator(KubernetesClient kubernetesClient, ConfigurationService configurationService) {
30+
this.kubernetesClient = kubernetesClient;
3131
this.configurationService = configurationService;
3232
}
3333

@@ -37,7 +37,7 @@ public void installShutdownHook() {
3737
}
3838

3939
public KubernetesClient getKubernetesClient() {
40-
return k8sClient;
40+
return kubernetesClient;
4141
}
4242

4343
public ConfigurationService getConfigurationService() {
@@ -65,7 +65,7 @@ public void start() {
6565

6666
log.info("Client version: {}", Version.clientVersion());
6767
try {
68-
final var k8sVersion = k8sClient.getVersion();
68+
final var k8sVersion = kubernetesClient.getVersion();
6969
if (k8sVersion != null) {
7070
log.info("Server version: {}.{}", k8sVersion.getMajor(), k8sVersion.getMinor());
7171
}
@@ -93,7 +93,7 @@ public void close() {
9393
controllers.close();
9494

9595
ExecutorServiceManager.close();
96-
k8sClient.close();
96+
kubernetesClient.close();
9797
}
9898

9999
/**
@@ -138,7 +138,7 @@ public <R extends CustomResource> void register(
138138
configuration = existing;
139139
}
140140
final var configuredController =
141-
new ConfiguredController(controller, configuration, k8sClient);
141+
new ConfiguredController(controller, configuration, kubernetesClient);
142142
controllers.add(configuredController);
143143

144144
final var watchedNS =

Diff for: operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/ConfiguredController.java

+7-6
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ public class ConfiguredController<R extends CustomResource<?, ?>> implements Res
2626
Closeable {
2727
private final ResourceController<R> controller;
2828
private final ControllerConfiguration<R> configuration;
29-
private final KubernetesClient k8sClient;
29+
private final KubernetesClient kubernetesClient;
3030
private EventSourceManager eventSourceManager;
3131

3232
public ConfiguredController(ResourceController<R> controller,
3333
ControllerConfiguration<R> configuration,
34-
KubernetesClient k8sClient) {
34+
KubernetesClient kubernetesClient) {
3535
this.controller = controller;
3636
this.configuration = configuration;
37-
this.k8sClient = k8sClient;
37+
this.kubernetesClient = kubernetesClient;
3838
}
3939

4040
@Override
@@ -140,11 +140,11 @@ public ControllerConfiguration<R> getConfiguration() {
140140
}
141141

142142
public KubernetesClient getClient() {
143-
return k8sClient;
143+
return kubernetesClient;
144144
}
145145

146146
public MixedOperation<R, KubernetesResourceList<R>, Resource<R>> getCRClient() {
147-
return k8sClient.resources(configuration.getCustomResourceClass());
147+
return kubernetesClient.resources(configuration.getCustomResourceClass());
148148
}
149149

150150
/**
@@ -164,7 +164,8 @@ public void start() throws OperatorException {
164164
// check that the custom resource is known by the cluster if configured that way
165165
final CustomResourceDefinition crd; // todo: check proper CRD spec version based on config
166166
if (configuration.getConfigurationService().checkCRDAndValidateLocalModel()) {
167-
crd = k8sClient.apiextensions().v1().customResourceDefinitions().withName(crdName).get();
167+
crd =
168+
kubernetesClient.apiextensions().v1().customResourceDefinitions().withName(crdName).get();
168169
if (crd == null) {
169170
throwMissingCRDException(crdName, specVersion, controllerName);
170171
}

0 commit comments

Comments
 (0)