Skip to content

Commit 3fc0ac8

Browse files
ingvagabundopenshift-merge-robot
authored andcommitted
UPSTREAM: <carry>: openshift: Allow to record machine update error
In case a machine provider configuration is invalidated, it's handful to record InvalidConfigurationMachineError event error. So a human (or third party controller) can notice the fact without reading machine controller logs and react accordingly.
1 parent 0c3e884 commit 3fc0ac8

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

pkg/apis/machine/common/consts.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ const (
5151
// Example: timeout trying to connect to GCE.
5252
CreateMachineError MachineStatusError = "CreateError"
5353

54+
// There was an error while trying to update a Node that this
55+
// Machine represents. This may indicate a transient problem that will be
56+
// fixed automatically with time, such as a service outage,
57+
//
58+
// Example: error updating load balancers
59+
UpdateMachineError MachineStatusError = "UpdateError"
60+
5461
// An error was encountered while trying to delete the Node that this
5562
// Machine represents. This could be a transient or terminal error, but
5663
// will only be observable if the provider's Machine controller has

pkg/errors/machines.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ func CreateMachine(msg string, args ...interface{}) *MachineError {
5353
}
5454
}
5555

56+
func UpdateMachine(msg string, args ...interface{}) *MachineError {
57+
return &MachineError{
58+
Reason: commonerrors.UpdateMachineError,
59+
Message: fmt.Sprintf(msg, args...),
60+
}
61+
}
62+
5663
func DeleteMachine(msg string, args ...interface{}) *MachineError {
5764
return &MachineError{
5865
Reason: commonerrors.DeleteMachineError,

0 commit comments

Comments
 (0)