Skip to content

Commit

Permalink
rke default profile update
Browse files Browse the repository at this point in the history
  • Loading branch information
mantis-toboggan-md committed Jan 5, 2021
1 parent d68de22 commit 60031da
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 60031da

Please sign in to comment.