Skip to content

🌱 Add BootstrapFailedMachineError error #10360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions errors/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ const (
// Example: the ProviderSpec specifies an instance type that doesn't exist,.
InvalidConfigurationMachineError MachineStatusError = "InvalidConfiguration"

// BootstrapFailedMachineError indicates that the machine has been created, but
// the bootstrap process failed (e.g., Cloud init failed),
// This is not a transient error, but
// indicates a state that must be fixed before progress can be made.
//
// Example: the ControlPlaneEndpoint is wrong.
BootstrapFailedMachineError MachineStatusError = "BootstrapFailed"

// UnsupportedChangeMachineError indicates that the MachineSpec has been updated in a way that
// is not supported for reconciliation on this cluster. The spec may be
// completely valid from a configuration standpoint, but the controller
Expand Down
8 changes: 8 additions & 0 deletions errors/machines.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ func InvalidMachineConfiguration(msg string, args ...interface{}) *MachineError
}
}

// BootstrapFailed creates a new error when a bootstrap failed for Machine.
func BootstrapFailed(msg string, args ...interface{}) *MachineError {
return &MachineError{
Reason: BootstrapFailedMachineError,
Message: fmt.Sprintf(msg, args...),
}
}

// CreateMachine creates a new error for when creating a Machine.
func CreateMachine(msg string, args ...interface{}) *MachineError {
return &MachineError{
Expand Down