Skip to content

Commit 0987fbd

Browse files
committed
Merge branch 'owls-108294-change-domaintype-to-string' into 'main'
Owls 108294 - Change DomainType for a Domain on PV from an enumeration to a String and remove volumeMode. See merge request weblogic-cloud/weblogic-kubernetes-operator!4322
2 parents 4fc45b9 + 62bb48a commit 0987fbd

File tree

19 files changed

+88
-143
lines changed

19 files changed

+88
-143
lines changed

documentation/domains/Domain.json

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,8 @@
312312
},
313313
"domainType": {
314314
"default": "JRF",
315-
"description": "WebLogic Deploy Tooling domain type. Legal values: WLS, JRF. Defaults to JRF.",
316-
"type": "string",
317-
"enum": [
318-
"WLS",
319-
"JRF"
320-
]
315+
"description": "WebLogic Deploy Tooling domain type. Known values are: WLS, RestrictedJRF, JRF. Defaults to JRF.",
316+
"type": "string"
321317
},
322318
"opss": {
323319
"description": "Settings for OPSS security.",
@@ -872,10 +868,6 @@
872868
"resources": {
873869
"description": "Resources represents the minimum resources the volume should have. More info https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources. ResourceRequirements describes the compute resource requirements.",
874870
"$ref": "https://github.com/garethr/kubernetes-json-schema/blob/master/v1.13.5/_definitions.json#/definitions/io.k8s.api.core.v1.ResourceRequirements"
875-
},
876-
"volumeMode": {
877-
"description": "VolumeMode defines if a volume is intended to be used with a formatted filesystem or to remain in raw block state. Value of Filesystem is implied when not included in spec.",
878-
"type": "string"
879871
}
880872
}
881873
},
@@ -901,10 +893,6 @@
901893
"capacity": {
902894
"description": "Capacity is the description of the persistent volume\u0027s resources and capacity. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity",
903895
"$ref": "#/definitions/Map"
904-
},
905-
"volumeMode": {
906-
"description": "VolumeMode defines if a volume is intended to be used with a formatted filesystem or to remain in raw block state. Value of Filesystem is implied when not included in spec.",
907-
"type": "string"
908896
}
909897
}
910898
},

