File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
main/java/oracle/kubernetes/weblogic/domain/model
test/java/oracle/kubernetes/weblogic/domain Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 29
29
import org .apache .commons .lang3 .builder .HashCodeBuilder ;
30
30
import org .apache .commons .lang3 .builder .ToStringBuilder ;
31
31
32
+ import static oracle .kubernetes .operator .KubernetesConstants .DEFAULT_ALLOW_REPLICAS_BELOW_MIN_DYN_CLUSTER_SIZE ;
33
+
32
34
/** DomainSpec is a description of a domain. */
33
35
@ Description ("DomainSpec is a description of a domain." )
34
36
public class DomainSpec extends BaseConfiguration {
@@ -843,7 +845,8 @@ private boolean hasMaxUnavailable(Cluster cluster) {
843
845
}
844
846
845
847
private boolean isAllowReplicasBelowDynClusterSizeFor (Cluster cluster ) {
846
- return cluster .isAllowReplicasBelowMinDynClusterSize ();
848
+ return cluster == null ? DEFAULT_ALLOW_REPLICAS_BELOW_MIN_DYN_CLUSTER_SIZE :
849
+ cluster .isAllowReplicasBelowMinDynClusterSize ();
847
850
}
848
851
849
852
public AdminServer getAdminServer () {
Original file line number Diff line number Diff line change @@ -334,6 +334,12 @@ public void whenNotSpecified_allowReplicasBelowMinDynamicClusterSizeHasDefault()
334
334
equalTo (DEFAULT_ALLOW_REPLICAS_BELOW_MIN_DYN_CLUSTER_SIZE ));
335
335
}
336
336
337
+ @ Test
338
+ public void whenNoClusterSpec_allowReplicasBelowMinDynamicClusterSizeHasDefault () {
339
+ assertThat (domain .isAllowReplicasBelowMinDynClusterSize ("cluster-with-no-spec" ),
340
+ equalTo (DEFAULT_ALLOW_REPLICAS_BELOW_MIN_DYN_CLUSTER_SIZE ));
341
+ }
342
+
337
343
@ Test
338
344
public void whenBothClusterAndServerStateSpecified_managedServerUsesServerState () {
339
345
configureServer (SERVER1 ).withDesiredState ("STAND-BY" );
You can’t perform that action at this time.
0 commit comments