model

package
v0.0.0-...-54d0854 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CRDComponent      = "CRDs"
	CleanupComponent  = "cleaner"
	DeleteStrategyKey = "delete_strategy"

	SkippedComponentEnvVarPrefix = "SKIP_COMPONENT_"
)
View Source
const DefaultBucket = "default"

Variables

This section is empty.

Functions

func IsInvalidValueError

func IsInvalidValueError(err error) bool

func ValidateBucketName

func ValidateBucketName(bucket string) error

Types

type BucketEntity

type BucketEntity struct {
	Bucket   string    `db:"readOnly"`
	Created  time.Time `db:"readOnly"`
	Username string    `db:"readOnly"`
}

func (*BucketEntity) Equal

func (b *BucketEntity) Equal(other db.DatabaseEntity) bool

func (*BucketEntity) Marshaller

func (b *BucketEntity) Marshaller() *db.EntityMarshaller

func (*BucketEntity) New

func (b *BucketEntity) New() db.DatabaseEntity

func (*BucketEntity) String

func (b *BucketEntity) String() string

func (*BucketEntity) Table

func (b *BucketEntity) Table() string

type CacheDependencyEntity

type CacheDependencyEntity struct {
	Bucket    string    `db:"notNull"`
	Key       string    `db:"notNull"`
	Label     string    `db:"notNull"`
	RuntimeID string    `db:"notNull"`
	CacheID   int64     `db:"notNull"`
	Created   time.Time `db:"readOnly"`
}

func (*CacheDependencyEntity) Equal

func (cde *CacheDependencyEntity) Equal(other db.DatabaseEntity) bool

func (*CacheDependencyEntity) Marshaller

func (cde *CacheDependencyEntity) Marshaller() *db.EntityMarshaller

func (*CacheDependencyEntity) New

func (*CacheDependencyEntity) String

func (cde *CacheDependencyEntity) String() string

func (*CacheDependencyEntity) Table

func (cde *CacheDependencyEntity) Table() string

type CacheEntryEntity

type CacheEntryEntity struct {
	ID        int64     `db:"readOnly"`
	Label     string    `db:"notNull"`
	RuntimeID string    `db:"notNull"`
	Data      string    `db:"notNull"`
	Checksum  string    `db:"notNull"`
	Created   time.Time `db:"readOnly"`
}

func (*CacheEntryEntity) Equal

func (ce *CacheEntryEntity) Equal(other db.DatabaseEntity) bool

func (*CacheEntryEntity) Marshaller

func (ce *CacheEntryEntity) Marshaller() *db.EntityMarshaller

func (*CacheEntryEntity) New

func (*CacheEntryEntity) NewChecksum

func (ce *CacheEntryEntity) NewChecksum() string

func (*CacheEntryEntity) String

func (ce *CacheEntryEntity) String() string

func (*CacheEntryEntity) Table

func (ce *CacheEntryEntity) Table() string

type ClusterCleanupEntity

type ClusterCleanupEntity struct {
	StatusID  int64     `db:"notNull"`
	RuntimeID string    `db:"notNull"`
	ClusterID int64     `db:"notNull"`
	ConfigID  int64     `db:"notNull"`
	Status    string    `db:"notNull"`
	Created   time.Time `db:"readOnly"`
}

func (*ClusterCleanupEntity) Equal

func (cce *ClusterCleanupEntity) Equal(other db.DatabaseEntity) bool

func (*ClusterCleanupEntity) Marshaller

func (cce *ClusterCleanupEntity) Marshaller() *db.EntityMarshaller

func (*ClusterCleanupEntity) New

func (*ClusterCleanupEntity) String

func (cce *ClusterCleanupEntity) String() string

func (*ClusterCleanupEntity) Table

func (cce *ClusterCleanupEntity) Table() string

type ClusterConfigurationEntity

