Skip to content

Commit 70455fc

Browse files
committed
Merge branch 'dopv-fixes' into 'main'
addressing the first portion of the domain on PV support issues See merge request weblogic-cloud/weblogic-toolkit-ui!258
2 parents 07ed1a0 + 436a7ba commit 70455fc

20 files changed

+997
-686
lines changed

electron/app/locales/en/webui.json

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,13 @@
279279
"image-design-create-image-aux-help": "Whether you want to create a new primary image or use an existing image, such as one of the standard images in the Oracle Container Registry.",
280280

281281
"image-design-aux-image-settings-label": "Auxiliary Image Configuration",
282-
"image-design-aux-image-config-off-label": "Do not use an auxiliary image",
283-
"image-design-aux-image-config-use-label": "Use an existing auxiliary image",
284-
"image-design-aux-image-config-create-label": "Create a new auxiliary image",
282+
"image-design-aux-image-config-off-label": "Do not use an auxiliary image so the model is in the primary image.",
283+
"image-design-aux-image-config-use-label": "Use an existing auxiliary image created outside of this project so this project has no model.",
284+
"image-design-aux-image-config-create-label": "Create a new auxiliary image using this project.",
285285
"image-design-domain-creation-image-settings-label": "Domain Creation Image Configuration",
286-
"image-design-domain-creation-image-config-off-label": "Do not use a domain creation image",
287-
"image-design-domain-creation-image-config-use-label": "Use an existing domain creation image",
288-
"image-design-domain-creation-image-config-create-label": "Create a new domain creation image",
286+
"image-design-domain-creation-image-config-off-label": "Do not use a domain creation image so this project has no model.",
287+
"image-design-domain-creation-image-config-use-label": "Use an existing domain creation image created outside of this project so this project has no model.",
288+
"image-design-domain-creation-image-config-create-label": "Create a new domain creation image using this project.",
289289

290290
"image-design-image-tag-label": "Image Tag",
291291
"image-design-image-tag-mii-create-help": "The tag to use to identify the new image containing the Oracle Fusion Middleware installation and WebLogic Deploy Tooling model to use to create and run the domain.",
@@ -618,12 +618,14 @@
618618
"domain-design-image-registry-pull-email-label": "Image Registry Pull Email Address",
619619
"domain-design-image-registry-pull-email-help": "The image registry user's email address used to create the Kubernetes image pull secret.",
620620

621-
"domain-design-aux-image-config-off-label": "Do not use an auxiliary image",
622-
"domain-design-aux-image-config-use-label": "Use an existing auxiliary image created outside of this project",
623-
"domain-design-aux-image-config-create-label": "Use newly created auxiliary image created by this project",
624-
"domain-design-domain-creation-image-config-off-label": "Do not use a domain creation image",
625-
"domain-design-domain-creation-image-config-use-label": "Use an existing domain creation image created outside of this project",
626-
"domain-design-domain-creation-image-config-create-label": "Use newly created domain creation image created by this project",
621+
"domain-design-aux-image-config-off-label": "This project is not using an auxiliary image so the model is in the primary image.",
622+
"domain-design-aux-image-config-use-label": "This project is using an existing auxiliary image created outside of this project so the project has no model.",
623+
"domain-design-aux-image-config-create-label": "This project is using an auxiliary image created using this project.",
624+
"domain-design-domain-creation-image-config-off-label": "This project is not using a domain creation image so this project has no model.",
625+
"domain-design-domain-creation-image-config-use-label": "This project is using an existing domain creation image created outside of this project so this project has no model.",
626+
"domain-design-domain-creation-image-config-create-label": "This project is using an domain creation image created using this project.",
627+
"domain-design-revisit-aux-image-decision-label": "Change Setting",
628+
"domain-design-revisit-aux-image-decision-help": "Jump to the Image page to change this setting",
627629

628630
"domain-design-aux-image-title": "Auxiliary Image to Use for the Domain",
629631
"domain-design-hints-goto-create-aux-image": "Go To Create Auxiliary Image Page",
@@ -787,9 +789,15 @@
787789
"domain-design-cluster-additional-java-options-help": "A list of additional Java runtime options, separated by spaces, tabs, or commas.",
788790

