Skip to content

Commit

Permalink
Merge pull request rancher#10111 from torchiaf/9892-missing-pools-pro…
Browse files Browse the repository at this point in the history
…viders-info

Hide provider labels for Harvester clusters
  • Loading branch information
torchiaf authored Jan 5, 2024
2 parents ab6cdfa + b5ec434 commit 338cd73
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions shell/config/harvester-manager-types.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export const NAME = 'harvesterManager';

export const KIND = { MACHINE_TEMPLATE: 'HarvesterMachineTemplate' };
4 changes: 2 additions & 2 deletions shell/detail/provisioning.cattle.io.cluster.vue
Original file line number Diff line number Diff line change
Expand Up @@ -775,10 +775,10 @@ export default {
v-clean-html="t('resourceTable.groupLabel.notInANodePool')"
/>
<div
v-if="group.ref && group.ref.template"
v-if="group.ref && group.ref.providerSummary"
class="description text-muted text-small"
>
{{ group.ref.providerDisplay }} &ndash; {{ group.ref.providerLocation }} / {{ group.ref.providerSize }} ({{ group.ref.providerName }})
{{ group.ref.providerSummary }}
</div>
</div>
<div
Expand Down
14 changes: 14 additions & 0 deletions shell/models/cluster.x-k8s.io.machinedeployment.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { handleConflict } from '@shell/plugins/dashboard-store/normalize';
import { MACHINE_ROLES } from '@shell/config/labels-annotations';
import { notOnlyOfRole } from '@shell/models/cluster.x-k8s.io.machine';
import { KIND } from '../config/elemental-types';
import { KIND as HARVESTER_KIND } from '../config/harvester-manager-types';

export default class CapiMachineDeployment extends SteveModel {
get cluster() {
Expand Down Expand Up @@ -69,6 +70,19 @@ export default class CapiMachineDeployment extends SteveModel {
return this.template?.providerSize || this.t('node.list.poolDescription.noSize');
}

get providerSummary() {
if (this.template) {
switch (this.infrastructureRefKind) {
case HARVESTER_KIND.MACHINE_TEMPLATE:
return null;
default:
return `${ this.providerDisplay } \u2013 ${ this.providerLocation } / ${ this.providerSize } (${ this.providerName })`;
}
}

return null;
}

get desired() {
return this.spec?.replicas || 0;
}
Expand Down

0 comments on commit 338cd73

Please sign in to comment.