documentation/domains/Domain.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ The current status of the operation of the WebLogic domain. Updated automaticall
305305
| `createIfNotExists` | string | Specifies if the operator should create only the domain or the domain with RCU (for JRF-based domains). Legal values: domain, domainAndRCU. Defaults to domain. |
306306
| `domainCreationConfigMap` | string | Name of a ConfigMap containing the WebLogic Deploy Tooling model. |
307307
| `domainCreationImages` | Array of [Domain Creation Image](#domain-creation-image) | Domain creation images containing WebLogic Deploy Tooling model, application archive, and WebLogic Deploy Tooling installation files. These files will be used to create the domain during introspection. This feature internally uses a Kubernetes emptyDir volume and Kubernetes init containers to share the files from the additional images |
308-
| `domainType` | string | WebLogic Deploy Tooling domain type. Legal values: WLS, JRF. Defaults to JRF. |
308+
| `domainType` | string | WebLogic Deploy Tooling domain type. Known values are: WLS, RestrictedJRF, JRF. Defaults to JRF. |
309309
| `opss` | [Opss](#opss) | Settings for OPSS security. |
310310

311311
### Persistent Volume
@@ -365,15 +365,13 @@ The current status of the operation of the WebLogic domain. Updated automaticall
365365
| `nfs` | [NFS Volume Source](k8s1.13.5.md#nfs-volume-source) | nfs represents an NFS mount on the host. Provisioned by an admin. More info:<br/>https://kubernetes.io/docs/concepts/storage/volumes#nfs<br/>Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not support ownership management or SELinux relabeling. |
366366
| `persistentVolumeReclaimPolicy` | string | PersistentVolumeReclaimPolicy defines what happens to a persistent volume when released from its claim. Valid options are Retain (default for manually created PersistentVolumes), Delete (default for dynamically provisioned PersistentVolumes), and Recycle (deprecated). Recycle must be supported by the volume plugin underlying this PersistentVolume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming |
367367
| `storageClassName` | string | StorageClassName is the name of StorageClass to which this persistent volume belongs. Empty value means that this volume does not belong to any StorageClass. |
368-
| `volumeMode` | string | VolumeMode defines if a volume is intended to be used with a formatted filesystem or to remain in raw block state. Value of Filesystem is implied when not included in spec. |
369368

370369
### Persistent Volume Claim Spec
371370

372371
| Name | Type | Description |
373372
| --- | --- | --- |
374373
| `resources` | [Resource Requirements](k8s1.13.5.md#resource-requirements) | Resources represents the minimum resources the volume should have. More info https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources. ResourceRequirements describes the compute resource requirements. |
375374
| `storageClassName` | string | StorageClassName is the name of StorageClass to which this persistent volume belongs. Empty value means that this volume does not belong to any StorageClass. |
376-
| `volumeMode` | string | VolumeMode defines if a volume is intended to be used with a formatted filesystem or to remain in raw block state. Value of Filesystem is implied when not included in spec. |
377375
| `volumeName` | string | VolumeName is the binding reference to the PersistentVolume backing this claim. |
378376

379377
### WDT Timeouts

kubernetes/crd/domain-crd.yaml

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apiVersion: apiextensions.k8s.io/v1
55
kind: CustomResourceDefinition
66
metadata:
77
annotations:
8-
weblogic.sha256: 99585cc6da80c53c308ee386305361ba10859fe959ee7cac31bd526dc30e2a42
8+
weblogic.sha256: 178adc9415467dab4785cad74e3af8193024aa29ee181df4b22224fbe7866c0e
99
name: domains.weblogic.oracle
1010
spec:
1111
group: weblogic.oracle
@@ -251,12 +251,6 @@ spec:
251251
description: 'Capacity is the description of the persistent
252252
volume''s resources and capacity. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity'
253253
type: object
254-
volumeMode:
255-
description: VolumeMode defines if a volume is intended
256-
to be used with a formatted filesystem or to remain
257-
in raw block state. Value of Filesystem is implied
258-
when not included in spec.
259-
type: string
260254
type: object
261255
type: object
262256
domain:
@@ -317,11 +311,8 @@ spec:
317311
type: array
318312
domainType:
319313
default: JRF
320-
description: 'WebLogic Deploy Tooling domain type. Legal
321-
values: WLS, JRF. Defaults to JRF.'
322-
enum:
323-
- WLS
324-
- JRF
314+
description: 'WebLogic Deploy Tooling domain type. Known
315+
values are: WLS, RestrictedJRF, JRF. Defaults to JRF.'
325316
type: string
326317
opss:
327318
description: Settings for OPSS security.
@@ -478,12 +469,6 @@ spec:
478469
type: string
479470
type: object
480471
type: object
481-
volumeMode:
482-
description: VolumeMode defines if a volume is intended
483-
to be used with a formatted filesystem or to remain
484-
in raw block state. Value of Filesystem is implied
485-
when not included in spec.
486-
type: string
487472
type: object
488473
type: object
489474
type: object

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

Lines changed: 0 additions & 20 deletions
This file was deleted.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,5 @@ public interface ProcessingConstants {
7373
String BOUND = "Bound";
7474
int PVC_WAIT_STATUS_UPDATE_COUNT = 6;
7575
long DEFAULT_JRF_INTROSPECTOR_JOB_ACTIVE_DEADLINE_SECONDS = 1800L;
76-
long DEFAULT_WLS_INTROSPECTOR_JOB_ACTIVE_DEADLINE_SECONDS = 600L;
76+
long DEFAULT_WLS_OR_RESTRICTED_JRF_INTROSPECTOR_JOB_ACTIVE_DEADLINE_SECONDS = 600L;
7777
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,8 @@ public interface WebLogicConstants {
3030
FORCE_SUSPENDING_STATE));
3131

3232
String READINESS_PROBE_NOT_READY_STATE = "Not ready: WebLogic Server state: ";
33+
String JRF = "JRF";
34+
String WLS = "WLS";
35+
String RESTRICTED_JRF = "RestrictedJRF";
36+
3337
}

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import oracle.kubernetes.common.helpers.AuxiliaryImageEnvVars;
3434
import oracle.kubernetes.common.logging.MessageKeys;
3535
import oracle.kubernetes.common.utils.CommonUtils;
36-
import oracle.kubernetes.operator.DomainOnPVType;
3736
import oracle.kubernetes.operator.DomainSourceType;
3837
import oracle.kubernetes.operator.IntrospectorConfigMapConstants;
3938
import oracle.kubernetes.operator.KubernetesConstants;
@@ -296,8 +295,8 @@ String getWdtDomainTypeValue() {
296295
if (getInitializeDomainOnPV().isEmpty()) {
297296
return getDomain().getWdtDomainType().toString();
298297
} else {
299-
return getInitializeDomainOnPV().map(InitializeDomainOnPV::getDomain).map(DomainOnPV::getDomainType).map(
300-
DomainOnPVType::toString).orElse(null);
298+
return getInitializeDomainOnPV().map(InitializeDomainOnPV::getDomain).map(DomainOnPV::getDomainType)
299+
.orElse(null);
301300
}
302301
}
303302

operator/src/main/java/oracle/kubernetes/operator/tuning/TuningParameters.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
import javax.annotation.Nonnull;
2525
import javax.annotation.Nullable;
2626

27-
import oracle.kubernetes.operator.DomainOnPVType;
2827
import oracle.kubernetes.operator.ProcessingConstants;
2928
import oracle.kubernetes.operator.WatchTuning;
29+
import oracle.kubernetes.operator.WebLogicConstants;
3030
import oracle.kubernetes.operator.logging.LoggingFacade;
3131
import oracle.kubernetes.operator.logging.LoggingFactory;
3232

@@ -213,16 +213,20 @@ public boolean isRestartEvictedPods() {
213213
/**
214214
* Returns the value of introspector job active deadline seconds with default value depending on the context.
215215
*/
216-
public long getActiveJobInitialDeadlineSeconds(boolean isInitializeDomainOnPV, DomainOnPVType type) {
216+
public long getActiveJobInitialDeadlineSeconds(boolean isInitializeDomainOnPV, String type) {
217217
long defaultValue = 120L;
218-
if (isInitializeDomainOnPV && DomainOnPVType.JRF.equals(type)) {
219-
defaultValue = ProcessingConstants.DEFAULT_JRF_INTROSPECTOR_JOB_ACTIVE_DEADLINE_SECONDS;
218+
if (isInitializeDomainOnPV && isWlsOrRestrictedJRFDomain(type)) {
219+
defaultValue = ProcessingConstants.DEFAULT_WLS_OR_RESTRICTED_JRF_INTROSPECTOR_JOB_ACTIVE_DEADLINE_SECONDS;
220220
} else if (isInitializeDomainOnPV) {
221-
defaultValue = ProcessingConstants.DEFAULT_WLS_INTROSPECTOR_JOB_ACTIVE_DEADLINE_SECONDS;
221+
defaultValue = ProcessingConstants.DEFAULT_JRF_INTROSPECTOR_JOB_ACTIVE_DEADLINE_SECONDS;
222222
}
223223
return getParameter(INTROSPECTOR_JOB_ACTIVE_DEADLINE_SECONDS, defaultValue);
224224
}
225225

226+
private boolean isWlsOrRestrictedJRFDomain(String type) {
227+
return WebLogicConstants.WLS.equals(type) || WebLogicConstants.RESTRICTED_JRF.equals(type);
228+
}
229+
226230
public long getActiveDeadlineIncrementSeconds() {
227231
return getParameter(INTROSPECTOR_JOB_DEADLINE_INCREMENT_SECONDS, DEFAULT_ACTIVE_DEADLINE_INCREMENT_SECONDS);
228232
}

operator/src/main/java/oracle/kubernetes/weblogic/domain/model/DomainOnPV.java

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,25 @@
88
import com.google.gson.annotations.SerializedName;
99
import oracle.kubernetes.json.Default;
1010
import oracle.kubernetes.json.Description;
11-
import oracle.kubernetes.operator.DomainOnPVType;
1211
import org.apache.commons.lang3.builder.EqualsBuilder;
1312
import org.apache.commons.lang3.builder.HashCodeBuilder;
1413
import org.apache.commons.lang3.builder.ToStringBuilder;
1514

15+
import static oracle.kubernetes.operator.WebLogicConstants.JRF;
16+
import static oracle.kubernetes.operator.WebLogicConstants.RESTRICTED_JRF;
17+
import static oracle.kubernetes.operator.WebLogicConstants.WLS;
18+
1619
public class DomainOnPV {
1720

1821
@Description("Specifies if the operator should create only the domain or the domain with RCU (for JRF-based domains)."
1922
+ " Legal values: domain, domainAndRCU. Defaults to domain.")
2023
@Default(strDefault = "domain")
2124
private CreateIfNotExists createIfNotExists = CreateIfNotExists.DOMAIN;
2225

23-
@Description("WebLogic Deploy Tooling domain type. Legal values: WLS, JRF. Defaults to JRF.")
26+
@Description("WebLogic Deploy Tooling domain type. Known values are: WLS, RestrictedJRF, JRF. Defaults to JRF.")
2427
@SerializedName("domainType")
2528
@Default(strDefault = "JRF")
26-
private DomainOnPVType domainType = DomainOnPVType.JRF;
29+
private String domainType = JRF;
2730

2831
/**
2932
* The domain images.
@@ -51,11 +54,24 @@ public DomainOnPV createMode(CreateIfNotExists createIfNotExists) {
5154
return this;
5255
}
5356

54-
public DomainOnPVType getDomainType() {
57+
/**
58+
* Returns the domain type in upper case for WLS and JRF domains, camel case for RestrictedJRF domain,
59+
* and user provided value otherwise.
60+
*
61+
* @return the domain type in proper case.
62+
*/
63+
public String getDomainType() {
64+
if (JRF.equalsIgnoreCase(domainType)) {
65+
return JRF;
66+
} else if (WLS.equalsIgnoreCase(domainType)) {
67+
return WLS;
68+
} else if (RESTRICTED_JRF.equalsIgnoreCase(domainType)) {
69+
return RESTRICTED_JRF;
70+
}
5571
return domainType;
5672
}
5773

58-
public DomainOnPV domainType(DomainOnPVType domainType) {
74+
public DomainOnPV domainType(String domainType) {
5975
this.domainType = domainType;
6076
return this;
6177
}

operator/src/main/java/oracle/kubernetes/weblogic/domain/model/DomainResource.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@
3737
import jakarta.validation.Valid;
3838
import jakarta.validation.constraints.NotNull;
3939
import oracle.kubernetes.json.Description;
40-
import oracle.kubernetes.operator.DomainOnPVType;
4140
import oracle.kubernetes.operator.DomainSourceType;
4241
import oracle.kubernetes.operator.KubernetesConstants;
4342
import oracle.kubernetes.operator.LogHomeLayoutType;
4443
import oracle.kubernetes.operator.MIINonDynamicChangesMethod;
4544
import oracle.kubernetes.operator.ModelInImageDomainType;
4645
import oracle.kubernetes.operator.OverrideDistributionStrategy;
46+
import oracle.kubernetes.operator.WebLogicConstants;
4747
import oracle.kubernetes.operator.helpers.LegalNames;
4848
import oracle.kubernetes.operator.helpers.SecretType;
4949
import oracle.kubernetes.operator.processing.EffectiveAdminServerSpec;
@@ -57,8 +57,7 @@
5757

5858
import static java.util.stream.Collectors.toSet;
5959
import static oracle.kubernetes.common.logging.MessageKeys.MAKE_RIGHT_WILL_RETRY;
60-
import static oracle.kubernetes.operator.DomainOnPVType.JRF;
61-
import static oracle.kubernetes.operator.DomainOnPVType.WLS;
60+
import static oracle.kubernetes.operator.WebLogicConstants.JRF;
6261
import static oracle.kubernetes.operator.helpers.LegalNames.LEGAL_DNS_LABEL_NAME_MAX_LENGTH;
6362
import static oracle.kubernetes.utils.OperatorUtils.emptyToNull;
6463
import static oracle.kubernetes.weblogic.domain.model.DomainValidationMessages.clusterInUse;
@@ -564,7 +563,7 @@ public InitializeDomainOnPV getInitializeDomainOnPV() {
564563
* Returns the domain type when initializeDomainOnPV is specified.
565564
* @return domain type
566565
*/
567-
public DomainOnPVType getInitializeDomainOnPVDomainType() {
566+
public String getInitializeDomainOnPVDomainType() {
568567
return spec.getInitializeDomainOnPVDomainType();
569568
}
570569

@@ -1680,10 +1679,11 @@ private boolean isCreateIfNotExistsDomainAndRCU() {
16801679
}
16811680

16821681
private boolean isDomainTypeWLS() {
1683-
return spec.getInitializeDomainOnPVDomainType() == WLS;
1682+
return WebLogicConstants.WLS.equals(spec.getInitializeDomainOnPVDomainType());
16841683
}
16851684

16861685
private CreateIfNotExists getCreateIfNotExists() {
1686+
16871687
return spec.getInitializeDomainOnPV().getDomain().getCreateIfNotExists();
16881688
}
16891689

0 commit comments

Comments
 (0)