disable cluster link if harvester version lower than v1.3.0

Signed-off-by: andy.lee <andy.lee@suse.com>
This commit is contained in:
andy.lee
2024-11-12 11:50:42 +01:00
committed by Francesco Torchia
parent 244a3f8e06
commit b566caf2e1
4 changed files with 40 additions and 2 deletions
@@ -2,7 +2,8 @@ import ProvCluster from '@shell/models/provisioning.cattle.io.cluster';
import { DEFAULT_WORKSPACE, HCI, MANAGEMENT } from '@shell/config/types';
import { HARVESTER_NAME, HARVESTER_NAME as VIRTUAL } from '@shell/config/features';
import { SETTING } from '@shell/config/settings';
import semver from 'semver';
import { serverVersion } from '../utils/feature-flags';
export default class HciCluster extends ProvCluster {
get stateObj() {
return this._stateObj;
@@ -29,6 +30,26 @@ export default class HciCluster extends ProvCluster {
return false;
}
get stateDescription() {
if (!this.isSupportedHarvesterVersion) {
return this.t('harvesterManager.cluster.supportMessage');
}
return '';
}
/**
* harvester ui extension only supports harvester cluster version >= 1.3.0
*/
get isSupportedHarvesterVersion() {
const version = serverVersion(this.$rootGetters);
// eslint-disable-next-line no-console
console.log('🚀 ~ HciCluster ~ getisSupportedHarvesterVersion ~ version:', version);
return semver.gte(version, '1.3.0');
}
/**
* Fetch and cache the response for /ui-info
*