Skip to content

Commit

Permalink
[FEAT] Added support for cluster-repo-name label for app upgrades (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
eva-vashkevich authored Oct 16, 2024
1 parent 2402307 commit 614826f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
11 changes: 6 additions & 5 deletions shell/config/labels-annotations.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,12 @@ export const CATALOG = {
_CLUSTER_TPL: 'cluster-template',
_CLUSTER_TOOL: 'cluster-tool',

COMPONENT: 'catalog.cattle.io/ui-component',
SOURCE_REPO_TYPE: 'catalog.cattle.io/ui-source-repo-type',
SOURCE_REPO_NAME: 'catalog.cattle.io/ui-source-repo',
COLOR: 'catalog.cattle.io/ui-color',
DISPLAY_NAME: 'catalog.cattle.io/display-name',
COMPONENT: 'catalog.cattle.io/ui-component',
SOURCE_REPO_TYPE: 'catalog.cattle.io/ui-source-repo-type',
SOURCE_REPO_NAME: 'catalog.cattle.io/ui-source-repo',
COLOR: 'catalog.cattle.io/ui-color',
DISPLAY_NAME: 'catalog.cattle.io/display-name',
CLUSTER_REPO_NAME: 'catalog.cattle.io/cluster-repo-name',

SUPPORTED_OS: 'catalog.cattle.io/os',
PERMITTED_OS: 'catalog.cattle.io/permits-os',
Expand Down
7 changes: 4 additions & 3 deletions shell/models/catalog.cattle.io.app.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@ export default class CatalogApp extends SteveModel {
}

const chartName = chart.metadata?.name;
const preferRepoType = chart.metadata?.annotations?.[CATALOG_ANNOTATIONS.SOURCE_REPO_TYPE];
const preferRepoName = chart.metadata?.annotations?.[CATALOG_ANNOTATIONS.SOURCE_REPO_NAME];
const repoName = chart.metadata?.annotations?.[CATALOG_ANNOTATIONS.SOURCE_REPO_NAME] || this.metadata?.labels?.[CATALOG_ANNOTATIONS.CLUSTER_REPO_NAME];
const preferRepoType = chart.metadata?.annotations?.[CATALOG_ANNOTATIONS.SOURCE_REPO_TYPE] || 'cluster';

const match = this.$rootGetters['catalog/chart']({
chartName,
repoName,
preferRepoType,
preferRepoName,
includeHidden
});

Expand Down

0 comments on commit 614826f

Please sign in to comment.