mirror of https://github.com/kubernetes/kops.git
Make struct members private, alter formatting, add unwrap method
Signed-off-by: Jack Andersen <jandersen@plaid.com>
This commit is contained in:
parent
66fe8e8118
commit
89dfafefe7
|
|
@ -46,12 +46,16 @@ const rollingUpdateTaintKey = "kops.k8s.io/scheduled-for-update"
|
||||||
// ValidationTimeoutError represents an error that occurs when
|
// ValidationTimeoutError represents an error that occurs when
|
||||||
// the cluster fails to validate within the designated timeout.
|
// the cluster fails to validate within the designated timeout.
|
||||||
type ValidationTimeoutError struct {
|
type ValidationTimeoutError struct {
|
||||||
Operation string
|
operation string
|
||||||
Err error
|
err error
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *ValidationTimeoutError) Error() string {
|
func (v *ValidationTimeoutError) Error() string {
|
||||||
return fmt.Sprintf("error validating cluster%s: %v", v.Operation, v.Err)
|
return fmt.Sprintf("error validating cluster%s: %s", v.operation, v.err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *ValidationTimeoutError) Unwrap() error {
|
||||||
|
return v.err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is checks that a given error is a ValidationTimeoutError.
|
// Is checks that a given error is a ValidationTimeoutError.
|
||||||
|
|
@ -501,8 +505,8 @@ func (c *RollingUpdateCluster) maybeValidate(operation string, validateCount int
|
||||||
if c.FailOnValidate {
|
if c.FailOnValidate {
|
||||||
klog.Errorf("Cluster did not validate within %s", c.ValidationTimeout)
|
klog.Errorf("Cluster did not validate within %s", c.ValidationTimeout)
|
||||||
return &ValidationTimeoutError{
|
return &ValidationTimeoutError{
|
||||||
Operation: operation,
|
operation: operation,
|
||||||
Err: err,
|
err: err,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue