generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Introduce new ComposableJob interface for jobs which has to be composed of different API objects. * Add custom get. A composable job can get all it's elements at the beginning of the reconcile. * Add ComposableJob implementation for pod groups. * Add webhook checks for pod group labels and annotations. * Update Finished method for pod group * IsSuspended and Stop methods of the pod controller now interact with all the pods at once. * Update IsActive function to check if at least one pod in the group is running. * Change podSuspended method. * Add stop skip for pods in group that already have a delition timestamp. * Add IsComposableJobActive * Add UnretryableError error, that doesn't require reconcile retry. * Add ValidateLabelAsCRDName call for the pod-group, make pod-group label immutable. * Add unit tests for pod group integration
- Loading branch information
1 parent
1ecd79f
commit c264f4c
Showing
15 changed files
with
2,797 additions
and
526 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.