core

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyTemplate

func ApplyTemplate(namespace string, templateString string, data map[string]string) error

ApplyTemplate interpolates and applies a yaml to a given namespace

func BypassReleaser

func BypassReleaser(app *model.TuberApp, imageTagWithDigest string, yamls []string, data *ClusterData) error

BypassReleaser is for when you're feeling frisky and want to cowboy code

func DestroyTuberApp

func DestroyTuberApp(db *DB, app *model.TuberApp) error

DestroyTuberApp deletes all resources for the given app on the current cluster

func InitTuberApp

func InitTuberApp(appName string, routePrefix string, withIstio bool, serviceType string) error

InitTuberApp creates a bunch of yamls for you

func NewAppSetup

func NewAppSetup(appName string, istio bool) error

NewAppSetup adds a new tuber app configuration, including namespace, role, rolebinding, and a listing in tuber-apps

func Release

func Release(db *DB, yamls *gcr.AppYamls, logger *zap.Logger, errorScope report.Scope, app *model.TuberApp, digest string, data *ClusterData, slackClient *slack.Client, diffText string, sentryBearerToken string) error

Release interpolates and applies an app's resources. It removes deleted resources, and rolls back on any release failure. If you edit a resource manually, and a release fails, tuber will roll back to the previously released state of the object, not to the state you manually specified.

func RunPrerelease

func RunPrerelease(logger *zap.Logger, resources []appResource, app *model.TuberApp) error

RunPrerelease takes an array of pods, that are designed to be single use command runners that have access to the new code being released.

func WaitForPhase added in v1.0.9

func WaitForPhase(name string, kind string, app *model.TuberApp, resourceTimeout time.Duration) error

Types

type ClusterData

type ClusterData struct {
	DefaultGateway string
	DefaultHost    string
	AdminGateway   string
	AdminHost      string
}

ClusterData is configurable, cluster-wide data available for yaml interpolation

type DB

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

func NewDB

func NewDB(db *db.DB) *DB

func (*DB) App

func (d *DB) App(appName string) (*model.TuberApp, error)

func (*DB) AppExists

func (d *DB) AppExists(appName string) bool

func (*DB) Apps

func (d *DB) Apps() ([]*model.TuberApp, error)

func (*DB) AppsForTag

func (d *DB) AppsForTag(tag string) ([]*model.TuberApp, error)

func (*DB) Close

func (d *DB) Close()

func (*DB) DeleteApp

func (d *DB) DeleteApp(app *model.TuberApp) error

func (*DB) ReloadApp added in v1.0.0

func (d *DB) ReloadApp(app *model.TuberApp) (*model.TuberApp, error)

func (*DB) ReviewApps

func (d *DB) ReviewApps() ([]*model.TuberApp, error)

func (*DB) ReviewAppsFor

func (d *DB) ReviewAppsFor(app *model.TuberApp) ([]*model.TuberApp, error)

func (*DB) SaveApp

func (d *DB) SaveApp(app *model.TuberApp) error

func (*DB) SourceAppFor

func (d *DB) SourceAppFor(app *model.TuberApp) (*model.TuberApp, error)

func (*DB) SourceApps

func (d *DB) SourceApps() ([]*model.TuberApp, error)

type ErrorContext

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

func (ErrorContext) Error

func (e ErrorContext) Error() string

type ResourceCollection added in v1.0.0

type ResourceCollection struct {
	Prerelease  []appResource
	Configs     []appResource
	Workloads   []appResource
	Postrelease []appResource
}

Jump to

Keyboard shortcuts

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