type ClusterConfigurationEntity struct {
	Version        int64            `db:"readOnly"`
	RuntimeID      string           `db:"notNull"`
	ClusterVersion int64            `db:"notNull"` // Cluster entity primary key
	KymaVersion    string           `db:"notNull"`
	KymaProfile    string           `db:""`
	Components     []*keb.Component `db:"notNull,encrypt"`
	Administrators []string
	Contract       int64     `db:"notNull"`
	Deleted        bool      `db:"notNull"`
	Created        time.Time `db:"readOnly"`
}

func (*ClusterConfigurationEntity) Equal

func (*ClusterConfigurationEntity) GetComponent

func (c *ClusterConfigurationEntity) GetComponent(component string) *keb.Component

func (*ClusterConfigurationEntity) GetReconciliationSequence

func (*ClusterConfigurationEntity) Marshaller

func (*ClusterConfigurationEntity) New

func (*ClusterConfigurationEntity) String

func (c *ClusterConfigurationEntity) String() string

func (*ClusterConfigurationEntity) Table

type ClusterEntity

type ClusterEntity struct {
	Version    int64             `db:"readOnly"`
	RuntimeID  string            `db:"notNull"`
	Runtime    *keb.RuntimeInput `db:"notNull"`
	Metadata   *keb.Metadata     `db:"notNull"`
	Kubeconfig string            `db:"notNull,encrypt"`
	Contract   int64             `db:"notNull"`
	Deleted    bool              `db:"notNull"`
	Created    time.Time         `db:"readOnly"`
}

func (*ClusterEntity) Equal

func (c *ClusterEntity) Equal(other db.DatabaseEntity) bool

func (*ClusterEntity) Marshaller

func (c *ClusterEntity) Marshaller() *db.EntityMarshaller

func (*ClusterEntity) New

func (c *ClusterEntity) New() db.DatabaseEntity

func (*ClusterEntity) String

func (c *ClusterEntity) String() string

func (*ClusterEntity) Table

func (c *ClusterEntity) Table() string

type ClusterStatus

type ClusterStatus struct {
	ID     float64 //required for monitoring metrics, has to be unique!
	Status Status
}

func NewClusterStatus

func NewClusterStatus(status Status) (*ClusterStatus, error)

func (*ClusterStatus) String

func (s *ClusterStatus) String() string

type ClusterStatusEntity

type ClusterStatusEntity struct {
	ID             int64     `db:"readOnly"`
	RuntimeID      string    `db:"notNull"`
	ClusterVersion int64     `db:"notNull"` // Cluster entity primary key
	ConfigVersion  int64     `db:"notNull"` // Cluster config entity primary key
	Status         Status    `db:"notNull"`
	Deleted        bool      `db:"notNull"`
	Created        time.Time `db:"readOnly"`
}

func (*ClusterStatusEntity) Equal

func (c *ClusterStatusEntity) Equal(other db.DatabaseEntity) bool

func (*ClusterStatusEntity) GetClusterStatus

func (c *ClusterStatusEntity) GetClusterStatus() (*ClusterStatus, error)

func (*ClusterStatusEntity) GetKEBClusterStatus

func (c *ClusterStatusEntity) GetKEBClusterStatus() (keb.Status, error)

func (*ClusterStatusEntity) Marshaller

func (c *ClusterStatusEntity) Marshaller() *db.EntityMarshaller

func (*ClusterStatusEntity) New

func (*ClusterStatusEntity) String

func (c *ClusterStatusEntity) String() string

func (*ClusterStatusEntity) Table

func (c *ClusterStatusEntity) Table() string

type DataType

type DataType string
const (
	String  DataType = "string"
	Integer DataType = "integer"
	Boolean DataType = "boolean"
)

func NewDataType

func NewDataType(dataType string) (DataType, error)

func (DataType) Get

func (dt DataType) Get(value string) (interface{}, error)

type InvalidValueError

type InvalidValueError struct {
	Validator string
	Result    interface{}
	Key       string
	Value     string
}

func (InvalidValueError) Error

func (err InvalidValueError) Error() string

type KeyEntity

type KeyEntity struct {
	Key       string   `db:"notNull"`
	Version   int64    `db:"readOnly"`
	DataType  DataType `db:"notNull"`
	Encrypted bool
	Created   time.Time `db:"readOnly"`
	Username  string    `db:"notNull"`
	Validator string
	Trigger   string
}

