From 6098a9bb044162f0844a83d929637b943597bc79 Mon Sep 17 00:00:00 2001 From: Gerrit91 Date: Mon, 9 Oct 2023 14:31:38 +0200 Subject: [PATCH] Naminh. --- cmd/metal-api/internal/issues/issues.go | 6 +++--- cmd/metal-api/internal/issues/severeties.go | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cmd/metal-api/internal/issues/issues.go b/cmd/metal-api/internal/issues/issues.go index c8e98ecbb..e05b5436e 100644 --- a/cmd/metal-api/internal/issues/issues.go +++ b/cmd/metal-api/internal/issues/issues.go @@ -12,7 +12,7 @@ type ( Config struct { Machines metal.Machines EventContainers metal.ProvisioningEventContainers - Severity IssueSeverity + Severity Severity Only []Type Omit []Type LastErrorThreshold time.Duration @@ -21,7 +21,7 @@ type ( // Issue formulates an issue of a machine Issue struct { Type Type - Severity IssueSeverity + Severity Severity Description string RefURL string Details string @@ -53,7 +53,7 @@ type ( // spec defines the specification of an issue. spec struct { Type Type - Severity IssueSeverity + Severity Severity Description string RefURL string } diff --git a/cmd/metal-api/internal/issues/severeties.go b/cmd/metal-api/internal/issues/severeties.go index 418f1babe..1cba9c32b 100644 --- a/cmd/metal-api/internal/issues/severeties.go +++ b/cmd/metal-api/internal/issues/severeties.go @@ -4,28 +4,28 @@ import "fmt" const ( // SeverityMinor is an issue that should be checked from time to time but has no bad effects for the user. - SeverityMinor IssueSeverity = "minor" + SeverityMinor Severity = "minor" // SeverityMajor is an issue where user experience is affected or provider resources are wasted. // overall functionality is still maintained though. major issues should be resolved as soon as possible. - SeverityMajor IssueSeverity = "major" + SeverityMajor Severity = "major" // SeverityCritical is an issue that can lead to disfunction of the system and need to be handled as quickly as possible. - SeverityCritical IssueSeverity = "critical" + SeverityCritical Severity = "critical" ) type ( - IssueSeverity string + Severity string ) -func AllSevereties() []IssueSeverity { - return []IssueSeverity{ +func AllSevereties() []Severity { + return []Severity{ SeverityMinor, SeverityMajor, SeverityCritical, } } -func SeverityFromString(input string) (IssueSeverity, error) { - switch IssueSeverity(input) { +func SeverityFromString(input string) (Severity, error) { + switch Severity(input) { case SeverityCritical: return SeverityCritical, nil case SeverityMajor: @@ -37,8 +37,8 @@ func SeverityFromString(input string) (IssueSeverity, error) { } } -func (s IssueSeverity) LowerThan(o IssueSeverity) bool { - smap := map[IssueSeverity]int{ +func (s Severity) LowerThan(o Severity) bool { + smap := map[Severity]int{ SeverityCritical: 10, SeverityMajor: 5, SeverityMinor: 0,