mirror of
https://github.com/kubernetes/kubectl.git
synced 2026-05-21 09:48:08 -04:00
* kubectl: use %w for error wrapping and remove redundant .Error() calls Replace fmt.Errorf with %s and err.Error() with idiomatic %w wrapping in kubectl's polymorphichelpers, wait, and drain packages. This enables proper error chain inspection via errors.Is/As and follows Go best practices. Also fixes a typo: "Statefulset" -> "StatefulSet" in history.go. * Address review: use %w for error wrapping in extendErrWaitTimeout Use fmt.Errorf with %w instead of %v to preserve the error chain, allowing wait.Interrupted() to correctly detect timeout errors. Signed-off-by: supermario_leo <leo.stack@outlook.com> * Fix lint: wrap both errors with %w in cordon error path The linter flags err used with %v when it is an error type. Since Go 1.20+ supports multiple %w verbs in a single fmt.Errorf call, wrap both err and patchErr to preserve both error chains. Signed-off-by: supermario_leo <leo.stack@outlook.com> --------- Signed-off-by: supermario_leo <leo.stack@outlook.com> Kubernetes-commit: d916c320deb859cd264354c48f3bd5419f7a2950 |
||
|---|---|---|
| .. | ||
| attachablepodforobject.go | ||
| canbeexposed.go | ||
| canbeexposed_test.go | ||
| helpers.go | ||
| helpers_test.go | ||
| history.go | ||
| history_test.go | ||
| historyviewer.go | ||
| interface.go | ||
| logsforobject.go | ||
| logsforobject_test.go | ||
| mapbasedselectorforobject.go | ||
| mapbasedselectorforobject_test.go | ||
| multiprotocolsforobject.go | ||
| multiprotocolsforobject_test.go | ||
| objectpauser.go | ||
| objectpauser_test.go | ||
| objectrestarter.go | ||
| objectresumer.go | ||
| objectresumer_test.go | ||
| portsforobject.go | ||
| portsforobject_test.go | ||
| protocolsforobject.go | ||
| protocolsforobject_test.go | ||
| rollback.go | ||
| rollback_test.go | ||
| rollbacker.go | ||
| rollout_status.go | ||
| rollout_status_test.go | ||
| statusviewer.go | ||
| updatepodspec.go | ||
| updatepodspec_test.go | ||