Skip to content

Commit 1917e02

Browse files
committed
Merge branch 'wktui-416' into 'main'
changing auxiliary image path location defaults to align with auxiliary image creation See merge request weblogic-cloud/weblogic-toolkit-ui!250
2 parents 77b33be + 861e4a2 commit 1917e02

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,22 @@
1313
define(['knockout', 'utils/observable-properties', 'utils/common-utilities', 'utils/validation-helper', 'utils/wkt-logger'],
1414
function (ko, props, utils, validationHelper, wktLogger) {
1515

16-
return function(name, wdtModel, imageDomainHomePathProperty, imageDomainTypeProperty) {
16+
return function(name, wdtModel, imageDefinition) {
1717
function asLegalK8sName(observable) {
1818
return utils.toLegalK8sName(observable());
1919
}
2020

2121
function K8sDomainModel() {
22+
const DEFAULT_AUX_IMAGE_WDT_INSTALL_HOME = imageDefinition.wdtHomePath.value + '/weblogic-deploy';
23+
const DEFAULT_AUX_IMAGE_WDT_MODEL_HOME = imageDefinition.modelHomePath.value;
24+
2225
this.uid = props.createProperty(asLegalK8sName, wdtModel.domainName);
2326
this.uid.addValidator(...validationHelper.getK8sNameValidators());
2427

2528
this.kubernetesNamespace = props.createProperty('${1}-ns', this.uid.observable);
2629
this.kubernetesNamespace.addValidator(...validationHelper.getK8sNameValidators());
27-
this.domainHome = imageDomainHomePathProperty;
28-
this.domainType = imageDomainTypeProperty;
30+
this.domainHome = imageDefinition.domainHomePath;
31+
this.domainType = imageDefinition.targetDomainType;
2932

3033
this.domainPersistentVolumeName = props.createProperty('weblogic-domain-storage-volume');
3134
this.domainPersistentVolumeMountPath = props.createProperty('/shared');
@@ -49,9 +52,8 @@ define(['knockout', 'utils/observable-properties', 'utils/common-utilities', 'ut
4952
// These fields are exposed to the user only when using an existing Primary Image and
5053
// not using an Auxiliary Image at all.
5154
//
52-
this.imageModelHome = props.createProperty('/u01/wdt/models');
53-
this.imageWDTInstallHome = props.createProperty('/u01/wdt/weblogic-deploy');
54-
55+
this.imageModelHome = props.createProperty(imageDefinition.modelHomePath.value);
56+
this.imageWDTInstallHome = props.createProperty(imageDefinition.wdtHomePath.value);
5557

5658
// Auxiliary image-related properties
5759
this.auxImageRegistryPullRequireAuthentication = props.createProperty(false);
@@ -66,8 +68,8 @@ define(['knockout', 'utils/observable-properties', 'utils/common-utilities', 'ut
6668

6769
// These fields are exposed to the user only when using an existing Auxiliary Image.
6870
//
69-
this.auxImageSourceModelHome = props.createProperty('/auxiliary/models');
70-
this.auxImageSourceWDTInstallHome = props.createProperty('/auxiliary/weblogic-deploy');
71+
this.auxImageSourceModelHome = props.createProperty(DEFAULT_AUX_IMAGE_WDT_MODEL_HOME);
72+
this.auxImageSourceWDTInstallHome = props.createProperty(DEFAULT_AUX_IMAGE_WDT_INSTALL_HOME);
7173

7274
this.clusterKeys = [
7375
'uid', 'name', 'maxServers', 'replicas', 'minHeap', 'maxHeap', 'cpuRequest', 'cpuLimit', 'memoryRequest',

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

Lines changed: 2 additions & 2 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';
@@ -88,7 +88,7 @@ function (ko, wdtConstructor, imageConstructor, kubectlConstructor, domainConstr
8888
this.image = imageConstructor('image', this.wdtModel);
8989
this.ingress = ingressConstructor('ingress');
9090
this.kubectl = kubectlConstructor('kubectl');
91-
this.k8sDomain = domainConstructor('k8sDomain', this.wdtModel, this.image.domainHomePath, this.image.targetDomainType);
91+
this.k8sDomain = domainConstructor('k8sDomain', this.wdtModel, this.image);
9292
this.wko = wkoConstructor('wko');
9393
this.vzInstall = verrazzanoInstallConstructor('vzInstall');
9494
this.vzComponent = verrazzanoComponentConstructor('vzComponent', this.k8sDomain);

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
define(['models/wkt-project', 'utils/k8s-domain-configmap-generator', 'js-yaml', 'utils/i18n', 'utils/wkt-logger'],
99
function(project, K8sDomainConfigMapGenerator, jsYaml, i18n) {
1010
const WDT_DIR_NAME = 'weblogic-deploy';
11+
const DEFAULT_AUX_IMAGE_WDT_INSTALL_HOME = '/auxiliary/weblogic-deploy';
12+
const DEFAULT_AUX_IMAGE_WDT_MODEL_HOME = '/auxiliary/models';
1113

1214
class K8sDomainV9ResourceGenerator {
1315
constructor() {
@@ -249,10 +251,10 @@ define(['models/wkt-project', 'utils/k8s-domain-configmap-generator', 'js-yaml',
249251
if (usingExistingAuxImage()) {
250252
// If the source fields are exposed in the UI, use the values from those fields.
251253
//
252-
if (this.project.k8sDomain.auxImageSourceWDTInstallHome.hasValue()) {
254+
if (this.project.k8sDomain.auxImageSourceWDTInstallHome.value !== DEFAULT_AUX_IMAGE_WDT_INSTALL_HOME) {
253255
result.sourceWDTInstallHome = this.project.k8sDomain.auxImageSourceWDTInstallHome.value;
254256
}
255-
if (this.project.k8sDomain.auxImageSourceModelHome.hasValue()) {
257+
if (this.project.k8sDomain.auxImageSourceModelHome.value !== DEFAULT_AUX_IMAGE_WDT_MODEL_HOME) {
256258
result.sourceModelHome = this.project.k8sDomain.auxImageSourceModelHome.value;
257259
}
258260
} else {

0 commit comments

Comments
 (0)