diff --git a/models/notifications.go b/models/notifications.go index c412b8e8..5c14f6ef 100644 --- a/models/notifications.go +++ b/models/notifications.go @@ -141,17 +141,18 @@ func (t NotificationSilenceResource) Empty() bool { type NotificationSilence struct { NotificationSilenceResource `json:",inline" yaml:",inline"` - ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"` - Namespace string `json:"namespace,omitempty"` - From time.Time `json:"from"` - Until time.Time `json:"until"` - Source string `json:"source"` - Recursive bool `json:"recursive"` - Description string `json:"description,omitempty"` - CreatedBy *uuid.UUID `json:"created_by,omitempty"` - CreatedAt time.Time `json:"created_at" time_format:"postgres_timestamp" gorm:"<-:false"` - UpdatedAt time.Time `json:"updated_at" time_format:"postgres_timestamp" gorm:"<-:false"` - DeletedAt *time.Time `json:"deleted_at,omitempty"` + ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"` + Namespace string `json:"namespace,omitempty"` + Filter types.CelExpression `json:"filter,omitempty"` + From time.Time `json:"from"` + Until time.Time `json:"until"` + Source string `json:"source"` + Recursive bool `json:"recursive"` + Description string `json:"description,omitempty"` + CreatedBy *uuid.UUID `json:"created_by,omitempty"` + CreatedAt time.Time `json:"created_at" time_format:"postgres_timestamp" gorm:"<-:false"` + UpdatedAt time.Time `json:"updated_at" time_format:"postgres_timestamp" gorm:"<-:false"` + DeletedAt *time.Time `json:"deleted_at,omitempty"` } func (n NotificationSilence) AsMap(removeFields ...string) map[string]any { diff --git a/schema/notifications.hcl b/schema/notifications.hcl index 5ad1d9cd..92688b8d 100644 --- a/schema/notifications.hcl +++ b/schema/notifications.hcl @@ -208,6 +208,10 @@ table "notification_silences" { null = true type = text } + column "filter" { + null = true + type = text + } column "from" { null = false type = timestamptz @@ -299,4 +303,4 @@ table "notification_silences" { on_update = NO_ACTION on_delete = NO_ACTION } -} \ No newline at end of file +} diff --git a/types/resource_selector.go b/types/resource_selector.go index 8e1c90ad..b4b1bdd9 100644 --- a/types/resource_selector.go +++ b/types/resource_selector.go @@ -21,6 +21,7 @@ type ComponentConfigTraversalArgs struct { Direction string `yaml:"direction,omitempty" json:"direction,omitempty"` } +// +kubebuilder:object:generate=true type Functions struct { // It uses the config_id linked to the componentID to lookup up all the config relations and returns // a list of componentIDs that are linked to the found configIDs diff --git a/types/zz_generated.deepcopy.go b/types/zz_generated.deepcopy.go index 6a69e995..cdc84c39 100644 --- a/types/zz_generated.deepcopy.go +++ b/types/zz_generated.deepcopy.go @@ -172,6 +172,26 @@ func (in *EnvVarSource) DeepCopy() *EnvVarSource { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Functions) DeepCopyInto(out *Functions) { + *out = *in + if in.ComponentConfigTraversal != nil { + in, out := &in.ComponentConfigTraversal, &out.ComponentConfigTraversal + *out = new(ComponentConfigTraversalArgs) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Functions. +func (in *Functions) DeepCopy() *Functions { + if in == nil { + return nil + } + out := new(Functions) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HTTPBasicAuth) DeepCopyInto(out *HTTPBasicAuth) { *out = *in @@ -324,6 +344,7 @@ func (in *Property) DeepCopy() *Property { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ResourceSelector) DeepCopyInto(out *ResourceSelector) { *out = *in + in.Functions.DeepCopyInto(&out.Functions) if in.Types != nil { in, out := &in.Types, &out.Types *out = make(Items, len(*in))