Documentation
¶
Index ¶
- Variables
- type FakeManager
- func (fm *FakeManager) Create(context.Context, models.RepoRevisionData) (string, error)
- func (fm *FakeManager) Destroy(context.Context, models.RepoRevisionData, models.QADestroyReason) error
- func (fm *FakeManager) DestroyExplicitly(context.Context, *models.QAEnvironment, models.QADestroyReason) error
- func (fm *FakeManager) Failure(context.Context, string, string) error
- func (fm *FakeManager) Success(context.Context, string) error
- func (fm *FakeManager) Update(context.Context, models.RepoRevisionData) (string, error)
- type LogFunc
- type Manager
- func (m *Manager) Create(ctx context.Context, rd models.RepoRevisionData) (string, error)
- func (m *Manager) Delete(ctx context.Context, rd *models.RepoRevisionData, ...) error
- func (m *Manager) Destroy(ctx context.Context, rd models.RepoRevisionData, reason models.QADestroyReason) error
- func (m *Manager) DestroyExplicitly(ctx context.Context, qa *models.QAEnvironment, reason models.QADestroyReason) error
- func (m *Manager) Failure(context.Context, string, string) error
- func (m *Manager) InitFailureTemplate(tmpldata []byte) error
- func (m *Manager) Success(context.Context, string) error
- func (m *Manager) Update(ctx context.Context, rd models.RepoRevisionData) (string, error)
- type NotificationsFactoryFunc
Constants ¶
This section is empty.
Variables ¶
var DefaultOperationTimeout = 30 * time.Minute
Functions ¶
This section is empty.
Types ¶
type FakeManager ¶ added in v0.7.6
type FakeManager struct { }
FakeManager stubs out a Manager, fulfilling the spawner.EnvironmentSpawner interface
func (*FakeManager) Create ¶ added in v0.7.6
func (fm *FakeManager) Create(context.Context, models.RepoRevisionData) (string, error)
func (*FakeManager) Destroy ¶ added in v0.7.6
func (fm *FakeManager) Destroy(context.Context, models.RepoRevisionData, models.QADestroyReason) error
func (*FakeManager) DestroyExplicitly ¶ added in v0.7.6
func (fm *FakeManager) DestroyExplicitly(context.Context, *models.QAEnvironment, models.QADestroyReason) error
func (*FakeManager) Success ¶ added in v0.7.6
func (fm *FakeManager) Success(context.Context, string) error
func (*FakeManager) Update ¶ added in v0.7.6
func (fm *FakeManager) Update(context.Context, models.RepoRevisionData) (string, error)
type LogFunc ¶
type LogFunc func(string, ...interface{})
LogFunc is a function that logs a formatted string somewhere
type Manager ¶
type Manager struct { NF NotificationsFactoryFunc DefaultNotifications models.Notifications DL persistence.DataLayer RC ghclient.RepoClient MC metrics.Collector NG namegen.NameGenerator LP locker.PreemptiveLockProvider FS billy.Filesystem MG meta.Getter CI metahelm.Installer AWSCreds config.AWSCreds S3Config config.S3Config GlobalLimit uint OperationTimeout time.Duration UIBaseURL string // contains filtered or unexported fields }
Manager is an object that creates/updates/deletes environments in k8s
func (*Manager) Create ¶
Create creates a new k8s environment, persists the information to the DB and returns the environment name or error
func (*Manager) Delete ¶
func (m *Manager) Delete(ctx context.Context, rd *models.RepoRevisionData, reason models.QADestroyReason) error
Delete destroys an environment in k8s and marks it as such in the DB
func (*Manager) Destroy ¶
func (m *Manager) Destroy(ctx context.Context, rd models.RepoRevisionData, reason models.QADestroyReason) error
Destroy is the same as Delete and is needed to satisfy the interface
func (*Manager) DestroyExplicitly ¶
func (m *Manager) DestroyExplicitly(ctx context.Context, qa *models.QAEnvironment, reason models.QADestroyReason) error
DestroyExplicitly destroys an environment and is triggered by API call
func (*Manager) InitFailureTemplate ¶
InitFailureTemplate parses the raw temlate data from tmpldata and initializes the S3 client for later use
type NotificationsFactoryFunc ¶
type NotificationsFactoryFunc func(lf func(string, ...interface{}), notifications models.Notifications, user string) notifier.Router
NotificationsFactoryFunc is a function that takes a notifications config from the triggering repo, processes it according to any global defaults, and returns a Router suitable to push notifications