deployment_target.go 991 B

12345678910111213141516171819202122232425262728293031323334
  1. package models
  2. import (
  3. "github.com/google/uuid"
  4. "gorm.io/gorm"
  5. )
  6. // DeploymentTargetSelectorType is the type of selector for a deployment target
  7. type DeploymentTargetSelectorType string
  8. const (
  9. // DeploymentTargetSelectorType_Namespace indicates that the selector is a namespace
  10. DeploymentTargetSelectorType_Namespace DeploymentTargetSelectorType = "NAMESPACE"
  11. )
  12. // DeploymentTarget represents a deployment target on a given cluster
  13. type DeploymentTarget struct {
  14. gorm.Model
  15. // ID is a UUID for the Revision
  16. ID uuid.UUID `gorm:"type:uuid;primaryKey" json:"id"`
  17. // ClusterID is the ID of the cluster that is being targeted.
  18. ClusterID int `json:"cluster_id"`
  19. // ProjectID is the ID of the project that the target belongs to.
  20. ProjectID int `json:"project_id"`
  21. // Selector is the identifier to target.
  22. Selector string `json:"selector"`
  23. // SelectorType is the kind of selector (i.e. NAMESPACE or LABEL).
  24. SelectorType DeploymentTargetSelectorType `json:"selector_type"`
  25. }