Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions electron/app/locales/en/webui.json
Original file line number Diff line number Diff line change
Expand Up @@ -1439,6 +1439,8 @@
"vz-install-design-install-jaeger-help": "Whether to install the optional Jaeger transaction tracing component.",
"vz-install-design-istio-sampling-label": "Istio Tracing Sampling Rate",
"vz-install-design-istio-sampling-help": "The percentage of Istio requests that will be traced in Jaeger.",
"vz-install-design-install-argocd-label": "Install Argo CD",
"vz-install-design-install-argocd-help": "Whether to install the optional Argo CD continuous delivery component.",

"vz-installer-aborted-error-title": "Installing Verrazzano Aborted",
"vz-installer-kubectl-exe-invalid-error-message": "Unable to install Verrazzano because the Kubernetes client executable is invalid: {{error}}.",
Expand Down
3 changes: 2 additions & 1 deletion webui/src/js/models/vz-install-definition.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license
* Copyright (c) 2022, Oracle and/or its affiliates.
* Copyright (c) 2022, 2023, Oracle and/or its affiliates.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/
'use strict';
Expand All @@ -20,6 +20,7 @@ define(['utils/observable-properties'],
this.actualInstalledVersion = props.createProperty();
this.installJaeger = props.createProperty(false);
this.istioSamplingRate = props.createProperty(1);
this.installArgoCD = props.createProperty(false);

this.readFrom = (json) => {
props.createGroup(name, this).readFrom(json);
Expand Down
18 changes: 17 additions & 1 deletion webui/src/js/utils/vz-install-resource-generator.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license
* Copyright (c) 2022, Oracle and/or its affiliates.
* Copyright (c) 2022, 2023, Oracle and/or its affiliates.
* Licensed under The Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl/
*/
'use strict';
Expand Down Expand Up @@ -46,6 +46,22 @@ define(['models/wkt-project', 'js-yaml', 'utils/vz-helper', 'utils/i18n', 'utils
});
}
}

const vzVersionTag = this.project.vzInstall.versionTag.value;
let isArgoAvailable = false;
if (vzVersionTag) {
const vzVersionToInstall = vzVersionTag.slice(1);
isArgoAvailable = window.api.utils.compareVersions(vzVersionToInstall, '1.5.0') >= 0;
}

if (isArgoAvailable && this.project.vzInstall.installArgoCD.value) {
if (!data.spec.components) {
data.spec.components = {};
}
data.spec.components.argoCD = {
enabled: true
};
}
return jsYaml.dump(data).split('\n');
}

Expand Down
32 changes: 30 additions & 2 deletions webui/src/js/viewModels/vz-install-design-view.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license
* Copyright (c) 2022, Oracle and/or its affiliates.
* Copyright (c) 2022, 2023, Oracle and/or its affiliates.
* Licensed under The Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl/
*/
'use strict';
Expand All @@ -15,11 +15,23 @@ define(['models/wkt-project', 'accUtils', 'utils/common-utilities', 'knockout',
function (project, accUtils, utils, ko, i18n, screenUtils, BufferingDataProvider, ArrayDataProvider) {
function VerrazzanoInstallDesignViewModel() {

const subscriptions = [];

this.connected = () => {
accUtils.announce('Verrazzano Install Design View page loaded.', 'assertive');

subscriptions.push(this.project.vzInstall.actualInstalledVersion.observable.subscribe(newTagValue => {
this.computedArgoCDAvailabilityFromVersion(newTagValue);
}));

this.computedArgoCDAvailabilityFromVersion();
};

this.disconnected = () => { };
this.disconnected = () => {
subscriptions.forEach((subscription) => {
subscription.dispose();
});
};

this.labelMapper = (labelId, payload) => {
if (labelId.startsWith('page-design-')) {
Expand Down Expand Up @@ -49,6 +61,22 @@ function (project, accUtils, utils, ko, i18n, screenUtils, BufferingDataProvider
return { ...versionObject, label };
}));
});

this.isArgoCDAvailable = ko.observable(false);
this.computedArgoCDAvailabilityFromVersion = (versionTag = undefined) => {
const vzInstallVersionTag = versionTag ? versionTag : this.project.vzInstall.versionTag.observable();

let result = false; // for now, assume that Verrazzano 1.4.x and below are the most common.
if (vzInstallVersionTag) {
const vzInstallVersion = vzInstallVersionTag.slice(1);
if (window.api.utils.compareVersions(vzInstallVersion, '1.5.0') >= 0) {
result = true;
}
}
if (this.isArgoCDAvailable() !== result) {
this.isArgoCDAvailable(result);
}
};
}
return VerrazzanoInstallDesignViewModel;
});
10 changes: 9 additions & 1 deletion webui/src/js/views/vz-install-design-view.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright (c) 2022, Oracle and/or its affiliates.
Copyright (c) 2022, 2023, Oracle and/or its affiliates.
Licensed under The Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl/
-->
<h6 class="wkt-subheading"><oj-bind-text value="[[labelMapper('title')]]"></oj-bind-text></h6>
Expand Down Expand Up @@ -35,4 +35,12 @@ <h6 class="wkt-subheading"><oj-bind-text value="[[labelMapper('title')]]"></oj-b
</oj-input-number>
</oj-bind-if>
</oj-form-layout>
<oj-bind-if test="[[isArgoCDAvailable]]">
<oj-form-layout max-columns="1" direction="row">
<oj-switch label-hint="[[labelMapper('install-argocd-label')]]"
value="{{project.vzInstall.installArgoCD.observable}}"
help.instruction="[[labelMapper('install-argocd-help')]]">
</oj-switch>
</oj-form-layout>
</oj-bind-if>
</div>