Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
removes redundant code
Browse files Browse the repository at this point in the history
Signed-off-by: Joerg Poecher <[email protected]>
  • Loading branch information
j-poecher committed May 9, 2022
1 parent 92325b9 commit 3cd1e6a
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions internal/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,8 @@ const (
// This will return a SLO object or an error if parsing was not possible
func ParseSLOFromString(customName string) (*keptncommon.SLO, error) {
result := &keptncommon.SLO{
Weight: 1,
KeySLI: false,
Pass: []*keptncommon.SLOCriteria{},
Warning: []*keptncommon.SLOCriteria{},
Weight: 1,
KeySLI: false,
}
var errs []error

Expand Down Expand Up @@ -197,15 +195,6 @@ func ParseSLOFromString(customName string) (*keptncommon.SLO, error) {
}
}

// if we have no criteria for warn or pass we just return nil
// not having a value for 'pass' means: this SLI is for informational purposes only and will not be evaluated.
if len(result.Pass) == 0 {
result.Pass = nil
}
if len(result.Warning) == 0 {
result.Warning = nil
}

if len(errs) > 0 {
return nil, &SLODefinitionError{
sliName: result.SLI,
Expand Down

0 comments on commit 3cd1e6a

Please sign in to comment.