Documentation ¶
Index ¶
Constants ¶
const ( // SuccessSynced is used as part of the Event 'reason' when a HelmRequest is synced SuccessSynced = "Synced" // FailedSync is used when a HelmRequest failed to sync FailedSync = "FailedSync" // SuccessfulDelete means successfully delete a resource SuccessfulDelete = "SuccessfulDelete" // FailedDelete means failed to delete a resource FailedDelete = "FailedDelete" // ErrResourceExists is used as part of the Event 'reason' when a HelmRequest fails // to sync due to a Deployment of the same name already existing. ErrResourceExists = "ErrResourceExists" // MessageResourceExists is the message used for Events when a resource // fails to sync due to a Deployment already existing MessageResourceExists = "Resource %q already exists and is not managed by HelmRequest" // MessageResourceSynced is the message used for an Event fired when a HelmRequest // is synced successfully MessageResourceSynced = "HelmRequest synced successfully" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterWatchRestarter ¶ added in v1.3.1
type ClusterWatchRestarter struct {
// contains filtered or unexported fields
}
func NewClusterWatchRestarter ¶ added in v1.3.1
func NewClusterWatchRestarter(controller *Controller) *ClusterWatchRestarter
NewClusterWatchRestarter ... This runnable means to restart invalid remote cluster connection, and make the watch working again.
func (*ClusterWatchRestarter) Start ¶ added in v1.3.1
func (c *ClusterWatchRestarter) Start(ctx context.Context) error
Start ... 1. check all the clusters to see if it's running 2. start watch if not for every cluster Limitations: If a cluster is watched already, but offline for sometime, and then back online. This runnable cannot handle this situation.
type Controller ¶
type Controller struct { // ClusterCache is used to store Cluster resource ClusterCache *commoncache.Cache // contains filtered or unexported fields }
Controller is the controller implementation for HelmRequest resources
func NewController ¶
func NewController(mgr manager.Manager, opt *config.Options, ctx context.Context) (*Controller, error)
NewController create a new controller
func (*Controller) CleanupClusterWatch ¶ added in v1.3.1
func (c *Controller) CleanupClusterWatch(name string)
func (*Controller) GetClusterClient ¶
func (c *Controller) GetClusterClient() clusterclientset.Interface
GetClusterClient get a client for access Cluster resource
func (*Controller) IsClusterWatchStarted ¶ added in v1.3.1
func (c *Controller) IsClusterWatchStarted(name string) bool
IsClusterWatchStarted check if a cluster watch has been started
func (*Controller) NeedLeaderElection ¶
func (c *Controller) NeedLeaderElection() bool
NeedLeaderElection simply check token file to determine it's this a in-cluster config and enable leader-election
func (*Controller) Start ¶
func (c *Controller) Start(ctx context.Context) error
Start will set up the event handlers for types we are interested in, as well as syncing informer caches and starting workers. It will block until stopCh is closed, at which point it will shutdown the workQueue and wait for workers to finish processing their current work items.