Skip to content

Commit

Permalink
Add warning when delete managed App
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Torchia <[email protected]>
  • Loading branch information
torchiaf committed Mar 5, 2024
1 parent 275d17f commit bbea223
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
14 changes: 8 additions & 6 deletions shell/assets/translations/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -890,12 +890,11 @@ catalog:
chart: Chart
warning:
managed:
edit:
Warning, Rancher manages deployment and upgrade of the {name} app. Upgrading this app is not supported.<br>
{version, select,
null { }
other { Under most circumstances, no user intervention should be needed to ensure that the {version} version is compatible with the version of Rancher that you are running.}
}
Warning, Rancher manages deployment and upgrade of the {name} app. Upgrading this app is not supported.<br>
{version, select,
null { }
other { Under most circumstances, no user intervention should be needed to ensure that the {version} version is compatible with the version of Rancher that you are running.}
}
error:
requiresFound: '<a href="{url}">{name}</a> must be installed before you can install this chart.'
requiresMissing: 'This chart requires another chart that provides {name}, but none was was found.'
Expand Down Expand Up @@ -989,6 +988,9 @@ catalog:
current: '{ver} (Current)'
linux: '{ver} (Linux-only)'
windows: '{ver} (Windows-only)'
delete:
warning:
managed: Warning, Rancher manages deployment and upgrade of the {name} app. Deleting this app is not supported.
operation:
tableHeaders:
action: Action
Expand Down
2 changes: 1 addition & 1 deletion shell/mixins/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export default {
}

if (this.existing && this.existing.upgradeAvailable === false) {
warnings.unshift(this.t('catalog.install.warning.managed.edit', {
warnings.unshift(this.t('catalog.install.warning.managed', {
name: this.existing.name,
version: this.chart ? this.query.versionName : null
}, true));
Expand Down
8 changes: 8 additions & 0 deletions shell/models/catalog.cattle.io.app.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ export default class CatalogApp extends SteveModel {
return out;
}

get warnDeletionMessage() {
if (this.upgradeAvailable === false) {
return this.t('catalog.delete.warning.managed', { name: this.name });
}

return null;
}

matchingChart(includeHidden) {
const chart = this.spec?.chart;

Expand Down

0 comments on commit bbea223

Please sign in to comment.