update

package
v0.0.0-...-bf90f01 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 License: Apache-2.0 Imports: 16 Imported by: 6

Documentation

Index

Constants

View Source
const TenantsUpdateAdvisoryLockID = 4242
View Source
const TenantsUpdateTableName = "tenants_update"

Variables

View Source
var AllTypes = allTypes("no-limit")

Functions

func HandleTenantUpdateError

func HandleTenantUpdateError(db *gorm.DB, err error)

func IsOlderThanTimeout

func IsOlderThanTimeout(when time.Time, config *configuration.Data) bool

Types

type Executor

type Executor interface {
	Update(ctx context.Context, dbTenant *tenant.Tenant, user *auth.User, envTypes []environment.Type, allowSelfHealing bool) error
}

type FilterCluster

type FilterCluster func(cluster string) bool

type FilterEnvType

type FilterEnvType interface {
	IsOk(envType environment.Type) bool
	GetLimit() string
}

type GormRepository

type GormRepository struct {
	// contains filtered or unexported fields
}

func NewRepository

func NewRepository(tx *gorm.DB) *GormRepository

func (*GormRepository) CanContinue

func (r *GormRepository) CanContinue() (bool, error)

func (*GormRepository) GetTenantsUpdate

func (r *GormRepository) GetTenantsUpdate() (*TenantsUpdate, error)

func (*GormRepository) IncrementFailedCount

func (r *GormRepository) IncrementFailedCount() error

func (*GormRepository) PrepareForUpdating

func (r *GormRepository) PrepareForUpdating() error

func (*GormRepository) SaveTenantsUpdate

func (r *GormRepository) SaveTenantsUpdate(tenantUpdate *TenantsUpdate) error

func (*GormRepository) Stop

func (r *GormRepository) Stop() error

func (*GormRepository) UpdateLastTimeUpdated

func (r *GormRepository) UpdateLastTimeUpdated() error

func (*GormRepository) UpdateStatus

func (r *GormRepository) UpdateStatus(status Status) error

type OneType

type OneType environment.Type

func (OneType) GetLimit

func (f OneType) GetLimit() string

func (OneType) IsOk

func (f OneType) IsOk(envType environment.Type) bool

type Repository

type Repository interface {
	GetTenantsUpdate() (*TenantsUpdate, error)
	SaveTenantsUpdate(tenantUpdate *TenantsUpdate) error
	UpdateStatus(status Status) error
	UpdateLastTimeUpdated() error
	PrepareForUpdating() error
	IncrementFailedCount() error
	CanContinue() (bool, error)
	Stop() error
}

type Status

type Status string
const (
	Finished   Status = "finished"
	Updating   Status = "updating"
	Failed     Status = "failed"
	Killed     Status = "killed"
	Incomplete Status = "incomplete"
)

func (*Status) Scan

func (s *Status) Scan(value interface{}) error

Scan - Implement the database/sql scanner interface

func (Status) String

func (s Status) String() string

func (Status) Value

func (s Status) Value() (driver.Value, error)

Value - Implementation of valuer for database/sql

type TenantsUpdate

type TenantsUpdate struct {
	LastVersionFabric8TenantUserFile          string
	LastVersionFabric8TenantCheMtFile         string
	LastVersionFabric8TenantCheQuotasFile     string
	LastVersionFabric8TenantJenkinsFile       string
	LastVersionFabric8TenantJenkinsQuotasFile string
	LastVersionFabric8TenantDeployFile        string
	Status                                    Status
	FailedCount                               int
	LastTimeUpdated                           time.Time
	CanContinue                               bool
}

type TenantsUpdater

type TenantsUpdater struct {
	// contains filtered or unexported fields
}

func NewTenantsUpdater

func NewTenantsUpdater(
	db *gorm.DB,
	config *configuration.Data,
	clusterService cluster.Service,
	updateExecutor Executor,
	filterEnvType FilterEnvType,
	limitToCluster string) *TenantsUpdater

func (*TenantsUpdater) UpdateAllTenants

func (u *TenantsUpdater) UpdateAllTenants()

type VersionManager

type VersionManager struct {
	Version          string
	EnvTypes         []environment.Type
	FileName         string
	GetStoredVersion func(tu *TenantsUpdate) string
	// contains filtered or unexported fields
}

func RetrieveVersionManagers

func RetrieveVersionManagers() []*VersionManager

func (*VersionManager) IsVersionUpToDate

func (vm *VersionManager) IsVersionUpToDate(tu *TenantsUpdate) bool

func (*VersionManager) SetCurrentVersion

func (vm *VersionManager) SetCurrentVersion(tu *TenantsUpdate)

Jump to

Keyboard shortcuts

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