Skip to content

Commit 9c1c559

Browse files
committed
refactor: rename runtime-configuration to operator-framework
This is the module that should now be imported by non-Quarkus apps
1 parent 495ff39 commit 9c1c559

37 files changed

+56
-77
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/ResourceController.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public interface ResourceController<R extends CustomResource> {
1515
*
1616
* @param resource
1717
* @return true - so the finalizer is automatically removed after the call. false if you don't
18-
* want to remove the finalizer. Note that this is ALMOST NEVER the case.
18+
* want to remove the finalizer. Note that this is ALMOST NEVER the case.
1919
*/
2020
DeleteControl deleteResource(R resource, Context<R> context);
2121

@@ -25,10 +25,10 @@ public interface ResourceController<R extends CustomResource> {
2525
* parameter (not the custom resource that might be in the events)
2626
*
2727
* @return The resource is updated in api server if the return value is present within Optional.
28-
* This the common use cases. However in cases, for example the operator is restarted, and we
29-
* don't want to have an update call to k8s api to be made unnecessarily, by returning an empty
30-
* Optional this update can be skipped. <b>However we will always call an update if there is no
31-
* finalizer on object and its not marked for deletion.</b>
28+
* This the common use cases. However in cases, for example the operator is restarted, and we
29+
* don't want to have an update call to k8s api to be made unnecessarily, by returning an
30+
* empty Optional this update can be skipped. <b>However we will always call an update if
31+
* there is no finalizer on object and its not marked for deletion.</b>
3232
*/
3333
UpdateControl<R> createOrUpdateResource(R resource, Context<R> context);
3434

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/DefaultEventHandler.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,7 @@ private RetryExecution getOrInitRetryExecution(ExecutionScope executionScope) {
194194
* <p>Note that this is an improvement, not a bug fix. This situation can happen naturally, we
195195
* just make the execution more efficient, and avoid questions about conflicts.
196196
*
197-
* <p>Note that without the conditional locking in the cache, there is a very minor chance that
198-
* we
197+
* <p>Note that without the conditional locking in the cache, there is a very minor chance that we
199198
* would override an additional change coming from a different client.
200199
*/
201200
private void cacheUpdatedResourceIfChanged(

runtime-configuration/pom.xml renamed to operator-framework/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<parent>
66
<artifactId>java-operator-sdk</artifactId>
77
<groupId>io.javaoperatorsdk</groupId>
88
<version>1.5.1-SNAPSHOT</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

12-
<artifactId>runtime-configuration</artifactId>
13-
<name>Operator SDK - Runtime configuration support</name>
12+
<artifactId>operator-framework</artifactId>
13+
<name>Operator SDK - Framework - Plain Java</name>
1414

1515
<properties>
1616
<maven.compiler.source>11</maven.compiler.source>
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,16 @@ public AccumulativeMappingWriter loadExistingMappings() {
4747
return this;
4848
}
4949

50-
/** Add a new mapping */
50+
/**
51+
* Add a new mapping
52+
*/
5153
public AccumulativeMappingWriter add(String key, String value) {
5254
this.mappings.put(key, value);
5355
return this;
5456
}
5557

5658
/**
57-
* Generates or overrise the resource file with the given path
58-
* ({@linkAccumulativeMappingWriter#resourcePath})
59+
* Generates or overrise the resource file with the given path ({@linkAccumulativeMappingWriter#resourcePath})
5960
*/
6061
public void flush() {
6162
PrintWriter printWriter = null;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
public class AnnotationConfiguration<R extends CustomResource>
1212
implements ControllerConfiguration<R> {
13+
1314
private final ResourceController<R> controller;
1415
private final Controller annotation;
1516

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import org.slf4j.LoggerFactory;
1616

1717
class ClassMappingProvider {
18+
1819
private static final Logger log = LoggerFactory.getLogger(ClassMappingProvider.class);
1920

2021
static <T, V> Map<T, V> provide(final String resourcePath, T key, V value) {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.util.concurrent.ConcurrentHashMap;
99

1010
public class DefaultConfigurationService implements ConfigurationService {
11+
1112
private static final ConfigurationService instance = new DefaultConfigurationService();
1213
private final Map<String, ControllerConfiguration> configurations = new ConcurrentHashMap<>();
1314

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ static <R extends CustomResource> Class<R> getCustomResourceClass(
3838
}
3939

4040
public static <T extends CustomResource>
41-
Class<? extends CustomResourceDoneable<T>> getCustomResourceDoneableClass(
42-
ResourceController<T> controller) {
41+
Class<? extends CustomResourceDoneable<T>> getCustomResourceDoneableClass(
42+
ResourceController<T> controller) {
4343
final Class<T> customResourceClass = getCustomResourceClass(controller);
4444
final Class<? extends CustomResourceDoneable<T>> doneableClass =
4545
(Class<? extends CustomResourceDoneable<T>>)
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
import javax.lang.model.type.TypeVariable;
1616
import javax.lang.model.util.Types;
1717

18-
/** This class can resolve a type parameter in the given index to the actual type defined. */
18+
/**
19+
* This class can resolve a type parameter in the given index to the actual type defined.
20+
*/
1921
class TypeParameterResolver {
2022

2123
private final DeclaredType interestedClass;
@@ -28,12 +30,12 @@ public TypeParameterResolver(DeclaredType interestedClass, int interestedTypeArg
2830
}
2931

3032
/**
31-
* @param typeUtils Type utilities, During the annotation processing processingEnv.getTypeUtils()
32-
* can be passed.
33+
* @param typeUtils Type utilities, During the annotation processing processingEnv.getTypeUtils()
34+
* can be passed.
3335
* @param declaredType Class or Interface which extends or implements the interestedClass, and the
34-
* interest is getting the actual declared type is used.
36+
* interest is getting the actual declared type is used.
3537
* @return the type of the parameter if it can be resolved from the the given declareType,
36-
* otherwise it returns null
38+
* otherwise it returns null
3739
*/
3840
public TypeMirror resolve(Types typeUtils, DeclaredType declaredType) {
3941
final var chain = findChain(typeUtils, declaredType);
@@ -137,18 +139,18 @@ private List<DeclaredType> findChainOfInterfaces(Types typeUtils, DeclaredType p
137139
var matchingInterfaces =
138140
((TypeElement) parentInterface.asElement())
139141
.getInterfaces().stream()
140-
.filter(i -> typeUtils.isAssignable(i, interestedClass))
141-
.map(i -> (DeclaredType) i)
142-
.collect(Collectors.toList());
142+
.filter(i -> typeUtils.isAssignable(i, interestedClass))
143+
.map(i -> (DeclaredType) i)
144+
.collect(Collectors.toList());
143145
while (matchingInterfaces.size() > 0) {
144146
result.addAll(matchingInterfaces);
145147
final var lastFoundInterface = matchingInterfaces.get(matchingInterfaces.size() - 1);
146148
matchingInterfaces =
147149
((TypeElement) lastFoundInterface.asElement())
148150
.getInterfaces().stream()
149-
.filter(i -> typeUtils.isAssignable(i, interestedClass))
150-
.map(i -> (DeclaredType) i)
151-
.collect(Collectors.toList());
151+
.filter(i -> typeUtils.isAssignable(i, interestedClass))
152+
.map(i -> (DeclaredType) i)
153+
.collect(Collectors.toList());
152154
}
153155
return result;
154156
}

0 commit comments

Comments
 (0)