Documentation
¶
Overview ¶
Package rescue provides rescue mode for failed provisioning recovery.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
Action represents a rescue action to take.
func Decide ¶
func Decide(cfg *Config, state *RetryState) Action
Decide determines the rescue action based on config and state.
type Config ¶
type Config struct {
Mode Mode `json:"mode"`
MaxRetries int `json:"maxRetries,omitempty"`
RetryDelay time.Duration `json:"retryDelay,omitempty"`
ShellTimeout time.Duration `json:"shellTimeout,omitempty"`
SSHKeys []string `json:"sshKeys,omitempty"`
PasswordHash string `json:"passwordHash,omitempty"`
AutoMountDisks bool `json:"autoMountDisks,omitempty"`
NetworkConfig bool `json:"networkConfig,omitempty"`
}
Config holds rescue mode configuration.
func (*Config) ApplyDefaults ¶
func (c *Config) ApplyDefaults()
ApplyDefaults sets default values for unset fields.
type RetryState ¶
type RetryState struct {
Attempts int `json:"attempts"`
MaxRetries int `json:"maxRetries"`
LastError string `json:"lastError,omitempty"`
LastRetry time.Time `json:"lastRetry,omitempty"`
}
RetryState tracks retry attempts.
func (*RetryState) CanRetry ¶
func (s *RetryState) CanRetry() bool
CanRetry returns whether another retry is allowed.
func (*RetryState) RecordAttempt ¶
func (s *RetryState) RecordAttempt(err error)
RecordAttempt records a retry attempt.
func (*RetryState) Remaining ¶
func (s *RetryState) Remaining() int
Remaining returns the number of retries remaining.
Click to show internal directories.
Click to hide internal directories.