Documentation ¶
Index ¶
Constants ¶
const ( // MaxWorkers is the maximum number of go-routines to use for concurrent // actions. MaxWorkers = 10 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangeSet ¶
type ChangeSet struct { Revision *Revision AddedResources resource.Slice UpdatedResources resource.Slice UnchangedResources resource.Slice RemovedResources resource.Slice Hooks hook.SliceMap }
ChangeSet is a container for resources that are sorted into buckets. These buckets help in finding the best upgrade strategy for a given manifest.
func (*ChangeSet) HasResourceChanges ¶
HasResourceChanges returns true if there are resource changes waiting to be applied. Resource changes are resource additions, deletions and updates.
type Client ¶
type Client interface { // ApplyManifest applies raw manifest bytes. ApplyManifest(context.Context, []byte) error // DeleteManifest deletes raw manifest bytes. DeleteManifest(context.Context, []byte) error // DeleteResource deletes a resource by its kind, name and namespace. DeleteResource(context.Context, resource.Head) error // Wait waits for a resource condition to be met. Wait(context.Context, kubernetes.WaitOptions) error }
Client applies and deletes manifests from a cluster.
type Revision ¶
Revision is the step before applying the next version of a manifest and potentially deleting leftovers from the old version. A revision with nil Next is considered as a deletion of all resources defined in the manifest. Consequently, a revision with a nil Current is considered an initial resource creation and will apply all resources.
func (*Revision) ChangeSet ¶
ChangeSet creates a ChangeSet for r. The change set categorizes resources into buckets (e.g. added, updated, unchanged, removed) and also contains the most recent hooks for this revision.
func (*Revision) DiffOptions ¶
DiffOptions returns the diff.Options for this revision.
func (*Revision) IsInitial ¶
IsInitial returns true if r contains a new manifest, meaning that there is no current revision.
func (*Revision) IsRemoval ¶
IsRemoval returns true if r does not have a next manifest. This denotes that the manifest should be deleted from the cluster using the current revision.
func (*Revision) IsUpgrade ¶
IsUpgrade returns true if the manifest still exists in the next revision.
type Slice ¶
type Slice []*Revision
Slice is a slice of revisions.
type Upgrader ¶
type Upgrader interface { // Upgrader takes a context and a revision and performs an upgrade. // Depending on the type of revision it will carry out a complete creation // or deletion of the revision's manifest resources or just do partial // updates of resources that have been changed. It also executes hooks // before and after processing the revision. Upgrade(context.Context, *Revision) error }
Upgrader handles revision upgrades.
func NewUpgrader ¶
func NewUpgrader(client Client, o *UpgraderOptions) Upgrader
NewUpgrader creates a new Upgrader with client and options.