Skip to content

Commit 88cf8d2

Browse files
committed
Work in progress
1 parent 0d95c20 commit 88cf8d2

File tree

5 files changed

+80
-18
lines changed

5 files changed

+80
-18
lines changed

model/src/main/java/oracle/kubernetes/weblogic/domain/model/DomainCondition.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,27 @@ public class DomainCondition implements Comparable<DomainCondition> {
2323
+ "Available, and Failed. Required.")
2424
@NotNull
2525
private final DomainConditionType type;
26+
2627
@Description("Last time we probed the condition.")
2728
@SerializedName("lastProbeTime")
2829
@Expose
2930
private DateTime lastProbeTime;
31+
3032
@Description("Last time the condition transitioned from one status to another.")
3133
@SerializedName("lastTransitionTime")
3234
@Expose
3335
private DateTime lastTransitionTime;
36+
3437
@Description("Human-readable message indicating details about last transition.")
3538
@SerializedName("message")
3639
@Expose
3740
private String message;
41+
3842
@Description("Unique, one-word, CamelCase reason for the condition's last transition.")
3943
@SerializedName("reason")
4044
@Expose
4145
private String reason;
46+
4247
@Description("Status is the status of the condition. Can be True, False, Unknown. Required.")
4348
@SerializedName("status")
4449
@Expose