func (*KeyEntity) Equal

func (ke *KeyEntity) Equal(other db.DatabaseEntity) bool

func (*KeyEntity) Marshaller

func (ke *KeyEntity) Marshaller() *db.EntityMarshaller

func (*KeyEntity) New

func (ke *KeyEntity) New() db.DatabaseEntity

func (*KeyEntity) String

func (ke *KeyEntity) String() string

func (*KeyEntity) Table

func (ke *KeyEntity) Table() string

func (*KeyEntity) Validate

func (ke *KeyEntity) Validate(value string) error

type OperationEntity

type OperationEntity struct {
	Priority           int64          `db:"notNull"`
	SchedulingID       string         `db:"notNull"`
	CorrelationID      string         `db:"notNull"`
	RuntimeID          string         `db:"notNull"`
	ClusterConfig      int64          `db:"notNull"`
	Component          string         `db:"notNull"`
	Type               OperationType  `db:"notNull"`
	State              OperationState `db:"notNull"`
	Reason             string         `db:""`
	Created            time.Time      `db:"readOnly"`
	Updated            time.Time      `db:""`
	PickedUp           time.Time      `db:""`
	ProcessingDuration int64          `db:""`
	Retries            int64          `db:""`
	RetryID            string         `db:"notNull"`
	Debug              bool           `db:"notNull"`
}

func (*OperationEntity) Equal

func (o *OperationEntity) Equal(other db.DatabaseEntity) bool

func (*OperationEntity) Marshaller

func (o *OperationEntity) Marshaller() *db.EntityMarshaller

func (*OperationEntity) New

func (*OperationEntity) String

func (o *OperationEntity) String() string

func (*OperationEntity) Table

func (*OperationEntity) Table() string

type OperationState

type OperationState string
const (
	OperationStateNew         OperationState = "new"
	OperationStateInProgress  OperationState = "in_progress"
	OperationStateDone        OperationState = "done"
	OperationStateClientError OperationState = "client_error"
	OperationStateError       OperationState = "error"
	OperationStateFailed      OperationState = "failed"
	OperationStateOrphan      OperationState = "orphan"
)

func NewOperationState

func NewOperationState(state string) (OperationState, error)

func (OperationState) IsError

func (o OperationState) IsError() bool

func (OperationState) IsFinal

func (o OperationState) IsFinal() bool

func (OperationState) IsTemporary

func (o OperationState) IsTemporary() bool

type OperationType

type OperationType string
const (
	OperationTypeReconcile OperationType = "reconcile"
	OperationTypeDelete    OperationType = "delete"
)

func NewOperationType

func NewOperationType(state string) (OperationType, error)

type ReconciliationEntity

type ReconciliationEntity struct {
	Lock                string    `db:"notNull"`
	RuntimeID           string    `db:"notNull"`
	ClusterConfig       int64     `db:"notNull"`
	ClusterConfigStatus int64     `db:"notNull"`
	Finished            bool      `db:"notNull"`
	SchedulingID        string    `db:"notNull"`
	Created             time.Time `db:"readOnly"`
	Updated             time.Time `db:""`
	Status              Status    `db:"notNull"`
}

func (*ReconciliationEntity) Equal

func (r *ReconciliationEntity) Equal(other db.DatabaseEntity) bool

func (*ReconciliationEntity) Marshaller

func (r *ReconciliationEntity) Marshaller() *db.EntityMarshaller

func (*ReconciliationEntity) New

func (*ReconciliationEntity) String

func (r *ReconciliationEntity) String() string

func (*ReconciliationEntity) Table

func (*ReconciliationEntity) Table() string

type ReconciliationSequence

type ReconciliationSequence struct {
	Queue [][]*keb.Component
	// contains filtered or unexported fields
}

type ReconciliationSequenceConfig

type ReconciliationSequenceConfig struct {
	PreComponents        [][]string
	DeleteStrategy       string
	ComponentCRDs        map[string]config.ComponentCRD
	ReconciliationStatus Status
	Kubeconfig           string
}

