Skip to content

Commit 2978d50

Browse files
committed
WKO 410 Support (without Verrazzano)
1 parent 06ea8c1 commit 2978d50

29 files changed

+1193
-300
lines changed

electron/app/js/wktToolsInstaller.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright (c) 2021, 2022, Oracle and/or its affiliates.
3+
* Copyright (c) 2021, 2023, Oracle and/or its affiliates.
44
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
55
*/
66
'use strict';
@@ -105,8 +105,14 @@ async function getWitLatestReleaseName(options) {
105105
async function getWkoLatestReleaseVersion(options) {
106106
return new Promise((resolve, reject) => {
107107
getLatestReleaseObject(wkoToolName, ghApiWkoBaseUrl, options).then(latestReleaseObj => {
108-
const version = latestReleaseObj['name'].split(' ')[1];
109-
resolve(version);
108+
const name = latestReleaseObj['name'];
109+
if (name) {
110+
const version = name.split(' ')[1];
111+
resolve(version);
112+
} else {
113+
const message = latestReleaseObj['message'];
114+
reject(new Error(`Failed to determine latest release version for ${wkoToolName}: ${message}`));
115+
}
110116
}).catch(err => reject(new Error(`Failed to determine latest release version for ${wkoToolName}: ${err}`)));
111117
});
112118
}

electron/app/locales/en/webui.json

Lines changed: 173 additions & 7 deletions
Large diffs are not rendered by default.

webui/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webui/src/js/models/image-definition.js

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright (c) 2021, Oracle and/or its affiliates.
3+
* Copyright (c) 2021, 2023, Oracle and/or its affiliates.
44
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
55
*/
66
'use strict';
@@ -15,8 +15,10 @@ define(['knockout', 'utils/observable-properties', 'utils/validation-helper'],
1515
/**
1616
* The object constructor.
1717
*/
18-
return function (name, wdtModel) {
18+
return function (name, wdtModel, settings, wko) {
1919
function ImageModel() {
20+
this.settings = settings;
21+
2022
this.imageTag = props.createProperty();
2123
this.imageTag.addValidator(...validationHelper.getImageTagValidators());
2224
this.createPrimaryImage = props.createProperty(false);
@@ -56,14 +58,34 @@ define(['knockout', 'utils/observable-properties', 'utils/validation-helper'],
5658
this.oraclePatchOptions = props.createProperty('recommended');
5759
this.oraclePatchesToApply = props.createArrayProperty([]);
5860

59-
this.targetDomainType = props.createProperty('WLS');
60-
this.domainHomePath = props.createProperty('/u01/domains/${1}', wdtModel.domainName);
61+
this.useAuxImage = props.createProperty(true);
62+
63+
this.defaultDomainType = ko.computed(() => {
64+
if (this.settings.targetDomainLocation.observable() === 'pv') {
65+
if (!wko.installedVersion.observable() ||
66+
window.api.utils.compareVersions(wko.installedVersion.observable(), '4.1.0') >= 0) {
67+
return this.useAuxImage.observable() ? 'JRF' : 'WLS';
68+
}
69+
}
70+
return 'WLS';
71+
});
72+
73+
this.targetDomainType = props.createProperty('${1}', this.defaultDomainType);
74+
75+
this.defaultDomainHome = ko.computed(() => {
76+
if (this.settings.targetDomainLocation.observable() === 'pv') {
77+
return '/shared';
78+
}
79+
return '/u01';
80+
});
81+
82+
this.domainHomePath = props.createProperty('${1}/domains/${2}', this.defaultDomainHome, wdtModel.domainName);
6183
this.modelHomePath = props.createProperty('/u01/wdt/models');
6284
this.wdtHomePath = props.createProperty('/u01/wdt');
6385

6486
this.targetOpenShift = props.createProperty(false);
6587
this.defaultGroupName = ko.computed(() => {
66-
return this.targetOpenShift.value ? 'root' : 'oracle';
88+
return this.targetOpenShift.observable() ? 'root' : 'oracle';
6789
});
6890

6991
this.fileOwner = props.createProperty('oracle');
@@ -75,7 +97,9 @@ define(['knockout', 'utils/observable-properties', 'utils/validation-helper'],
7597
this.additionalBuildFiles = props.createArrayProperty([]);
7698

7799
// aux image versions of the variables
78-
this.useAuxImage = props.createProperty(true);
100+
//
101+
// Moved useAuxImage definition up so that it could be used to compute the defaultDomainLocation
102+
//
79103
this.auxImageTag = props.createProperty();
80104
this.auxImageTag.addValidator(...validationHelper.getImageTagValidators());
81105
this.createAuxImage = props.createProperty(true);
@@ -204,4 +228,5 @@ define(['knockout', 'utils/observable-properties', 'utils/validation-helper'],
204228

205229
return new ImageModel();
206230
};
207-
});
231+
}
232+
);

webui/src/js/models/k8s-domain-definition.js

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ define(['knockout', 'utils/observable-properties', 'utils/common-utilities', 'ut
3131
this.domainType = imageDefinition.targetDomainType;
3232

3333
this.domainPersistentVolumeName = props.createProperty('weblogic-domain-storage-volume');
34+
this.domainPersistentVolumeName.addValidator(...validationHelper.getK8sNameValidators());
3435
this.domainPersistentVolumeMountPath = props.createProperty('/shared');
35-
this.domainPersistentVolumeClaimName = props.createProperty();
36+
this.domainPersistentVolumeClaimName = props.createProperty('${1}-pvc', this.uid.observable);
37+
this.domainPersistentVolumeClaimName.addValidator(...validationHelper.getK8sNameValidators());
3638
this.domainPersistentVolumeLogHomeEnabled = props.createProperty(false);
3739
this.domainPersistentVolumeLogHome = props.createProperty('/shared/logs/${1}', this.uid.observable);
3840

@@ -49,8 +51,7 @@ define(['knockout', 'utils/observable-properties', 'utils/common-utilities', 'ut
4951

5052
this.imagePullPolicy = props.createProperty('IfNotPresent');
5153

52-
// These fields are exposed to the user only when using an existing Primary Image and
53-
// not using an Auxiliary Image at all.
54+
// These fields are exposed to the user only when using MII w/o aux image
5455
//
5556
this.imageModelHome = props.createProperty(imageDefinition.modelHomePath.value);
5657
this.imageWDTInstallHome = props.createProperty(imageDefinition.wdtHomePath.value + '/weblogic-deploy');
@@ -66,7 +67,7 @@ define(['knockout', 'utils/observable-properties', 'utils/common-utilities', 'ut
6667
this.auxImageRegistryPullEmail.addValidator(...validationHelper.getEmailAddressValidators());
6768
this.auxImagePullPolicy = props.createProperty('IfNotPresent');
6869

69-
// These fields are exposed to the user only when using an existing Auxiliary Image.
70+
// These fields are exposed to the user only when using an existing Auxiliary Image or Domain Creation Image.
7071
//
7172
this.auxImageSourceModelHome = props.createProperty(DEFAULT_AUX_IMAGE_WDT_MODEL_HOME);
7273
this.auxImageSourceWDTInstallHome = props.createProperty(DEFAULT_AUX_IMAGE_WDT_INSTALL_HOME);
@@ -115,6 +116,45 @@ define(['knockout', 'utils/observable-properties', 'utils/common-utilities', 'ut
115116
this.memoryLimit = props.createProperty();
116117
this.memoryLimit.addValidator(...validationHelper.getK8sMemoryValidators());
117118

119+
this.runRcu = props.createProperty(false);
120+
this.waitForPvcBind = props.createProperty(true);
121+
this.walletPassword = props.createProperty().asCredential();
122+
this.walletPasswordSecretName = props.createProperty('${1}-wallet-password-secret', this.uid.observable);
123+
this.walletPasswordSecretName.addValidator(...validationHelper.getK8sNameValidators());
124+
125+
// TODO - currently unused, thinking to add an action to set up disaster recovery once the domain exists.
126+
this.walletFileSecretName = props.createProperty();
127+
128+
this.createPv = props.createProperty(false);
129+
this.pvName = props.createProperty('${1}-pv', this.uid.observable);
130+
this.pvName.addValidator(...validationHelper.getK8sNameValidators());
131+
this.pvType = props.createProperty('storageClass');
132+
this.pvCapacity = props.createProperty('20Gi');
133+
this.pvCapacity.addValidator(...validationHelper.getK8sMemoryValidators());
134+
this.pvNfsServer = props.createProperty();
135+
this.pvNfsServer.addValidator(...validationHelper.getHostNameValidators());
136+
// This field is used to hold the path for both nfs and hostPath types.
137+
this.pvPath = props.createProperty();
138+
139+
this.defaultReclaimPolicy = ko.computed(() => {
140+
if (this.pvType.observable() === 'storageClass') {
141+
return 'Delete';
142+
}
143+
return 'Retain';
144+
}, this);
145+
146+
this.pvReclaimPolicy = props.createProperty('${1}', this.defaultReclaimPolicy);
147+
148+
this.createPvc = props.createProperty(false);
149+
this.pvcUseDefaultStorageClass = props.createProperty(false);
150+
this.pvcStorageClassName = props.createProperty();
151+
this.pvcStorageClassName.addValidator(...validationHelper.getK8sNameValidators());
152+
153+
this.pvcSizeRequest = props.createProperty('5Gi');
154+
this.pvcSizeRequest.addValidator(...validationHelper.getK8sMemoryValidators());
155+
this.pvcSizeLimit = props.createProperty();
156+
this.pvcSizeLimit.addValidator(...validationHelper.getK8sMemoryValidators());
157+
118158
// Jet tables do not work if you allow changing the value used as the primary key so always add a uid...
119159
//
120160
this.domainNodeSelector = props.createListProperty(['uid', 'name', 'value']);

webui/src/js/models/wkt-project.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ function (ko, wdtConstructor, imageConstructor, kubectlConstructor, domainConstr
8585

8686
this.settings = settingsConstructor('settings');
8787
this.wdtModel = wdtConstructor('model');
88-
this.image = imageConstructor('image', this.wdtModel);
88+
this.wko = wkoConstructor('wko');
89+
this.image = imageConstructor('image', this.wdtModel, this.settings, this.wko);
8990
this.ingress = ingressConstructor('ingress');
9091
this.kubectl = kubectlConstructor('kubectl');
9192
this.k8sDomain = domainConstructor('k8sDomain', this.wdtModel, this.image);
92-
this.wko = wkoConstructor('wko');
9393
this.vzInstall = verrazzanoInstallConstructor('vzInstall');
9494
this.vzComponent = verrazzanoComponentConstructor('vzComponent', this.k8sDomain);
9595
this.vzApplication = verrazzanoApplicationConstructor('vzApplication', this.k8sDomain);
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* @license
3+
* Copyright (c) 2023, Oracle and/or its affiliates.
4+
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
5+
*/
6+
'use strict';
7+
8+
define(['models/wkt-project'],
9+
function(project) {
10+
class AuxImageHelper {
11+
constructor() {
12+
this.project = project;
13+
}
14+
15+
supportsDomainCreationImages() {
16+
return this.project.settings.targetDomainLocation.value === 'pv' && this.wkoVersion41OrHigher();
17+
}
18+
19+
wkoVersion41OrHigher() {
20+
// If the actual installed version is not known, assume true.
21+
let result = true;
22+
if (this.project.wko.installedVersion.hasValue() &&
23+
window.api.utils.compareVersions(this.project.wko.installedVersion.value, '4.1.0') < 0) {
24+
result = false;
25+
}
26+
return result;
27+
}
28+
29+
domainUsesJRF() {
30+
return this.project.image.useAuxImage.value && this.project.k8sDomain.domainType.value !== 'WLS' &&
31+
this.project.k8sDomain.domainType.value !== 'RestrictedJRF';
32+
}
33+
}
34+
35+
return new AuxImageHelper();
36+
}
37+
);

0 commit comments

Comments
 (0)