Skip to content
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

Allow to record machine update error #810

Merged
Merged
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
7 changes: 7 additions & 0 deletions pkg/apis/cluster/common/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ const (
// Example: timeout trying to connect to GCE.
CreateMachineError MachineStatusError = "CreateError"

// There was an error while trying to update a Node that this
// Machine represents. This may indicate a transient problem that will be
// fixed automatically with time, such as a service outage,
//
// Example: error updating load balancers
UpdateMachineError MachineStatusError = "UpdateError"

// An error was encountered while trying to delete the Node that this
// Machine represents. This could be a transient or terminal error, but
// will only be observable if the provider's Machine controller has
Expand Down
7 changes: 7 additions & 0 deletions pkg/errors/machines.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ func CreateMachine(msg string, args ...interface{}) *MachineError {
}
}

func UpdateMachine(msg string, args ...interface{}) *MachineError {
return &MachineError{
Reason: commonerrors.UpdateMachineError,
Message: fmt.Sprintf(msg, args...),
}
}

func DeleteMachine(msg string, args ...interface{}) *MachineError {
return &MachineError{
Reason: commonerrors.DeleteMachineError,
Expand Down