Skip to content

Commit 60ed6a4

Browse files
momesginMo Mesgin
and
Mo Mesgin
authored
Disallow matching charts with undefined values (#13724)
Co-authored-by: Mo Mesgin <[email protected]>
1 parent 622bdd1 commit 60ed6a4

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

shell/models/__tests__/catalog.cattle.io.app.test.ts

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import CatalogApp from '@shell/models/catalog.cattle.io.app';
22
import { APP_UPGRADE_STATUS } from '@shell/store/catalog';
3+
import { CATALOG as CATALOG_ANNOTATIONS } from '@shell/config/labels-annotations';
34

45
const latestVersion = '1.16.2';
56
const secondLatestVersion = '1.16.1';
@@ -88,9 +89,10 @@ const certManagerOfficialMatchingChart2 = {
8889

8990
const installedCertManagerAppCoFromRancherUI = {
9091
metadata: {
91-
name: chartName,
92-
home: appCo.home,
93-
version: secondLatestVersion
92+
annotations: { [CATALOG_ANNOTATIONS.SOURCE_REPO_NAME]: appCo.repoName },
93+
name: chartName,
94+
home: appCo.home,
95+
version: secondLatestVersion
9496
}
9597
};
9698

@@ -104,9 +106,10 @@ const installedCertManagerOfficialFromCli = {
104106

105107
const installedCertManagerOfficialFromRancherUI = {
106108
metadata: {
107-
name: chartName,
108-
home: certManagerOfficial.oldHome,
109-
version: secondLatestVersion
109+
annotations: { [CATALOG_ANNOTATIONS.SOURCE_REPO_NAME]: certManagerOfficial.repoName },
110+
name: chartName,
111+
home: certManagerOfficial.oldHome,
112+
version: secondLatestVersion
110113
}
111114
};
112115

shell/models/catalog.cattle.io.app.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ export default class CatalogApp extends SteveModel {
9090
const { version, home } = versions[i];
9191

9292
// Finding the exact version, if the version is not there, then most likely it's not a match
93-
// if the exact version is found, then we can compare the home values when they exist
94-
if (version === this.currentVersion && (!home || !thisHome || home === thisHome)) {
93+
// if the exact version is found, then we can compare the home value
94+
if (version === this.currentVersion && (home === thisHome)) {
9595
return true;
9696
}
9797
}

0 commit comments

Comments
 (0)