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:
nasc17
2021-03-01 16:45:05 -08:00
committed by GitHub
parent 7d53e1c185
commit cf08963fc1
2 changed files with 19 additions and 3 deletions

View File

@@ -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(', ');