restart

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Instances map[string]*Restart
}

Config defines operator-config.BinaryData["restart-config.yaml"]

type Instance

type Instance interface {
	v1.Object
	GetMSPID() string
}

type Reason

type Reason string
const (
	ADMINCERT       Reason = "adminCert"
	ECERTUPDATE     Reason = "ecertUpdate"
	TLSUPDATE       Reason = "tlsUpdate"
	CONFIGOVERRIDE  Reason = "configOverride"
	MIGRATION       Reason = "migration"
	NODEOU          Reason = "nodeOU"
	CONFIGMAPUPDATE Reason = "configMapUpdate"
	RESTARTACTION   Reason = "restartAction"
)

type Request

type Request struct {
	Status              Status
	RequestTimestamp    string
	LastActionTimestamp string
}

type Restart

type Restart struct {
	Requests map[Reason]*Request
}

type RestartManager

type RestartManager struct {
	Client                 k8sclient.Client
	Timers                 map[string]*time.Timer
	WaitTime               time.Duration
	ConfigMapManager       *configmap.Manager
	StaggerRestartsService *staggerrestarts.StaggerRestartsService
}

func New

func New(client k8sclient.Client, waitTime, timeout time.Duration) *RestartManager

func (*RestartManager) ClearRestartConfigForInstance

func (r *RestartManager) ClearRestartConfigForInstance(instance v1.Object) error

func (*RestartManager) ForAdminCertUpdate

func (r *RestartManager) ForAdminCertUpdate(instance v1.Object) error

func (*RestartManager) ForCertUpdate

func (r *RestartManager) ForCertUpdate(certType common.SecretType, instance v1.Object) error

func (*RestartManager) ForConfigMapUpdate

func (r *RestartManager) ForConfigMapUpdate(instance v1.Object) error

func (*RestartManager) ForConfigOverride

func (r *RestartManager) ForConfigOverride(instance v1.Object) error

func (*RestartManager) ForEcertReenroll

func (r *RestartManager) ForEcertReenroll(instance v1.Object) error

func (*RestartManager) ForMigration

func (r *RestartManager) ForMigration(instance v1.Object) error

func (*RestartManager) ForNodeOU

func (r *RestartManager) ForNodeOU(instance v1.Object) error

func (*RestartManager) ForRestartAction

func (r *RestartManager) ForRestartAction(instance v1.Object) error

func (*RestartManager) ForTLSReenroll

func (r *RestartManager) ForTLSReenroll(instance v1.Object) error

func (*RestartManager) GetConfig

func (r *RestartManager) GetConfig(instance v1.Object) (*Config, error)

func (*RestartManager) RestartDeployment

func (r *RestartManager) RestartDeployment(instance Instance, reason string) error

RestartDeployment adds the instance to the queue to stagger restarts

func (*RestartManager) SetTimer

func (r *RestartManager) SetTimer(instance Instance, reason string) error

func (*RestartManager) TriggerIfNeeded

func (r *RestartManager) TriggerIfNeeded(instance Instance) error

TriggerIfNeeded checks operator-config for any pending restarts, sets a timer to restart the deployment if required, and restarts the deployment.

func (*RestartManager) UpdateConfigMap

func (r *RestartManager) UpdateConfigMap(cfg *Config, instance v1.Object) error

type Status

type Status string
const (
	Pending  Status = "pending"
	Complete Status = "complete"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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