release.go 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. package types
  2. import (
  3. "helm.sh/helm/v3/pkg/release"
  4. metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
  5. )
  6. // Release is a helm release with a form attached
  7. type Release struct {
  8. *release.Release
  9. *PorterRelease
  10. Form *FormYAML `json:"form,omitempty"`
  11. }
  12. type PorterRelease struct {
  13. ID uint `json:"id"`
  14. WebhookToken string `json:"webhook_token"`
  15. GitActionConfig *GitActionConfig `json:"git_action_config,omitempty"`
  16. }
  17. type GetReleaseResponse Release
  18. type UpdateNotificationConfigRequest struct {
  19. Payload struct {
  20. Enabled bool `json:"enabled"`
  21. Success bool `json:"success"`
  22. Failure bool `json:"failure"`
  23. } `json:"payload"`
  24. }
  25. type CreateReleaseBaseRequest struct {
  26. RepoURL string `schema:"repo_url"`
  27. TemplateName string `json:"template_name" form:"required"`
  28. TemplateVersion string `json:"template_version" form:"required"`
  29. Values map[string]interface{} `json:"values"`
  30. Name string `json:"name" form:"required"`
  31. }
  32. type CreateReleaseRequest struct {
  33. *CreateReleaseBaseRequest
  34. ImageURL string `json:"image_url" form:"required"`
  35. GithubActionConfig *CreateGitActionConfigRequest `json:"github_action_config,omitempty"`
  36. }
  37. type CreateAddonRequest struct {
  38. *CreateReleaseBaseRequest
  39. }
  40. type RollbackReleaseRequest struct {
  41. Revision int `json:"revision" form:"required"`
  42. }
  43. type UpgradeReleaseRequest struct {
  44. Values string `json:"values" form:"required"`
  45. ChartVersion string `json:"version"`
  46. }
  47. type UpdateImageBatchRequest struct {
  48. ImageRepoURI string `json:"image_repo_uri" form:"required"`
  49. Tag string `json:"tag" form:"required"`
  50. }
  51. type GetJobsStatusResponse struct {
  52. Status string `json:"status,omitempty"`
  53. StartTime *metav1.Time `json:"start_time,omitempty"`
  54. }
  55. const URLParamToken URLParam = "token"
  56. type WebhookRequest struct {
  57. Commit string `schema:"commit"`
  58. }