789791
"domain-design-configmap-table-aria-label": "ConfigMap Properties Table",
790-
"domain-design-configmap-title": "Model Variables Overrides",
792+
"domain-design-configmap-title": "Model Variable Overrides",
793+
"domain-design-configmap-external-title": "External Model Variable Overrides",
791794
"domain-design-configmap-label": "Kubernetes ConfigMap Name",
792795
"domain-design-configmap-help": "The name of the Kubernetes ConfigMap that holds the model variable overrides.",
796+
"domain-design-configmap-no-properties-message": "No model variables found.",
797+
"domain-design-configmap-no-properties-add-remove-message": "No model variables for model in external image found. Please add model variables, as needed.",
798+
"domain-design-add-external-property-tooltip": "Add External Model Variable Override Entry",
799+
"domain-design-delete-external-property-tooltip": "Delete External Model Variable Override Entry",
800+
793801
"domain-design-encryption-secret-label": "Runtime Encryption Secret Name",
794802
"domain-design-encryption-secret-help": "The name of the Kubernetes secret which holds the password used to encrypt the domain.",
795803
"domain-design-encryption-value-label": "Runtime Encryption Secret Value",
@@ -828,6 +836,19 @@
828836
"domain-design-username-header": "Username",
829837
"domain-design-password-header": "Password",
830838
"domain-design-secrets-cell-field-name": "Secrets table {{name}} field at row {{position}} with UID {{uid}}",
839+
"domain-design-add-external-secret-tooltip": "Add External Model Secret Entry",
840+
"domain-design-delete-external-secret-tooltip": "Delete External Model Secret Entry",
841+
"domain-design-no-secrets-message": "No additional model secrets found.",
842+
"domain-design-no-secrets-add-remove-message": "No additional external model secrets found. Please add secrets for any secret references in the external model that are not already handled in other parts of this page.",
843+
844+
"domain-design-domain-env-var-title": "Domain-Wide Environment Variables",
845+
"domain-design-domain-env-var-table-aria-label": "Domain-Wide Environment Variables Table",
846+
"domain-design-domain-env-var-name-header": "Environment Variable Name",
847+
"domain-design-domain-env-var-value-header": "Environment Variable Value",
848+
"domain-design-domain-add-env-var-tooltip": "Add Environment Variable Entry",
849+
"domain-design-domain-delete-env-var-tooltip": "Delete Environment Variable Entry",
850+
"domain-design-domain-no-env-vars-message": "No environment variables specified",
851+
831852
"domain-design-domain-node-selector-title": "Domain-Wide Node Selector",
832853
"domain-design-domain-node-selector-table-aria-label": "Domain-Wide Node Selector Table",
833854
"domain-design-domain-node-selector-label-name-header": "Label Name",

webui/package-lock.json

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

