Skip to content

Commit

Permalink
Merge pull request #2167 from mantis-toboggan-md/release-2.5.4
Browse files Browse the repository at this point in the history
rke default profile update
  • Loading branch information
vincent99 committed Jan 6, 2021
2 parents 325b065 + 60031da commit 844ae9a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion edit/cis.cattle.io.clusterscan.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,20 @@ export default {
const profiles = this.defaultConfigMap.data;
const provider = this.currentCluster.status.provider;
const name = profiles[provider] || profiles.default;
let name = profiles[provider] || profiles.default;
if (name.includes(':')) {
const pairs = name.split('\n');
const clusterVersion = this.currentCluster.kubernetesVersion;
pairs.forEach((pair) => {
const version = (pair.match(/[<>=]+[-._a-zA-Z0-9]+/) || [])[0];
if (semver.satisfies(clusterVersion, version)) {
name = pair.replace(/[<>=]+[-._a-zA-Z0-9]+: /, '');
}
});
}
if (name) {
const profile = this.allProfiles.find(profile => profile.id === name);
const benchmarkVersion = profile?.spec?.benchmarkVersion;
Expand Down

0 comments on commit 844ae9a

Please sign in to comment.