Skip to content

Commit 3266dd2

Browse files
committed
docs: added javadoc for BooleanWithUndefined, improved useSSA doc
1 parent 3e665c9 commit 3266dd2

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package io.javaoperatorsdk.operator.processing.dependent.kubernetes;
22

3+
/**
4+
* A replacement for {@link Boolean}, which can't be used in annotations.
5+
*/
36
public enum BooleanWithUndefined {
47
TRUE, FALSE, UNDEFINED
58
}

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/KubernetesDependent.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* namespace is specified then the controller will monitor the namespaces configured for the
2626
* controller.
2727
*
28-
* @return the list of namespaces this controller monitors
28+
* @return the array of namespaces this controller monitors
2929
*/
3030
String[] namespaces() default {Constants.SAME_AS_CONTROLLER};
3131

@@ -78,7 +78,14 @@
7878
boolean createResourceOnlyIfNotExistingWithSSA() default KubernetesDependentResourceConfig.DEFAULT_CREATE_RESOURCE_ONLY_IF_NOT_EXISTING_WITH_SSA;
7979

8080
/**
81-
* In case of UNDEFINED inherits global configuration.
81+
* Determines whether to use SSA (Server-Side Apply) for this dependent. If SSA is used, the
82+
* dependent resource will only be created if it did not exist before. Default value is
83+
* {@link BooleanWithUndefined#UNDEFINED}, which specifies that the behavior with respect to SSA
84+
* is inherited from the global configuration.
85+
*
86+
* @return {@code true} if SSA is enabled, {@code false} if SSA is disabled,
87+
* {@link BooleanWithUndefined#UNDEFINED} if the SSA behavior should be inherited from the
88+
* global configuration
8289
*/
8390
BooleanWithUndefined useSSA() default BooleanWithUndefined.UNDEFINED;
8491
}

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/KubernetesDependentResource.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,7 @@ protected void addMetadata(boolean forMatch, R actualResource, final R target, P
190190
}
191191

192192
private boolean useSSA(Context<P> context) {
193-
Optional<Boolean> useSSAConfig =
194-
configuration().flatMap(KubernetesDependentResourceConfig::useSSA);
193+
Optional<Boolean> useSSAConfig = configuration().flatMap(KubernetesDependentResourceConfig::useSSA);
195194
return useSSAConfig.orElse(context.getControllerConfiguration().getConfigurationService()
196195
.ssaBasedCreateUpdateMatchForDependentResources());
197196
}

0 commit comments

Comments
 (0)