2
0

deployment_notifier.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package notifier
  2. import "time"
  3. type Notifier interface {
  4. Notify(opts *NotifyOpts) error
  5. }
  6. type DeploymentStatus string
  7. const (
  8. StatusHelmDeployed DeploymentStatus = "helm_deployed"
  9. StatusPodCrashed DeploymentStatus = "pod_crashed"
  10. StatusHelmFailed DeploymentStatus = "helm_failed"
  11. )
  12. type NotifyOpts struct {
  13. // ProjectID is the id of the Porter project that this deployment belongs to
  14. ProjectID uint
  15. // ClusterID is the id of the Porter cluster that this deployment belongs to
  16. ClusterID uint
  17. // ClusterName is the name of the cluster that this deployment was deployed in
  18. ClusterName string
  19. // Status is the current status of the deployment.
  20. Status DeploymentStatus
  21. // Info is any additional information about this status, such as an error message if
  22. // the deployment failed.
  23. Info string
  24. // Name is the name of the deployment that this notification refers to.
  25. Name string
  26. // Namespace is the Kubernetes namespace of the deployment that this notification refers to.
  27. Namespace string
  28. URL string
  29. Timestamp *time.Time
  30. Version int
  31. }