// validateTimeWindow will validate that Sloth only supports 30 day based time windows
// we need this because time windows are a required by OpenSLO.
validateTimeWindow will validate that Sloth only supports 30 day based time windows
we need this because time windows are a required by OpenSLO.
// validateTimeWindow will validate that Sloth only supports 30 day based time windows // we need this because time windows are a required by OpenSLO .
func (yamlSpecLoader) validateTimeWindow(spec openslov1alpha.SLO) error {
	if len(spec.Spec.TimeWindows) != 1 {
		return fmt.Errorf("only 1 time window is supported")
	}
	t := spec.Spec.TimeWindows[0]
	if t.Count != 30 && strings.ToLower(t.Unit) == "day" {
		return fmt.Errorf("only 30 days time window is supported")
	}
	return nil
}
func ( yamlSpecLoader ) validateTimeWindow ( spec openslov1alpha . SLO ) error { if len ( spec . Spec . TimeWindows ) != 1 { return fmt . Errorf ( " " ) } t := spec . Spec . TimeWindows [ 0 ] if t . Count != 30 && strings . ToLower ( t . Unit ) == " " { return fmt . Errorf ( " " ) } return nil }
validateTimeWindow will validate that Sloth only supports 30 day based time windows
we need this because time windows are a required by OpenSLO.
validateTimeWindow will validate that Sloth only supports 30 day based time windows we need this because time windows are a required by OpenSLO .