Documentation ¶
Index ¶
- func CreateResource(t *testing.T, obj CreateObjects)
- func DeleteResource(t *testing.T, obj DeleteObjects)
- func UpdateResource(t *testing.T, obj UpdateObjects) (*unstructured.Unstructured, *unstructured.Unstructured)
- type CreateObjects
- type DeleteObjects
- type ErrorEvent
- type SlackMessage
- type UpdateObjects
- type WebhookPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateResource ¶
func CreateResource(t *testing.T, obj CreateObjects)
CreateResource with fake client
func DeleteResource ¶ added in v0.12.0
func DeleteResource(t *testing.T, obj DeleteObjects)
DeleteResource deletes the obj with fake client
func UpdateResource ¶ added in v0.12.0
func UpdateResource(t *testing.T, obj UpdateObjects) (*unstructured.Unstructured, *unstructured.Unstructured)
UpdateResource Create and update the obj and return old and new obj
Types ¶
type CreateObjects ¶
type CreateObjects struct { GVR schema.GroupVersionResource Kind string Namespace string Specs runtime.Object NotifType config.NotifType ExpectedWebhookPayload WebhookPayload ExpectedSlackMessage SlackMessage }
CreateObjects stores specs for creating a k8s fake object and expected Slack response
type DeleteObjects ¶ added in v0.12.0
type DeleteObjects struct { GVR schema.GroupVersionResource Kind string Namespace string Name string Specs runtime.Object ExpectedWebhookPayload WebhookPayload ExpectedSlackMessage SlackMessage }
DeleteObjects stores specs for deleting a k8s fake object
type ErrorEvent ¶ added in v0.12.0
type ErrorEvent struct { GVR schema.GroupVersionResource Kind string Namespace string Name string Specs runtime.Object ExpectedWebhookPayload WebhookPayload ExpectedSlackMessage SlackMessage }
ErrorEvent stores specs for throwing an error in case of anomalies
type SlackMessage ¶
type SlackMessage struct { Text string Attachments []slack.Attachment }
SlackMessage structure
type UpdateObjects ¶ added in v0.12.0
type UpdateObjects struct { GVR schema.GroupVersionResource Kind string Namespace string Name string Specs runtime.Object Patch []byte Diff string UpdateSetting config.UpdateSetting NotifType config.NotifType ExpectedWebhookPayload WebhookPayload ExpectedSlackMessage SlackMessage }
UpdateObjects stores specs and patch for updating a k8s fake object and expected Slack response
type WebhookPayload ¶
type WebhookPayload struct { Summary string `json:"summary"` EventMeta notify.EventMeta `json:"meta"` EventStatus notify.EventStatus `json:"status"` }
WebhookPayload structure
Click to show internal directories.
Click to hide internal directories.