Documentation ¶
Index ¶
- type Component
- type Instance
- type RestartConfig
- type StaggerRestartsService
- func (s *StaggerRestartsService) AddToQueue(instance Instance, reason string) error
- func (s *StaggerRestartsService) CheckDeployments(name, namespace string) (bool, error)
- func (s *StaggerRestartsService) GetConfig(componentType, namespace string) (*RestartConfig, error)
- func (s *StaggerRestartsService) GetRunningPods(name, namespace string) ([]corev1.Pod, error)
- func (s *StaggerRestartsService) Reconcile(componentType, namespace string) (bool, error)
- func (s *StaggerRestartsService) Restart(instance Instance, reason string) error
- func (s *StaggerRestartsService) RestartDeployment(name, namespace string) error
- func (s *StaggerRestartsService) RestartImmediately(componentType string, instance Instance, reason string) error
- func (s *StaggerRestartsService) UpdateConfig(componentType, namespace string, cfg *RestartConfig) error
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RestartConfig ¶
type RestartConfig struct { // key is mspid Queues map[string][]*Component // key is instance name Log map[string][]*Component }
RestartConfig defines <ca/peer/orderer>-restart-config.Data["restart-config.yaml"]
func (*RestartConfig) AddToLog ¶
func (r *RestartConfig) AddToLog(component *Component)
func (*RestartConfig) AddToQueue ¶
func (r *RestartConfig) AddToQueue(mspid string, component *Component)
func (*RestartConfig) PopFromQueue ¶
func (r *RestartConfig) PopFromQueue(mspid string)
type StaggerRestartsService ¶
type StaggerRestartsService struct { Client k8sclient.Client ConfigMapManager *configmap.Manager Timeout time.Duration }
func (*StaggerRestartsService) AddToQueue ¶
func (s *StaggerRestartsService) AddToQueue(instance Instance, reason string) error
AddToQueue is called by the restart manager and handles adding the restart request to the queue associated with the instance's MSPID in the <ca/peer/orderer>-restart-config CM.
func (*StaggerRestartsService) CheckDeployments ¶
func (s *StaggerRestartsService) CheckDeployments(name, namespace string) (bool, error)
func (*StaggerRestartsService) GetConfig ¶
func (s *StaggerRestartsService) GetConfig(componentType, namespace string) (*RestartConfig, error)
func (*StaggerRestartsService) GetRunningPods ¶
func (s *StaggerRestartsService) GetRunningPods(name, namespace string) ([]corev1.Pod, error)
func (*StaggerRestartsService) Reconcile ¶
func (s *StaggerRestartsService) Reconcile(componentType, namespace string) (bool, error)
Reconcile is called by the ca/peer/orderer reconcile loops via the restart manager when an update to the <ca/peer/orderer>-restart-config CM is detected and handles the different states of the first component of each queue.
Returns true if the controller needs to requeue the request to reconcile the restart manager.
func (*StaggerRestartsService) Restart ¶
func (s *StaggerRestartsService) Restart(instance Instance, reason string) error
Restart is called by the restart manager. For CA/Peer/Orderer: adds component to the queue for restart. For Console: restarts the component directly as there is only one ibpconsole
instance per network. We bypass the queue logic for ibpconsoles.
func (*StaggerRestartsService) RestartDeployment ¶
func (s *StaggerRestartsService) RestartDeployment(name, namespace string) error
func (*StaggerRestartsService) RestartImmediately ¶
func (s *StaggerRestartsService) RestartImmediately(componentType string, instance Instance, reason string) error
func (*StaggerRestartsService) UpdateConfig ¶
func (s *StaggerRestartsService) UpdateConfig(componentType, namespace string, cfg *RestartConfig) error