Skip to content

Commit

Permalink
chore: Correct Alert Method type names (#476)
Browse files Browse the repository at this point in the history
## Motivation

Having sth like `v1alpha.Email` in the namespace is way too vague, we
need more specific naming, that's why we need a prefix.
  • Loading branch information
nieomylnieja authored Jul 1, 2024
1 parent 4bf666a commit f08abc7
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 56 deletions.
4 changes: 2 additions & 2 deletions manifest/v1alpha/alert_methods.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package v1alpha

//go:generate ../../bin/go-enum --values --noprefix
//go:generate ../../bin/go-enum --values

// DataSourceType represents the specific type of alert method.
// AlertMethodType represents the specific type of alert method.
//
/* ENUM(
Webhook = 1
Expand Down
90 changes: 45 additions & 45 deletions manifest/v1alpha/alert_methods_enum.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions manifest/v1alpha/alertmethod/alert_method.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,23 @@ type Spec struct {
func (s Spec) GetType() (v1alpha.AlertMethodType, error) {
switch {
case s.Webhook != nil:
return v1alpha.Webhook, nil
return v1alpha.AlertMethodTypeWebhook, nil
case s.PagerDuty != nil:
return v1alpha.PagerDuty, nil
return v1alpha.AlertMethodTypePagerDuty, nil
case s.Slack != nil:
return v1alpha.Slack, nil
return v1alpha.AlertMethodTypeSlack, nil
case s.Discord != nil:
return v1alpha.Discord, nil
return v1alpha.AlertMethodTypeDiscord, nil
case s.Opsgenie != nil:
return v1alpha.Opsgenie, nil
return v1alpha.AlertMethodTypeOpsgenie, nil
case s.ServiceNow != nil:
return v1alpha.ServiceNow, nil
return v1alpha.AlertMethodTypeServiceNow, nil
case s.Jira != nil:
return v1alpha.Jira, nil
return v1alpha.AlertMethodTypeJira, nil
case s.Teams != nil:
return v1alpha.Teams, nil
return v1alpha.AlertMethodTypeTeams, nil
case s.Email != nil:
return v1alpha.Email, nil
return v1alpha.AlertMethodTypeEmail, nil
}
return 0, errors.New("unknown alert method type")
}
Expand Down

0 comments on commit f08abc7

Please sign in to comment.