Skip to content

Commit

Permalink
feat: notification silence CRD
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Dec 20, 2024
1 parent 980dfad commit 83b4b00
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions models/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ type NotificationSilence struct {

ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
Namespace string `json:"namespace,omitempty"`
Name string `json:"name,omitempty"`
Filter types.CelExpression `json:"filter,omitempty"`
From time.Time `json:"from"`
Until time.Time `json:"until"`
Expand All @@ -194,6 +195,8 @@ type NotificationSilence struct {
UpdatedAt time.Time `json:"updated_at" time_format:"postgres_timestamp" gorm:"<-:false"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`

Selectors []types.ResourceSelector `json:"selectors,omitempty"`

// Error contains cel expression error in the filter
Error *string `json:"error,omitempty"`
}
Expand Down
10 changes: 10 additions & 0 deletions schema/notifications.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,11 @@ table "notification_silences" {
null = false
type = text
}
column "name" {
null = false
type = text
default = sql("generate_ulid()") # temporary default value to make the migration possible. we can remove this later.
}
column "description" {
null = true
type = text
Expand All @@ -241,6 +246,11 @@ table "notification_silences" {
null = true
type = text
}
column "selectors" {
null = true
type = jsonb
comment = "list of resource selectors"
}
column "error" {
null = true
type = text
Expand Down

0 comments on commit 83b4b00

Please sign in to comment.