apps

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterResource

func RegisterResource(r *ResourceManager)

Types

type App

type App struct {
	Name       string
	ChangeSets map[ImageIdentifier]*ChangeSet
}

App is a group of images mapped to containers within resources in the app

func NewApp

func NewApp(name string) *App

NewApp returns a new App

func (*App) GetChangeSets

func (app *App) GetChangeSets() []*ChangeSet

GetChangeSets returns all changesets in the App

func (*App) SetLatest

func (app *App) SetLatest(registry, repository, version string)

SetLatest sets the latest version on every changeset in this app

type AppManager

type AppManager struct {
	ClientSet kubernetes.Interface
	Namespace string
	Apps      map[string]*App
	Managers  map[string]*ResourceManager
}

AppManager finds and updates Applications and their deployments and cronjobs

func NewAppManager

func NewAppManager(namespace string) (*AppManager, error)

NewAppManager creates a new Image manager

func (*AppManager) AddContainer

func (mgr *AppManager) AddContainer(kind string, container Container)

AddContainer adds the specified container, from a resource of the specified kind To the appropriate app

func (*AppManager) Scan

func (mgr *AppManager) Scan() error

Scan the cluster and find all resources and containers we manage

func (*AppManager) SetLatest

func (mgr *AppManager) SetLatest(registry, repository, version string)

SetLatest calls SetLatest on all contained apps Setting the version on all relevant containers

type ChangeSet

type ChangeSet struct {
	ImageID     ImageIdentifier
	NeedsUpdate bool
	UpdateTo    Version
	Containers  map[string][]Container // Map of Kinds to lists of containers
}

ChangeSet contains resources that share an image identifier

func NewChangeSet

func NewChangeSet(ID ImageIdentifier) *ChangeSet

NewChangeSet creates a new changeset

func (*ChangeSet) AddContainer

func (cs *ChangeSet) AddContainer(kind string, container Container)

func (*ChangeSet) RegistryPath

func (cs *ChangeSet) RegistryPath() string

RegistryPath returns the full registry path to which all images in the changeset should use

func (*ChangeSet) SetLatest

func (cs *ChangeSet) SetLatest(version string)

SetLatest sets the latest version, and checks if this changeset requires update Uses SemVer to perform comparisons if possible, otherwise falls back to string equality comparison.

func (*ChangeSet) Upgrade

func (cs *ChangeSet) Upgrade(mgr *AppManager) error

Upgrade all of the resources in this changeset, using the managers in the appmanager

func (*ChangeSet) Versions

func (cs *ChangeSet) Versions() []string

Versions returns all versions in use for the image

type Container

type Container struct {
	ContainerID ContainerIdentifier
	ImageID     ImageIdentifier
	App         string
	Current     Version
}

Container represents a container

type ContainerIdentifier

type ContainerIdentifier struct {
	Resource  string
	Container string
}

ContainerIdentifier is a unique identifier for a container

type ImageIdentifier

type ImageIdentifier struct {
	Repo     string
	Registry string
}

ImageIdentifier images are identified by their repo and registry

type ResourceManager

type ResourceManager struct {
	Kind      string
	Resources func(mgr *AppManager) ([]interface{}, error)
	Generator func(item interface{}) []Container
	Upgrade   func(mgr *AppManager, image *ChangeSet, resource Container) error
}

type Version

type Version string

Version is a version number expressed as a string

Jump to

Keyboard shortcuts

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