mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Node configuration needs to show different size for data and logs volume for postgresql. (#14466)
* Included storage size of log and data * Added backups and removed putting 0 * Added localized constants
This commit is contained in:
@@ -192,6 +192,9 @@ export function instanceDeleted(name: string): string { return localize('arc.ins
|
||||
export function instanceUpdated(name: string): string { return localize('arc.instanceUpdated', "Instance '{0}' updated", name); }
|
||||
export function copiedToClipboard(name: string): string { return localize('arc.copiedToClipboard', "{0} copied to clipboard", name); }
|
||||
export function clickTheTroubleshootButton(resourceType: string): string { return localize('arc.clickTheTroubleshootButton', "Click the troubleshoot button to open the Azure Arc {0} troubleshooting notebook.", resourceType); }
|
||||
export function dataStorage(value: string): string { return localize('arc.dataStorage', "{0} data", value); }
|
||||
export function logStorage(value: string): string { return localize('arc.logStorage', "{0} log", value); }
|
||||
export function backupsStorage(value: string): string { return localize('arc.backupsStorage', "{0} backups", value); }
|
||||
export function numVCores(vCores: string | undefined): string {
|
||||
if (vCores && +vCores > 0) {
|
||||
if (+vCores === 1) {
|
||||
|
||||
@@ -76,7 +76,9 @@ export class PostgresModel extends ResourceModel {
|
||||
const ramLimit = this._config.spec.scheduling?.default?.resources?.limits?.memory;
|
||||
const cpuRequest = this._config.spec.scheduling?.default?.resources?.requests?.cpu;
|
||||
const ramRequest = this._config.spec.scheduling?.default?.resources?.requests?.memory;
|
||||
const storage = this._config.spec.storage?.data?.size;
|
||||
const dataStorage = this._config.spec.storage?.data?.size;
|
||||
const logStorage = this._config.spec.storage?.logs?.size;
|
||||
const backupsStorage = this._config.spec.storage?.backups?.size;
|
||||
|
||||
// scale.shards was renamed to scale.workers. Check both for backwards compatibility.
|
||||
const scale = this._config.spec.scale;
|
||||
@@ -94,8 +96,19 @@ export class PostgresModel extends ResourceModel {
|
||||
configuration.push(`${ramLimit ?? ramRequest!} ${loc.ram}`);
|
||||
}
|
||||
|
||||
if (storage) {
|
||||
configuration.push(`${storage} ${loc.storagePerNode}`);
|
||||
let storage: string[] = [];
|
||||
if (dataStorage) {
|
||||
storage.push(loc.dataStorage(dataStorage));
|
||||
}
|
||||
if (logStorage) {
|
||||
storage.push(loc.logStorage(logStorage));
|
||||
}
|
||||
if (backupsStorage) {
|
||||
storage.push(loc.backupsStorage(backupsStorage));
|
||||
}
|
||||
if (dataStorage || logStorage || backupsStorage) {
|
||||
storage.push(`${loc.storagePerNode}`);
|
||||
configuration.push(storage.join(' '));
|
||||
}
|
||||
|
||||
return configuration.join(', ');
|
||||
|
||||
Reference in New Issue
Block a user