webui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"dependencies": {
1313
"@oracle/oraclejet": "~14.1.2",
1414
"@oracle/oraclejet-core-pack": "~14.1.2",
15-
"@oracle/wrc-jet-pack": "~2.4.5-develop",
15+
"@oracle/wrc-jet-pack": "~2.4.5",
1616
"ace-builds": "^1.22.0",
1717
"i18next": "^22.5.0",
1818
"jquery": "^3.7.0",

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,12 @@ define(['knockout', 'utils/observable-properties', 'utils/common-utilities', 'ut
155155
this.pvcSizeLimit = props.createProperty();
156156
this.pvcSizeLimit.addValidator(...validationHelper.getK8sMemoryValidators());
157157

158+
this.externalProperties = props.createListProperty(['uid', 'Name', 'Override']).persistByKey('uid');
159+
158160
// Jet tables do not work if you allow changing the value used as the primary key so always add a uid...
159161
//
160162
this.domainNodeSelector = props.createListProperty(['uid', 'name', 'value']);
163+
this.serverPodEnvironmentVariables = props.createListProperty(['uid', 'name', 'value']).persistByKey('uid');
161164

162165
// update the secrets list when the uid changes.
163166
this.uid.observable.subscribe(() => {

webui/src/js/utils/aux-image-helper.js

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
'use strict';
77

8-
define(['models/wkt-project'],
8+
define(['models/wkt-project', 'utils/wkt-logger'],
99
function(project) {
1010
function AuxImageHelper() {
1111

@@ -28,11 +28,28 @@ define(['models/wkt-project'],
2828
project.k8sDomain.domainType.value !== 'RestrictedJRF';
2929
};
3030

31-
this.projectUsesModel = () => {
31+
this.projectHasModel = () => {
3232
if (project.settings.targetDomainLocation.observable() === 'pv') {
33-
return this.supportsDomainCreationImages() && project.image.useAuxImage.observable();
33+
// PV - if not creating the domain creation image then no model.
34+
return this.supportsDomainCreationImages() && project.image.useAuxImage.observable() &&
35+
project.image.createAuxImage.observable();
36+
} else if (project.settings.targetDomainLocation.observable() === 'mii') {
37+
if (project.image.useAuxImage.observable()) {
38+
// MII w/ aux image - if not creating the aux image then no model.
39+
return project.image.createAuxImage.observable();
40+
}
3441
}
35-
return true;
42+
// MII w/o aux image - if not creating the primary image, then no model.
43+
// DII - if not creating the primary image, then no model.
44+
return project.image.createPrimaryImage.observable();
45+
};
46+
47+
this.projectUsingExternalImageContainingModel = () => {
48+
if (this.supportsDomainCreationImages() || project.settings.targetDomainLocation.observable() === 'mii') {
49+
return project.image.useAuxImage.observable() && !project.image.createAuxImage.observable();
50+
}
51+
// Old PV and DII never has a model in the image
52+
return false;
3653
};
3754

3855
this.isCreatingAuxImage = () => {

webui/src/js/utils/common-utilities.js

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* An object which controls display of the main dialog.
1010
* Returns a singleton.
1111
*/
12-
define([],
12+
define(['utils/wkt-logger'],
1313
function () {
1414
const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
1515

@@ -129,7 +129,33 @@ define([],
129129
}
130130
}
131131
return result;
132-
}
132+
},
133+
134+
/**
135+
* Generate a new name with an index larger than the largest existing one in the array.
136+
*
137+
* @param observableArray - the knockout ObservableArray of objects
138+
* @param fieldName - the field name in the object to match against
139+
* @param generatedPrefix - the generated name prefix to match against and use for the new name
140+
* @returns {string} - the newly generated name
141+
*/
142+
generateNewName(observableArray, fieldName, generatedPrefix, omitIndexDash = false) {
143+
let index = 1;
144+
const regexString = omitIndexDash ? `^${generatedPrefix}(\\d+)$` : `^${generatedPrefix}-(\\d+)$`;
145+
146+
const generatedRegex = new RegExp(regexString);
147+
observableArray().forEach(obj => {
148+
const match = obj[fieldName].match(generatedRegex);
149+
if (match) {
150+
const indexFound = Number(match[1]);
151+
152+
if (indexFound >= index) {
153+
index = indexFound + 1;
154+
}
155+
}
156+
});
157+
return omitIndexDash ? `${generatedPrefix}${index}` : `${generatedPrefix}-${index}`;
158+
},
133159
};
134160
}
135161
);

webui/src/js/utils/k8s-domain-configmap-generator.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,35 @@
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 (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl/
55
*/
66
'use strict';
77

8-
define(['models/wkt-project', 'js-yaml'],
9-
function(project, jsYaml) {
8+
define(['models/wkt-project', 'js-yaml', 'utils/aux-image-helper'],
9+
function(project, jsYaml, auxImageHelper) {
1010
class K8sDomainConfigMapGenerator {
1111
constructor() {
1212
this.project = project;
1313
}
1414

1515
shouldCreateConfigMap() {
16-
return this.project.settings.targetDomainLocation.value === 'mii';
16+
if (auxImageHelper.supportsDomainCreationImages()) {
17+
return this.project.image.useAuxImage.value;
18+
} else if (this.project.settings.targetDomainLocation.value === 'mii') {
19+
return true;
20+
}
21+
return false;
1722
}
1823

1924
generate(generateYaml = true) {
2025
if (!this.shouldCreateConfigMap()) {
2126
return generateYaml ? [] : undefined;
2227
}
2328

29+
const configMapData = auxImageHelper.projectHasModel() ?
30+
this.project.wdtModel.getMergedPropertiesContent().observable() :
31+
this.project.k8sDomain.externalProperties.observable();
32+
2433
const configMap = {
2534
apiVersion: 'v1',
2635
kind: 'ConfigMap',
@@ -30,8 +39,9 @@ define(['models/wkt-project', 'js-yaml'],
3039
},
3140
data: {}
3241
};
42+
3343
configMap.data[`${this.project.k8sDomain.uid.value}-overrides.properties`] =
34-
getConfigMapValues(this.project.wdtModel.getMergedPropertiesContent().observable());
44+
getConfigMapValues(configMapData);
3545

3646
return generateYaml ? jsYaml.dump(configMap).split('\n') : configMap;
3747
}

webui/src/js/utils/k8s-domain-v8-resource-generator.js

Lines changed: 11 additions & 1 deletion
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 (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl/
55
*/
66
'use strict';
@@ -172,6 +172,16 @@ function(project, K8sDomainConfigMapGenerator, jsYaml, i18n) {
172172
_getDomainServerPod() {
173173
let serverPod = this._getServerPod();
174174

175+
if (this.project.k8sDomain.serverPodEnvironmentVariables.value.length > 0) {
176+
if (!serverPod) {
177+
serverPod = {};
178+
}
179+
serverPod.env = [];
180+
this.project.k8sDomain.serverPodEnvironmentVariables.value.forEach(envVar => {
181+
serverPod.env.push({ name: envVar.name, value: envVar.value });
182+
});
183+
}
184+
175185
if (this.project.k8sDomain.domainNodeSelector.value.length > 0) {
176186
if (!serverPod) {
177187
serverPod = {};

0 commit comments

Comments
 (0)