model/src/main/java/oracle/kubernetes/weblogic/domain/model/DomainSpec.java

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,14 @@
3333
@Description("DomainSpec is a description of a domain.")
3434
public class DomainSpec extends BaseConfiguration {
3535

36-
/**
37-
* The configured clusters.
38-
*
39-
* @since 2.0
40-
*/
41-
@Description("Configuration for the clusters.")
42-
protected List<Cluster> clusters = new ArrayList<>();
4336
/** Domain unique identifier. Must be unique across the Kubernetes cluster. */
4437
@Description(
4538
"Domain unique identifier. Must be unique across the Kubernetes cluster. Not required."
4639
+ " Defaults to the value of metadata.name.")
4740
@Pattern("^[a-z0-9-.]{1,253}$")
4841
@SerializedName("domainUID")
4942
private String domainUid;
43+
5044
/**
5145
* Domain home.
5246
*
@@ -57,6 +51,7 @@ public class DomainSpec extends BaseConfiguration {
5751
+ " Defaults to /shared/domains/domains/domainUID if domainHomeInImage is false."
5852
+ " Defaults to /u01/oracle/user_projects/domains/ if domainHomeInImage is true.")
5953
private String domainHome;
54+
6055
/**
6156
* Tells the operator whether the customer wants the server to be running. For non-clustered
6257
* servers - the operator will start it if the policy isn't NEVER. For clustered servers - the
@@ -70,6 +65,7 @@ public class DomainSpec extends BaseConfiguration {
7065
"The strategy for deciding whether to start a server. "
7166
+ "Legal values are ADMIN_ONLY, NEVER, or IF_NEEDED.")
7267
private String serverStartPolicy;
68+
7369
/**
7470
* Reference to secret containing WebLogic startup credentials username and password. Secret must
7571
* contain keys names 'username' and 'password'. Required.
@@ -81,6 +77,7 @@ public class DomainSpec extends BaseConfiguration {
8177
@Valid
8278
@NotNull
8379
private V1SecretReference webLogicCredentialsSecret;
80+
8481
/**
8582
* The in-pod name of the directory to store the domain, node manager, server logs, and server
8683
* .out files in.
@@ -89,6 +86,7 @@ public class DomainSpec extends BaseConfiguration {
8986
"The in-pod name of the directory in which to store the domain, node manager, server logs, "
9087
+ "and server *.out files")
9188
private String logHome;
89+
9290
/**
9391
* Whether the log home is enabled.
9492
*
@@ -99,9 +97,11 @@ public class DomainSpec extends BaseConfiguration {
9997
+ "Defaults to true if domainHomeInImage is false. "
10098
+ "Defaults to false if domainHomeInImage is true. ")
10199
private Boolean logHomeEnabled; // Boolean object, null if unspecified
100+
102101
/** Whether to include the server .out file to the pod's stdout. Default is true. */
103102
@Description("If true (the default), the server .out file will be included in the pod's stdout.")
104103
private Boolean includeServerOutInPodLog;
104+
105105
/**
106106
* The WebLogic Docker image.
107107
*
@@ -111,6 +111,7 @@ public class DomainSpec extends BaseConfiguration {
111111
"The WebLogic Docker image; required when domainHomeInImage is true; "
112112
+ "otherwise, defaults to container-registry.oracle.com/middleware/weblogic:12.2.1.3.")
113113
private String image;
114+
114115
/**
115116
* The image pull policy for the WebLogic Docker image. Legal values are Always, Never and
116117
* IfNotPresent.
@@ -125,6 +126,7 @@ public class DomainSpec extends BaseConfiguration {
125126
+ "Defaults to Always if image ends in :latest, IfNotPresent otherwise.")
126127
@EnumClass(ImagePullPolicy.class)
127128
private String imagePullPolicy;
129+
128130
/**
129131
* The image pull secrets for the WebLogic Docker image.
130132
*
@@ -135,6 +137,7 @@ public class DomainSpec extends BaseConfiguration {
135137
*/
136138
@Description("A list of image pull secrets for the WebLogic Docker image.")
137139
private List<V1LocalObjectReference> imagePullSecrets;
140+
138141
/**
139142
* The desired number of running managed servers in each WebLogic cluster that is not explicitly
140143
* configured in a cluster specification.
@@ -143,6 +146,7 @@ public class DomainSpec extends BaseConfiguration {
143146
"The number of managed servers to run in any cluster that does not specify a replica count.")
144147
@Range(minimum = 0)
145148
private Integer replicas;
149+
146150
/**
147151
* Whether the domain home is part of the image.
148152
*
@@ -151,27 +155,31 @@ public class DomainSpec extends BaseConfiguration {
151155
@Description(
152156
"True if this domain's home is defined in the Docker image for the domain. Defaults to true.")
153157
private Boolean domainHomeInImage;
158+
154159
/**
155160
* The name of the Kubernetes config map used for optional WebLogic configuration overrides.
156161
*
157162
* @since 2.0
158163
*/
159164
@Description("The name of the config map for optional WebLogic configuration overrides.")
160165
private String configOverrides;
166+
161167
/**
162168
* A list of names of the Kubernetes secrets used in the WebLogic Configuration overrides.
163169
*
164170
* @since 2.0
165171
*/
166172
@Description("A list of names of the secrets for optional WebLogic configuration overrides.")
167173
private List<String> configOverrideSecrets;
174+
168175
/**
169176
* The configuration for the admin server.
170177
*
171178
* @since 2.0
172179
*/
173180
@Description("Configuration for the Administration Server.")
174181
private AdminServer adminServer;
182+
175183
/**
176184
* The configured managed servers.
177185
*
@@ -180,6 +188,14 @@ public class DomainSpec extends BaseConfiguration {
180188
@Description("Configuration for individual Managed Servers.")
181189
private List<ManagedServer> managedServers = new ArrayList<>();
182190

191+
/**
192+
* The configured clusters.
193+
*
194+
* @since 2.0
195+
*/
196+
@Description("Configuration for the clusters.")
197+
protected List<Cluster> clusters = new ArrayList<>();
198+
183199
/**
184200
* Adds a Cluster to the DomainSpec.
185201
*

model/src/main/java/oracle/kubernetes/weblogic/domain/model/ServerHealth.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class ServerHealth {
3737
@SerializedName("subsystems")
3838
@Expose
3939
@Valid
40-
private List<SubsystemHealth> subsystems = new ArrayList<SubsystemHealth>();
40+
private List<SubsystemHealth> subsystems = new ArrayList<>();
4141

4242
/**
4343
* RFC 3339 date and time at which the server started.

model/src/main/java/oracle/kubernetes/weblogic/domain/model/ServerPod.java

Lines changed: 50 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,21 @@
1515
import javax.annotation.Nullable;
1616
import javax.validation.Valid;
1717

18+
import com.google.gson.annotations.SerializedName;
1819
import io.kubernetes.client.custom.Quantity;
20+
import io.kubernetes.client.models.V1Affinity;
1921
import io.kubernetes.client.models.V1Capabilities;
2022
import io.kubernetes.client.models.V1Container;
2123
import io.kubernetes.client.models.V1EnvVar;
24+
import io.kubernetes.client.models.V1HostAlias;
2225
import io.kubernetes.client.models.V1HostPathVolumeSource;
26+
import io.kubernetes.client.models.V1LocalObjectReference;
27+
import io.kubernetes.client.models.V1PodDNSConfig;
28+
import io.kubernetes.client.models.V1PodReadinessGate;
2329
import io.kubernetes.client.models.V1PodSecurityContext;
2430
import io.kubernetes.client.models.V1ResourceRequirements;
2531
import io.kubernetes.client.models.V1SecurityContext;
32+
import io.kubernetes.client.models.V1Toleration;
2633
import io.kubernetes.client.models.V1Volume;
2734
import io.kubernetes.client.models.V1VolumeMount;
2835
import oracle.kubernetes.json.Description;
@@ -36,17 +43,12 @@
3643
class ServerPod extends KubernetesResource {
3744

3845
private static final Comparator<V1EnvVar> ENV_VAR_COMPARATOR =
39-
(a, b) -> {
40-
return a.getName().compareTo(b.getName());
41-
};
46+
Comparator.comparing(V1EnvVar::getName);
4247
private static final Comparator<V1Volume> VOLUME_COMPARATOR =
43-
(a, b) -> {
44-
return a.getName().compareTo(b.getName());
45-
};
48+
Comparator.comparing(V1Volume::getName);
4649
private static final Comparator<V1VolumeMount> VOLUME_MOUNT_COMPARATOR =
47-
(a, b) -> {
48-
return a.getName().compareTo(b.getName());
49-
};
50+
Comparator.comparing(V1VolumeMount::getName);
51+
5052
/**
5153
* Environment variables to pass while starting a server.
5254
*
@@ -55,6 +57,7 @@ class ServerPod extends KubernetesResource {
5557
@Valid
5658
@Description("A list of environment variables to add to a server.")
5759
private List<V1EnvVar> env = new ArrayList<>();
60+
5861
/**
5962
* Defines the settings for the liveness probe. Any that are not specified will default to the
6063
* runtime liveness probe tuning settings.
@@ -63,6 +66,7 @@ class ServerPod extends KubernetesResource {
6366
*/
6467
@Description("Settings for the liveness probe associated with a server.")
6568
private ProbeTuning livenessProbe = new ProbeTuning();
69+
6670
/**
6771
* Defines the settings for the readiness probe. Any that are not specified will default to the
6872
* runtime readiness probe tuning settings.
@@ -71,6 +75,7 @@ class ServerPod extends KubernetesResource {
7175
*/
7276
@Description("Settings for the readiness probe associated with a server.")
7377
private ProbeTuning readinessProbe = new ProbeTuning();
78+
7479
/**
7580
* Defines the key-value pairs for the pod to fit on a node, the node must have each of the
7681
* indicated key-value pairs as labels.
@@ -80,6 +85,35 @@ class ServerPod extends KubernetesResource {
8085
@Description(
8186
"Selector which must match a node's labels for the pod to be scheduled on that node.")
8287
private Map<String, String> nodeSelector = new HashMap<>();
88+
89+
@SerializedName("activeDeadlineSeconds")
90+
private Long activeDeadlineSeconds = null;
91+
@SerializedName("affinity")
92+
private V1Affinity affinity = null;
93+
@SerializedName("dnsConfig")
94+
private V1PodDNSConfig dnsConfig = null;
95+
@SerializedName("hostAliases")
96+
private List<V1HostAlias> hostAliases = null;
97+
@SerializedName("priority")
98+
private Integer priority = null;
99+
@SerializedName("priorityClassName")
100+
private String priorityClassName = null;
101+
@SerializedName("readinessGates")
102+
private List<V1PodReadinessGate> readinessGates = null;
103+
@SerializedName("restartPolicy")
104+
private String restartPolicy = null;
105+
@SerializedName("runtimeClassName")
106+
private String runtimeClassName = null;
107+
@SerializedName("schedulerName")
108+
private String schedulerName = null;
109+
@SerializedName("securityContext")
110+
private V1PodSecurityContext securityContext = null;
111+
@SerializedName("shareProcessNamespace")
112+
private Boolean shareProcessNamespace = null;
113+
@SerializedName("tolerations")
114+
private List<V1Toleration> tolerations = null;
115+
116+
83117
/**
84118
* Defines the requirements and limits for the pod server.
85119
*
@@ -88,6 +122,7 @@ class ServerPod extends KubernetesResource {
88122
@Description("Memory and CPU minimum requirements and limits for the server.")
89123
private V1ResourceRequirements resources =
90124
new V1ResourceRequirements().limits(new HashMap<>()).requests(new HashMap<>());
125+
91126
/**
92127
* PodSecurityContext holds pod-level security attributes and common container settings. Some
93128
* fields are also present in container.securityContext. Field values of container.securityContext
@@ -97,6 +132,7 @@ class ServerPod extends KubernetesResource {
97132
*/
98133
@Description("Pod-level security attributes.")
99134
private V1PodSecurityContext podSecurityContext = new V1PodSecurityContext();
135+
100136
/**
101137
* InitContainers holds a list of initialization containers that should be run before starting the
102138
* main containers in this pod.
@@ -105,20 +141,23 @@ class ServerPod extends KubernetesResource {
105141
*/
106142
@Description("Initialization containers to be included in the server pod.")
107143
private List<V1Container> initContainers = new ArrayList<>();
144+
108145
/**
109146
* The additional containers.
110147
*
111148
* @since 2.1
112149
*/
113150
@Description("Additional containers to be included in the server pod.")
114151
private List<V1Container> containers = new ArrayList<>();
152+
115153
/**
116154
* Configures how the operator should shutdown the server instance.
117155
*
118156
* @since 2.2
119157
*/
120158
@Description("Configures how the operator should shutdown the server instance.")
121159
private Shutdown shutdown = new Shutdown();
160+
122161
/**
123162
* SecurityContext holds security configuration that will be applied to a container. Some fields
124163
* are present in both SecurityContext and PodSecurityContext. When both are set, the values in
@@ -129,13 +168,15 @@ class ServerPod extends KubernetesResource {
129168
@Description(
130169
"Container-level security attributes. Will override any matching pod-level attributes.")
131170
private V1SecurityContext containerSecurityContext = new V1SecurityContext();
171+
132172
/**
133173
* The additional volumes.
134174
*
135175
* @since 2.0
136176
*/
137177
@Description("Additional volumes to be created in the server pod.")
138178
private List<V1Volume> volumes = new ArrayList<>();
179+
139180
/**
140181
* The additional volume mounts.
141182
*

model/src/main/java/oracle/kubernetes/weblogic/domain/model/SubsystemHealth.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class SubsystemHealth implements Comparable<SubsystemHealth> {
3535
@SerializedName("symptoms")
3636
@Expose
3737
@Valid
38-
private List<String> symptoms = new ArrayList<String>();
38+
private List<String> symptoms = new ArrayList<>();
3939

4040
/**
4141
* Server health of this WebLogic Server. Required.

0 commit comments

Comments
 (0)