generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add UnretryableError error, doesn't require reconcile retry. * Add integration/unit tests. * Address PR comments. * Add ValidateLabelAsCRDName call for the pod-group, make pod-group label immutable.
- Loading branch information
1 parent
bf0b607
commit 5695e32
Showing
9 changed files
with
382 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package jobframework | ||
|
||
import "errors" | ||
|
||
// UnretryableError is an error that doesn't require reconcile retry | ||
// and will not be returned by the JobReconciler. | ||
func UnretryableError(msg string) error { | ||
return &unretryableError{msg: msg} | ||
} | ||
|
||
type unretryableError struct { | ||
msg string | ||
} | ||
|
||
func (e *unretryableError) Error() string { | ||
return e.msg | ||
} | ||
|
||
func IsUnretryableError(e error) bool { | ||
var unretryableError *unretryableError | ||
return errors.As(e, &unretryableError) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.