-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
871 additions
and
694 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
type ( | ||
AlertConfigSpec struct { | ||
// +kubebuilder:validation:Optional | ||
Discord *AlertDiscordSpec `json:"discord,omitempty"` | ||
} | ||
|
||
// AlertDiscordSpec defines the desired state of AlertDiscord | ||
AlertDiscordSpec struct { | ||
// +kubebuilder:validation:Required | ||
WebhookURL ValueOrValueFrom `json:"webhookURL"` | ||
|
||
// +kubebuilder:validation:Optional | ||
// +kubebuilder:description:List of users or roles to notify. | ||
Mentions []string `json:"mentions,omitempty"` | ||
|
||
// +kubebuilder:validation:Optional | ||
// +kubebuilder:description:Timeout specifies a time limit for the request to be made. | ||
// +kubebuilder:default:10s | ||
Timeout string `json:"timeout,omitempty"` | ||
|
||
// +kubebuilder:validation:Optional | ||
// +kubebuilder:validation:Schemaless | ||
// +kubebuilder:validation:Type=string | ||
TemplateBody string `json:"templateBody,omitempty"` | ||
} | ||
|
||
// AlertDiscordStatus defines the observed state of AlertDiscord | ||
AlertConfigStatus struct{} | ||
) | ||
|
||
// +kubebuilder:object:root=true | ||
// +kubebuilder:subresource:status | ||
// +kubebuilder:resource:path=alertconfig,scope=Cluster | ||
|
||
type AlertConfig struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec AlertConfigSpec `json:"spec,omitempty"` | ||
Status AlertConfigStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
type AlertConfigList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []AlertConfig `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&AlertConfig{}, &AlertConfigList{}) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package v1alpha1 | ||
|
||
import ( | ||
corev1 "k8s.io/api/core/v1" | ||
) | ||
|
||
type ( | ||
ValueOrValueFrom struct { | ||
// Value is a string value to assign to the key. | ||
// if ValueFrom is specified, this value is ignored. | ||
// +optional | ||
Value string `json:"value,omitempty"` | ||
|
||
// ValueFrom is a reference to a field in a secret or config map. | ||
// +optional | ||
ValueFrom *ValueFromSource `json:"valueFrom,omitempty"` | ||
} | ||
|
||
// ValueFromSource is a reference to a field in a secret or config map. | ||
ValueFromSource struct { | ||
// SecretKeyRef is a reference to a field in a secret. | ||
// +optional | ||
SecretKeyRef *corev1.SecretKeySelector `json:"secretKeyRef,omitempty"` | ||
|
||
// ConfigMapKeyRef is a reference to a field in a config map. | ||
// +optional | ||
ConfigMapKeyRef *corev1.ConfigMapKeySelector `json:"configMapKeyRef,omitempty"` | ||
|
||
// AlertConfigRef is a reference to a field in an alert configuration. | ||
// +optional | ||
AlertConfigRef *corev1.LocalObjectReference `json:"alertConfigRef,omitempty"` | ||
} | ||
) |
Oops, something went wrong.