Skip to content

Commit c7cf1f7

Browse files
authored
Added test for WKO: Add 'domain.spec.maxClusterUnavailable' (as default for 4.0 'cluster.spec.maxUnavailable') (#3780)
* Added test for WKO: Add 'domain.spec.maxClusterUnavailable' (as default for 4.0 'cluster.spec.maxUnavailable')
1 parent 943a8e1 commit c7cf1f7

File tree

3 files changed

+892
-8
lines changed

3 files changed

+892
-8
lines changed

integration-tests/src/test/java/oracle/weblogic/domain/DomainSpec.java

Lines changed: 81 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020, 2022, Oracle and/or its affiliates.
1+
// Copyright (c) 2020, 2023, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package oracle.weblogic.domain;
@@ -116,6 +116,23 @@ public class DomainSpec {
116116
@ApiModelProperty("Models and overrides affecting the WebLogic domain configuration.")
117117
private Configuration configuration;
118118

119+
@ApiModelProperty("The maximum number of cluster members that can be temporarily unavailable."
120+
+ " You can override this default on a per cluster basis by setting the"
121+
+ " cluster's `maxUnavailable` field. Defaults to 1.")
122+
private Integer maxClusterUnavailable;
123+
124+
@ApiModelProperty("The maximum number of cluster member Managed Server instances that the"
125+
+ " operator will start in parallel for a given cluster, if `maxConcurrentStartup` "
126+
+ " is not specified for a specific cluster under the `clusters` field. "
127+
+ " A value of 0 means there is no configured limit. Defaults to 0.")
128+
private Integer maxClusterConcurrentStartup;
129+
130+
@ApiModelProperty("The default maximum number of WebLogic Server instances that a cluster will"
131+
+ " shut down in parallel when it is being partially shut down by lowering its replica count."
132+
+ " You can override this default on a per cluster basis by setting the cluster's `maxConcurrentShutdown` field."
133+
+ " A value of 0 means there is no limit. Defaults to 1.")
134+
private Integer maxClusterConcurrentShutdown;
135+
119136
/**
120137
* The Fluentd configuration.
121138
*
@@ -187,9 +204,6 @@ public void setFluentdImagePullPolicy(String pullPolicy) {
187204
fluentdSpecification.setImagePullPolicy(pullPolicy);
188205
}
189206

190-
191-
192-
193207
@ApiModelProperty("Configuration for the Administration Server.")
194208
private AdminServer adminServer;
195209

@@ -492,6 +506,57 @@ public void setReplicas(Integer replicas) {
492506
this.replicas = replicas;
493507
}
494508

509+
public DomainSpec maxClusterUnavailable(Integer maxClusterUnavailable) {
510+
this.maxClusterUnavailable = maxClusterUnavailable;
511+
return this;
512+
}
513+
514+
public Integer maxClusterUnavailable() {
515+
return this.maxClusterUnavailable;
516+
}
517+
518+
public Integer getMaxClusterUnavailable() {
519+
return maxClusterUnavailable;
520+
}
521+
522+
public void setMaxClusterUnavailable(Integer maxClusterUnavailable) {
523+
this.maxClusterUnavailable = maxClusterUnavailable;
524+
}
525+
526+
public DomainSpec maxClusterConcurrentStartup(Integer maxClusterConcurrentStartup) {
527+
this.maxClusterConcurrentStartup = maxClusterConcurrentStartup;
528+
return this;
529+
}
530+
531+
public Integer maxClusterConcurrentStartup() {
532+
return this.maxClusterConcurrentStartup;
533+
}
534+
535+
public Integer getMaxClusterConcurrentStartup() {
536+
return maxClusterConcurrentStartup;
537+
}
538+
539+
public void setMaxClusterConcurrentStartup(Integer maxClusterConcurrentStartup) {
540+
this.maxClusterConcurrentStartup = maxClusterConcurrentStartup;
541+
}
542+
543+
public DomainSpec maxClusterConcurrentShutdown(Integer maxClusterConcurrentShutdown) {
544+
this.maxClusterConcurrentShutdown = maxClusterConcurrentShutdown;
545+
return this;
546+
}
547+
548+
public Integer maxClusterConcurrentShutdown() {
549+
return this.maxClusterConcurrentShutdown;
550+
}
551+
552+
public Integer getMaxClusterConcurrentShutdown() {
553+
return maxClusterConcurrentShutdown;
554+
}
555+
556+
public void setMaxClusterConcurrentShutdown(Integer maxClusterConcurrentShutdown) {
557+
this.maxClusterConcurrentShutdown = maxClusterConcurrentShutdown;
558+
}
559+
495560
public DomainSpec domainHomeSourceType(String domainHomeSourceType) {
496561
this.domainHomeSourceType = domainHomeSourceType;
497562
return this;
@@ -743,7 +808,10 @@ public String toString() {
743808
.append("serverService", serverService)
744809
.append("restartVersion", restartVersion)
745810
.append("monitoringExporter", monitoringExporter)
746-
.append("fluentdSpecification", fluentdSpecification);
811+
.append("fluentdSpecification", fluentdSpecification)
812+
.append("maxClusterUnavailable", maxClusterUnavailable)
813+
.append("maxClusterConcurrentStartup", maxClusterConcurrentStartup)
814+
.append("maxClusterConcurrentShutdown", maxClusterConcurrentShutdown);
747815

748816
return builder.toString();
749817
}
@@ -778,7 +846,10 @@ public int hashCode() {
778846
.append(serverService)
779847
.append(restartVersion)
780848
.append(monitoringExporter)
781-
.append(fluentdSpecification);
849+
.append(fluentdSpecification)
850+
.append(maxClusterUnavailable)
851+
.append(maxClusterConcurrentStartup)
852+
.append(maxClusterConcurrentShutdown);
782853

783854
return builder.toHashCode();
784855
}
@@ -821,7 +892,10 @@ public boolean equals(Object other) {
821892
.append(serverService, rhs.serverService)
822893
.append(restartVersion, rhs.restartVersion)
823894
.append(monitoringExporter, rhs.monitoringExporter)
824-
.append(fluentdSpecification, rhs.fluentdSpecification);
895+
.append(fluentdSpecification, rhs.fluentdSpecification)
896+
.append(maxClusterUnavailable, rhs.maxClusterUnavailable)
897+
.append(maxClusterConcurrentStartup, rhs.maxClusterConcurrentStartup)
898+
.append(maxClusterConcurrentShutdown, rhs.maxClusterConcurrentShutdown);
825899
return builder.isEquals();
826900
}
827901
}

0 commit comments

Comments
 (0)