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 2929import org .apache .commons .lang3 .builder .HashCodeBuilder ;
3030import org .apache .commons .lang3 .builder .ToStringBuilder ;
3131
32+ import static oracle .kubernetes .operator .KubernetesConstants .DEFAULT_ALLOW_REPLICAS_BELOW_MIN_DYN_CLUSTER_SIZE ;
33+
3234/** DomainSpec is a description of a domain. */
3335@ Description ("DomainSpec is a description of a domain." )
3436public class DomainSpec extends BaseConfiguration {
@@ -843,7 +845,8 @@ private boolean hasMaxUnavailable(Cluster cluster) {
843845 }
844846
845847 private boolean isAllowReplicasBelowDynClusterSizeFor (Cluster cluster ) {
846- return cluster .isAllowReplicasBelowMinDynClusterSize ();
848+ return cluster == null ? DEFAULT_ALLOW_REPLICAS_BELOW_MIN_DYN_CLUSTER_SIZE :
849+ cluster .isAllowReplicasBelowMinDynClusterSize ();
847850 }
848851
849852 public AdminServer getAdminServer () {
Original file line number Diff line number Diff line change @@ -334,6 +334,12 @@ public void whenNotSpecified_allowReplicasBelowMinDynamicClusterSizeHasDefault()
334334 equalTo (DEFAULT_ALLOW_REPLICAS_BELOW_MIN_DYN_CLUSTER_SIZE ));
335335 }
336336
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+
337343 @ Test
338344 public void whenBothClusterAndServerStateSpecified_managedServerUsesServerState () {
339345 configureServer (SERVER1 ).withDesiredState ("STAND-BY" );
You can’t perform that action at this time.
0 commit comments