Documentation ¶
Index ¶
- Constants
- func GetCluster(ctx context.Context, platformClient internalversion.PlatformInterface, ...) (*types.Cluster, error)
- func GetClusterByName(ctx context.Context, platformClient internalversion.PlatformInterface, ...) (*types.Cluster, error)
- func GetV1Cluster(ctx context.Context, ...) (*v1.Cluster, error)
- func GetV1ClusterByName(ctx context.Context, ...) (*v1.Cluster, error)
- func Providers() []string
- func Register(name string, provider Provider)
- func RegisterHandler(mux *mux.PathRecorderMux)
- func Setup() error
- func Teardown() error
- type APIProvider
- type ControllerProvider
- type CredentialProvider
- type DelegateProvider
- func (p *DelegateProvider) AfterCreate(cluster *types.Cluster) error
- func (p *DelegateProvider) GetClusterCredential(ctx context.Context, client platforminternalclient.PlatformInterface, ...) (*platform.ClusterCredential, error)
- func (p *DelegateProvider) GetClusterCredentialV1(ctx context.Context, client platformversionedclient.PlatformV1Interface, ...) (*platformv1.ClusterCredential, error)
- func (p *DelegateProvider) Name() string
- func (p *DelegateProvider) NeedUpdate(old, new *platformv1.Cluster) bool
- func (p *DelegateProvider) OnCreate(ctx context.Context, cluster *v1.Cluster) error
- func (p *DelegateProvider) OnDelete(ctx context.Context, cluster *v1.Cluster) error
- func (p *DelegateProvider) OnFilter(ctx context.Context, cluster *platformv1.Cluster) (pass bool)
- func (p *DelegateProvider) OnRunning(ctx context.Context, cluster *v1.Cluster) error
- func (p *DelegateProvider) OnUpdate(ctx context.Context, cluster *v1.Cluster) error
- func (p *DelegateProvider) PreCreate(cluster *types.Cluster) error
- func (p *DelegateProvider) RegisterHandler(mux *mux.PathRecorderMux)
- func (p *DelegateProvider) Setup() error
- func (p *DelegateProvider) Teardown() error
- func (p *DelegateProvider) Validate(cluster *types.Cluster) field.ErrorList
- type Handler
- type Provider
Constants ¶
View Source
const ( ReasonWaiting = "Waiting" ReasonSkip = "Skip" ReasonFailedInit = "FailedInit" ReasonFailedUpdate = "FailedUpdate" ReasonFailedDelete = "FailedDelete" ConditionTypeDone = "EnsureDone" )
View Source
const AdminUsername = "admin"
Variables ¶
This section is empty.
Functions ¶
func GetCluster ¶ added in v1.8.0
func GetCluster(ctx context.Context, platformClient internalversion.PlatformInterface, cluster *platform.Cluster, username string) (*types.Cluster, error)
func GetClusterByName ¶ added in v1.8.0
func GetClusterByName(ctx context.Context, platformClient internalversion.PlatformInterface, clsname, username string) (*types.Cluster, error)
func GetV1Cluster ¶ added in v1.8.0
func GetV1Cluster(ctx context.Context, platformClient platformversionedclient.PlatformV1Interface, cluster *platformv1.Cluster, username string) (*v1.Cluster, error)
func GetV1ClusterByName ¶ added in v1.8.0
func GetV1ClusterByName(ctx context.Context, platformClient platformversionedclient.PlatformV1Interface, clsname, username string) (*v1.Cluster, error)
func Providers ¶
func Providers() []string
Providers returns a sorted list of the names of the registered providers.
func Register ¶
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.
func RegisterHandler ¶ added in v1.3.1
func RegisterHandler(mux *mux.PathRecorderMux)
RegisterHandler register all provider's hanlder.
Types ¶
type APIProvider ¶ added in v1.3.1
type ControllerProvider ¶ added in v1.3.1
type ControllerProvider interface { // Setup called by controller to give an chance for plugin do some init work. Setup() error // Teardown called by controller for plugin do some clean job. Teardown() error // NeedUpdate could be implemented by user to judge whether cluster need update or not. NeedUpdate(old, new *platformv1.Cluster) bool OnCreate(ctx context.Context, cluster *v1.Cluster) error OnUpdate(ctx context.Context, cluster *v1.Cluster) error OnDelete(ctx context.Context, cluster *v1.Cluster) error // OnFilter called by cluster controller informer for plugin // do the filter on the cluster obj for specific case: // return bool: // false: drop the object to the queue // true: add the object to queue, AddFunc and UpdateFunc will // go through later OnFilter(ctx context.Context, cluster *platformv1.Cluster) bool // OnRunning call on first running. OnRunning(ctx context.Context, cluster *v1.Cluster) error }
type CredentialProvider ¶ added in v1.8.0
type CredentialProvider interface { GetClusterCredential(ctx context.Context, client platforminternalclient.PlatformInterface, cluster *platform.Cluster, username string) (*platform.ClusterCredential, error) GetClusterCredentialV1(ctx context.Context, client platformversionedclient.PlatformV1Interface, cluster *platformv1.Cluster, username string) (*platformv1.ClusterCredential, error) }
type DelegateProvider ¶ added in v1.3.1
type DelegateProvider struct { ProviderName string ValidateFunc func(cluster *types.Cluster) field.ErrorList PreCreateFunc func(cluster *types.Cluster) error AfterCreateFunc func(cluster *types.Cluster) error CreateHandlers []Handler DeleteHandlers []Handler UpdateHandlers []Handler UpgradeHandlers []Handler ScaleUpHandlers []Handler ScaleDownHandlers []Handler }
func (*DelegateProvider) AfterCreate ¶ added in v1.3.1
func (p *DelegateProvider) AfterCreate(cluster *types.Cluster) error
func (*DelegateProvider) GetClusterCredential ¶ added in v1.8.0
func (p *DelegateProvider) GetClusterCredential(ctx context.Context, client platforminternalclient.PlatformInterface, cluster *platform.Cluster, username string) (*platform.ClusterCredential, error)
GetClusterCredential returns the cluster's credential
func (*DelegateProvider) GetClusterCredentialV1 ¶ added in v1.8.0
func (p *DelegateProvider) GetClusterCredentialV1(ctx context.Context, client platformversionedclient.PlatformV1Interface, cluster *platformv1.Cluster, username string) (*platformv1.ClusterCredential, error)
GetClusterCredentialV1 returns the versioned cluster's credential
func (*DelegateProvider) Name ¶ added in v1.3.1
func (p *DelegateProvider) Name() string
func (*DelegateProvider) NeedUpdate ¶ added in v1.8.0
func (p *DelegateProvider) NeedUpdate(old, new *platformv1.Cluster) bool
func (*DelegateProvider) OnFilter ¶ added in v1.8.0
func (p *DelegateProvider) OnFilter(ctx context.Context, cluster *platformv1.Cluster) (pass bool)
func (*DelegateProvider) PreCreate ¶ added in v1.3.1
func (p *DelegateProvider) PreCreate(cluster *types.Cluster) error
func (*DelegateProvider) RegisterHandler ¶ added in v1.3.1
func (p *DelegateProvider) RegisterHandler(mux *mux.PathRecorderMux)
func (*DelegateProvider) Setup ¶ added in v1.3.1
func (p *DelegateProvider) Setup() error
func (*DelegateProvider) Teardown ¶ added in v1.3.1
func (p *DelegateProvider) Teardown() error
type Provider ¶
type Provider interface { Name() string APIProvider ControllerProvider CredentialProvider }
Provider defines a set of response interfaces for specific cluster types in cluster management.
func GetProvider ¶
GetProvider returns provider by name
Click to show internal directories.
Click to hide internal directories.