Use a typed escalation fallback instead of fallbackTopic
TerdutTeam spec.escalation.fallback is now {type, address}, mirroring the
server's notification channel model. CRDs regenerated.
Claude-Session: https://claude.ai/code/session_016mBLURvJoMuUEr9cB2RpUN
This commit is contained in:
@@ -94,6 +94,24 @@ type EscalationLevel struct {
|
||||
Targets []EscalationTarget `json:"targets"`
|
||||
}
|
||||
|
||||
// NotificationTarget is somewhere a page can go without belonging to a person:
|
||||
// a notification provider the server has configured, and an address that
|
||||
// provider understands.
|
||||
type NotificationTarget struct {
|
||||
// type is the notification provider, e.g. "ntfy". The server refuses a
|
||||
// provider it has not been configured with.
|
||||
// +required
|
||||
// +kubebuilder:validation:MinLength=1
|
||||
// +kubebuilder:validation:MaxLength=32
|
||||
Type string `json:"type"`
|
||||
|
||||
// address is where that provider delivers it: an ntfy topic, say.
|
||||
// +required
|
||||
// +kubebuilder:validation:MinLength=1
|
||||
// +kubebuilder:validation:MaxLength=256
|
||||
Address string `json:"address"`
|
||||
}
|
||||
|
||||
// EscalationSpec is a team's escalation ladder.
|
||||
type EscalationSpec struct {
|
||||
// +kubebuilder:validation:Minimum=0
|
||||
@@ -101,8 +119,10 @@ type EscalationSpec struct {
|
||||
// +optional
|
||||
RepeatCount int64 `json:"repeatCount,omitempty"`
|
||||
|
||||
// fallback is paged once when the ladder has run out of levels and repeats.
|
||||
// Omitted, the chain just ends there.
|
||||
// +optional
|
||||
FallbackTopic string `json:"fallbackTopic,omitempty"`
|
||||
Fallback *NotificationTarget `json:"fallback,omitempty"`
|
||||
|
||||
// +required
|
||||
// +kubebuilder:validation:MinItems=1
|
||||
|
||||
@@ -110,6 +110,11 @@ func (in *EscalationLevel) DeepCopy() *EscalationLevel {
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *EscalationSpec) DeepCopyInto(out *EscalationSpec) {
|
||||
*out = *in
|
||||
if in.Fallback != nil {
|
||||
in, out := &in.Fallback, &out.Fallback
|
||||
*out = new(NotificationTarget)
|
||||
**out = **in
|
||||
}
|
||||
if in.Levels != nil {
|
||||
in, out := &in.Levels, &out.Levels
|
||||
*out = make([]EscalationLevel, len(*in))
|
||||
@@ -189,6 +194,21 @@ func (in *NetworkingSpec) DeepCopy() *NetworkingSpec {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NotificationTarget) DeepCopyInto(out *NotificationTarget) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NotificationTarget.
|
||||
func (in *NotificationTarget) DeepCopy() *NotificationTarget {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NotificationTarget)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NotifySpec) DeepCopyInto(out *NotifySpec) {
|
||||
*out = *in
|
||||
|
||||
Reference in New Issue
Block a user