mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-11-26 02:20:49 +08:00
Backup schedule checks are named after the schedule's condition reason,
such as "Proactive Schedule Suspend". The rule name used it lowercased,
spaces included, so Kubernetes refused it and the check could not be
ignored. Turn whatever a name can't have into hyphens. The rule keeps
the check as it is in its spec, which is what the controller matches.
(cherry picked from commit ee915249ce)
Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com>
Co-authored-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com>
This commit is contained in:
1 parent
fb892c2105
commit
d4a44ae9c6
2 files changed
+22
-4
No files matched your search
@@ -86,9 +86,12 @@ export function ignoredCounts(checks) {
|
||||
}, { checks: 0, resources: 0 });
|
||||
}
|
||||
|
||||
// the UI keeps one rule per check under this name, so Kubernetes refuses a second one for the same check
|
||||
// the UI keeps one rule per check under this name, so Kubernetes refuses a second one for the same check.
|
||||
// Some checks are named after a condition reason with spaces, like "Proactive Schedule Suspend", which a name can't have
|
||||
export function ignoreRuleName(componentHealthName, checkName) {
|
||||
return `${ componentHealthName }.${ checkName.toLowerCase() }`;
|
||||
const check = checkName.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');
|
||||
|
||||
return `${ componentHealthName }.${ check }`;
|
||||
}
|
||||
|
||||
export function affectedResourceKind(row) {
|
||||
|
||||
Reference in new issue
Block a user