application

package
Version: v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const AnnotationProviderNameKey = "application.tkestack.io/provider-name"

Variables

This section is empty.

Functions

func Providers

func Providers() []string

Providers returns a sorted list of the names of the registered providers.

func Register

func Register(name string, provider Provider)

Register makes a provider available by the provided name. If Register is called twice with the same name or if provider is nil, it panics.

Types

type ControllerProvider

type ControllerProvider interface {
	OnFilter(ctx context.Context, app *applicationv1.App) bool
}

type DelegateProvider

type DelegateProvider struct {
	ProviderName string
}

func (*DelegateProvider) Name

func (p *DelegateProvider) Name() string

func (*DelegateProvider) OnFilter

func (p *DelegateProvider) OnFilter(ctx context.Context, app *applicationv1.App) (pass bool)

type HooksProvider

type HooksProvider interface {
	PreInstall(ctx context.Context,
		applicationClient applicationversionedclient.ApplicationV1Interface,
		platformClient platformversionedclient.PlatformV1Interface,
		app *applicationv1.App,
		repo appconfig.RepoConfiguration,
		updateStatusFunc UpdateStatusFunc) error
	PostInstall(ctx context.Context,
		applicationClient applicationversionedclient.ApplicationV1Interface,
		platformClient platformversionedclient.PlatformV1Interface,
		app *applicationv1.App,
		repo appconfig.RepoConfiguration,
		updateStatusFunc UpdateStatusFunc) error
	PreUpgrade(ctx context.Context,
		applicationClient applicationversionedclient.ApplicationV1Interface,
		platformClient platformversionedclient.PlatformV1Interface,
		app *applicationv1.App,
		repo appconfig.RepoConfiguration,
		updateStatusFunc UpdateStatusFunc) error
	PostUpgrade(ctx context.Context,
		applicationClient applicationversionedclient.ApplicationV1Interface,
		platformClient platformversionedclient.PlatformV1Interface,
		app *applicationv1.App,
		repo appconfig.RepoConfiguration,
		updateStatusFunc UpdateStatusFunc) error
	PreRollback(ctx context.Context,
		applicationClient applicationversionedclient.ApplicationV1Interface,
		platformClient platformversionedclient.PlatformV1Interface,
		app *applicationv1.App,
		repo appconfig.RepoConfiguration,
		updateStatusFunc UpdateStatusFunc) error
	PostRollback(ctx context.Context,
		applicationClient applicationversionedclient.ApplicationV1Interface,
		platformClient platformversionedclient.PlatformV1Interface,
		app *applicationv1.App,
		repo appconfig.RepoConfiguration,
		updateStatusFunc UpdateStatusFunc) error
	PreUninstall(ctx context.Context,
		applicationClient applicationversionedclient.ApplicationV1Interface,
		platformClient platformversionedclient.PlatformV1Interface,
		app *applicationv1.App,
		repo appconfig.RepoConfiguration) error
	PostUninstall(ctx context.Context,
		applicationClient applicationversionedclient.ApplicationV1Interface,
		platformClient platformversionedclient.PlatformV1Interface,
		app *applicationv1.App,
		repo appconfig.RepoConfiguration) error
}

type Provider

type Provider interface {
	Name() string

	ControllerProvider
	HooksProvider
}

Provider defines a set of response interfaces for specific cluster types in cluster management.

func GetProvider

func GetProvider(app *applicationv1.App) (Provider, error)

GetProvider will get your provider with the application, set an annotation with key, application.tkestack.io/provider-name, and value, the provider will work for your application.

type UpdateStatusFunc

type UpdateStatusFunc func(ctx context.Context, app *applicationv1.App, previousStatus, newStatus *applicationv1.AppStatus) (*applicationv1.App, error)

Jump to

Keyboard shortcuts

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