type Status

type Status string
const (
	ClusterStatusDeletePending           Status = "delete_pending"
	ClusterStatusDeleting                Status = "deleting"
	ClusterStatusDeleteError             Status = "delete_error"
	ClusterStatusDeleteErrorRetryable    Status = "delete_error_retryable"
	ClusterStatusDeleted                 Status = "deleted"
	ClusterStatusReconcilePending        Status = "reconcile_pending"
	ClusterStatusReconcileDisabled       Status = "reconcile_disabled"
	ClusterStatusReconciling             Status = "reconciling"
	ClusterStatusReconcileError          Status = "error"
	ClusterStatusReconcileErrorRetryable Status = "reconcile_error_retryable"
	ClusterStatusReady                   Status = "ready"
)

func (Status) IsDeleteCandidate

func (s Status) IsDeleteCandidate() bool

func (Status) IsDeletionInProgress

func (s Status) IsDeletionInProgress() bool

func (Status) IsDisabled

func (s Status) IsDisabled() bool

func (Status) IsFinal

func (s Status) IsFinal() bool

func (Status) IsFinalStable

func (s Status) IsFinalStable() bool

func (Status) IsInProgress

func (s Status) IsInProgress() bool

func (Status) IsReconcileCandidate

func (s Status) IsReconcileCandidate() bool

type StatusCleanupEntity

type StatusCleanupEntity struct {
	StatusID  int64     `db:"notNull"`
	RuntimeID string    `db:"notNull"`
	ClusterID int64     `db:"notNull"`
	ConfigID  int64     `db:"notNull"`
	Status    string    `db:"notNull"`
	Created   time.Time `db:"readOnly"`
}

func (*StatusCleanupEntity) Equal

func (sce *StatusCleanupEntity) Equal(other db.DatabaseEntity) bool

func (*StatusCleanupEntity) Marshaller

func (sce *StatusCleanupEntity) Marshaller() *db.EntityMarshaller

func (*StatusCleanupEntity) New

func (*StatusCleanupEntity) String

func (sce *StatusCleanupEntity) String() string

func (*StatusCleanupEntity) Table

func (sce *StatusCleanupEntity) Table() string

type ValueEntity

type ValueEntity struct {
	Key        string    `db:"notNull"`
	KeyVersion int64     `db:"notNull"`
	Version    int64     `db:"readOnly"`
	Bucket     string    `db:"notNull"`
	Value      string    `db:"notNull"`
	DataType   DataType  `db:"notNull"`
	Created    time.Time `db:"readOnly"`
	Username   string    `db:"notNull"`
}

func (*ValueEntity) Equal

func (ve *ValueEntity) Equal(other db.DatabaseEntity) bool

func (*ValueEntity) Get

func (ve *ValueEntity) Get() (interface{}, error)

func (*ValueEntity) Marshaller

func (ve *ValueEntity) Marshaller() *db.EntityMarshaller

func (*ValueEntity) New

func (ve *ValueEntity) New() db.DatabaseEntity

func (*ValueEntity) String

func (ve *ValueEntity) String() string

func (*ValueEntity) Table

func (ve *ValueEntity) Table() string

type WorkerPoolOccupancyEntity

type WorkerPoolOccupancyEntity struct {
	WorkerPoolID       string    `db:"notNull"`
	Component          string    `db:"notNull"`
	RunningWorkers     int64     `db:""`
	WorkerPoolCapacity int64     `db:"notNull"`
	Created            time.Time `db:"readOnly"`
}

func (*WorkerPoolOccupancyEntity) Equal

func (*WorkerPoolOccupancyEntity) Marshaller

func (*WorkerPoolOccupancyEntity) New

func (*WorkerPoolOccupancyEntity) String

func (o *WorkerPoolOccupancyEntity) String() string

func (*WorkerPoolOccupancyEntity) Table

func (o *WorkerPoolOccupancyEntity) Table() string

Jump to

Keyboard shortcuts

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