clustermodel

package
v0.0.0-...-e7c744b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const InstanceTypeSeparator = " "

Variables

This section is empty.

Functions

func Migrate

func Migrate(db *gorm.DB, logger logrus.FieldLogger) error

Migrate executes the table migrations for the cluster module.

Types

type ClusterModel

type ClusterModel struct {
	ID  uint   `gorm:"primary_key"`
	UID string `gorm:"unique_index:idx_clusters_uid"`

	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time `gorm:"unique_index:idx_clusters_unique_id" sql:"index"`
	StartedAt *time.Time
	CreatedBy uint

	Name           string `gorm:"unique_index:idx_clusters_unique_id"`
	Location       string
	Cloud          string
	Distribution   string
	OrganizationID uint `gorm:"unique_index:idx_clusters_unique_id"`
	SecretID       string
	ConfigSecretID string
	SSHSecretID    string
	Status         string
	RbacEnabled    bool
	OidcEnabled    bool        `gorm:"default:false;not null"`
	StatusMessage  string      `sql:"type:text;"`
	Tags           ClusterTags `gorm:"type:json"`
}

ClusterModel describes the common cluster model.

func (*ClusterModel) AfterFind

func (m *ClusterModel) AfterFind() error

AfterFind converts Location field(s) to unknown if they are empty.

func (*ClusterModel) BeforeCreate

func (m *ClusterModel) BeforeCreate() (err error)

func (ClusterModel) BeforeDelete

func (m ClusterModel) BeforeDelete(tx *gorm.DB) (err error)

BeforeDelete should not be declared on this model. TODO: please move this to the cluster delete flow this should not have been added here in the first place!!!!!!!

func (ClusterModel) String

func (m ClusterModel) String() string

String method prints formatted cluster fields.

func (ClusterModel) TableName

func (ClusterModel) TableName() string

TableName changes the default table name.

type ClusterTags

type ClusterTags map[string]string

func (*ClusterTags) Scan

func (fs *ClusterTags) Scan(src interface{}) error

func (ClusterTags) Value

func (fs ClusterTags) Value() (driver.Value, error)

type StatusHistoryModel

type StatusHistoryModel struct {
	ID uint `gorm:"primary_key"`

	ClusterID   uint      `gorm:"not null;index"`
	ClusterName string    `gorm:"not null"`
	CreatedAt   time.Time `gorm:"not null"`

	FromStatus        string `gorm:"not null"`
	FromStatusMessage string `sql:"type:text;" gorm:"not null"`
	ToStatus          string `gorm:"not null"`
	ToStatusMessage   string `sql:"type:text;" gorm:"not null"`
}

StatusHistoryModel records the status transitions of a cluster and stores it in a database.

func (StatusHistoryModel) TableName

func (StatusHistoryModel) TableName() string

TableName changes the default table name.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL