Skip to content

Commit 33ae46a

Browse files
authored
Merge pull request #119 from oracle/oracle/issue106-as-java-options
Support environment properties set in admin server's ServerStartup
2 parents d67b5c2 + 7b8d829 commit 33ae46a

File tree

5 files changed

+10
-48
lines changed

5 files changed

+10
-48
lines changed

site/creating-domain.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ Metadata:
258258
Spec:
259259
Admin Secret:
260260
Name: domain1-weblogic-credentials
261-
As Env:
262261
As Name: admin-server
263262
As Port: 7001
264263
Cluster Startup:

src-generated-swagger/main/java/oracle/kubernetes/operator/domain/model/oracle/kubernetes/weblogic/domain/v1/DomainSpec.java

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ public class DomainSpec {
5252
@SerializedName("asNodePort")
5353
private Integer asNodePort = null;
5454

55-
@SerializedName("asEnv")
56-
private List<io.kubernetes.client.models.V1EnvVar> asEnv = null;
57-
5855
@SerializedName("exportT3Channels")
5956
private List<String> exportT3Channels = null;
6057

@@ -230,33 +227,6 @@ public void setAsNodePort(Integer asNodePort) {
230227
this.asNodePort = asNodePort;
231228
}
232229

233-
public DomainSpec asEnv(List<io.kubernetes.client.models.V1EnvVar> asEnv) {
234-
this.asEnv = asEnv;
235-
return this;
236-
}
237-
238-
public DomainSpec addAsEnvItem(io.kubernetes.client.models.V1EnvVar asEnvItem) {
239-
if (this.asEnv == null) {
240-
this.asEnv = new ArrayList<io.kubernetes.client.models.V1EnvVar>();
241-
}
242-
this.asEnv.add(asEnvItem);
243-
return this;
244-
}
245-
246-
/**
247-
* Environment variables for use in starting the administration server.
248-
*
249-
* @return asEnv
250-
**/
251-
@ApiModelProperty(value = "Environment variables for use in starting the administration server.")
252-
public List<io.kubernetes.client.models.V1EnvVar> getAsEnv() {
253-
return asEnv;
254-
}
255-
256-
public void setAsEnv(List<io.kubernetes.client.models.V1EnvVar> asEnv) {
257-
this.asEnv = asEnv;
258-
}
259-
260230
public DomainSpec exportT3Channels(List<String> exportT3Channels) {
261231
this.exportT3Channels = exportT3Channels;
262232
return this;
@@ -410,7 +380,6 @@ public boolean equals(java.lang.Object o) {
410380
&& Objects.equals(this.asName, oracleKubernetesWeblogicDomainV1DomainSpec.asName)
411381
&& Objects.equals(this.asPort, oracleKubernetesWeblogicDomainV1DomainSpec.asPort)
412382
&& Objects.equals(this.asNodePort, oracleKubernetesWeblogicDomainV1DomainSpec.asNodePort)
413-
&& Objects.equals(this.asEnv, oracleKubernetesWeblogicDomainV1DomainSpec.asEnv)
414383
&& Objects.equals(this.exportT3Channels, oracleKubernetesWeblogicDomainV1DomainSpec.exportT3Channels)
415384
&& Objects.equals(this.startupControl, oracleKubernetesWeblogicDomainV1DomainSpec.startupControl)
416385
&& Objects.equals(this.serverStartup, oracleKubernetesWeblogicDomainV1DomainSpec.serverStartup)
@@ -420,7 +389,7 @@ public boolean equals(java.lang.Object o) {
420389

421390
@Override
422391
public int hashCode() {
423-
return Objects.hash(domainUID, domainName, image, imagePullPolicy, adminSecret, asName, asPort, asNodePort, asEnv,
392+
return Objects.hash(domainUID, domainName, image, imagePullPolicy, adminSecret, asName, asPort, asNodePort,
424393
exportT3Channels, startupControl, serverStartup, clusterStartup, replicas);
425394
}
426395

@@ -437,7 +406,6 @@ public String toString() {
437406
sb.append(" asName: ").append(toIndentedString(asName)).append("\n");
438407
sb.append(" asPort: ").append(toIndentedString(asPort)).append("\n");
439408
sb.append(" asNodePort: ").append(toIndentedString(asNodePort)).append("\n");
440-
sb.append(" asEnv: ").append(toIndentedString(asEnv)).append("\n");
441409
sb.append(" exportT3Channels: ").append(toIndentedString(exportT3Channels)).append("\n");
442410
sb.append(" startupControl: ").append(toIndentedString(startupControl)).append("\n");
443411
sb.append(" serverStartup: ").append(toIndentedString(serverStartup)).append("\n");

src/main/java/oracle/kubernetes/operator/Main.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,6 @@ private static void normalizeDomainSpec(DomainSpec spec) {
361361
if (imagePullPolicy == null || imagePullPolicy.length() == 0) {
362362
spec.setImagePullPolicy(imagePullPolicy = (imageName.endsWith(KubernetesConstants.LATEST_IMAGE_SUFFIX)) ? KubernetesConstants.ALWAYS_IMAGEPULLPOLICY : KubernetesConstants.IFNOTPRESENT_IMAGEPULLPOLICY);
363363
}
364-
if (spec.getAsEnv() == null) {
365-
spec.setAsEnv(new ArrayList<V1EnvVar>());
366-
}
367364
if (spec.getExportT3Channels() == null) {
368365
spec.setExportT3Channels(new ArrayList<String>());
369366
}

src/main/java/oracle/kubernetes/operator/helpers/PodHelper.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import oracle.kubernetes.operator.ProcessingConstants;
3030
import oracle.kubernetes.operator.domain.model.oracle.kubernetes.weblogic.domain.v1.Domain;
3131
import oracle.kubernetes.operator.domain.model.oracle.kubernetes.weblogic.domain.v1.DomainSpec;
32+
import oracle.kubernetes.operator.domain.model.oracle.kubernetes.weblogic.domain.v1.ServerStartup;
3233
import oracle.kubernetes.operator.logging.LoggingFacade;
3334
import oracle.kubernetes.operator.logging.LoggingFactory;
3435
import oracle.kubernetes.operator.logging.MessageKeys;
@@ -171,9 +172,13 @@ public NextAction apply(Packet packet) {
171172
livenessProbe.setFailureThreshold(1);
172173
container.livenessProbe(livenessProbe);
173174

174-
if (spec.getAsEnv() != null) {
175-
for (V1EnvVar ev : spec.getAsEnv()) {
176-
container.addEnvItem(ev);
175+
if (spec.getServerStartup() != null) {
176+
for (ServerStartup ss : spec.getServerStartup()) {
177+
if (ss.getServerName().equals(spec.getAsName())) {
178+
for (V1EnvVar ev : ss.getEnv()) {
179+
container.addEnvItem(ev);
180+
}
181+
}
177182
}
178183
}
179184

swagger/domain.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,13 +1524,6 @@
15241524
"description": "Administration server NodePort port. The port on each node on which the administration server will be exposed. If specified, this value must be an unused port. By default, the administration server will not be exposed outside the Kubernetes cluster.",
15251525
"type": "integer"
15261526
},
1527-
"asEnv": {
1528-
"description": "Environment variables for use in starting the administration server.",
1529-
"type": "array",
1530-
"items": {
1531-
"$ref": "#/definitions/io.k8s.api.core.v1.EnvVar"
1532-
}
1533-
},
15341527
"exportT3Channels": {
15351528
"description": "List of specific T3 channels to export. Named T3 Channels will be exposed using NodePort Services. The internal and external ports must match; therefore, it is required that the channel's port in the WebLogic configuration be a legal and unique value in the Kubernetes cluster's legal NodePort port range.",
15361529
"type": "array",
@@ -1631,4 +1624,4 @@
16311624
"BearerToken": []
16321625
}
16331626
]
1634-
}
1627+
}

0 commit comments

Comments
 (0)