mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-13 11:25:19 +00:00
Grow signature for predicate attributes to include init status
This commit is contained in:
@@ -112,12 +112,12 @@ func CronJobToSelectableFields(cronJob *batch.CronJob) fields.Set {
|
||||
}
|
||||
|
||||
// GetAttrs returns labels and fields of a given object for filtering purposes.
|
||||
func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, error) {
|
||||
func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, bool, error) {
|
||||
cronJob, ok := obj.(*batch.CronJob)
|
||||
if !ok {
|
||||
return nil, nil, fmt.Errorf("Given object is not a scheduled job.")
|
||||
return nil, nil, false, fmt.Errorf("given object is not a scheduled job.")
|
||||
}
|
||||
return labels.Set(cronJob.ObjectMeta.Labels), CronJobToSelectableFields(cronJob), nil
|
||||
return labels.Set(cronJob.ObjectMeta.Labels), CronJobToSelectableFields(cronJob), cronJob.Initializers != nil, nil
|
||||
}
|
||||
|
||||
// MatchCronJob is the filter used by the generic etcd backend to route
|
||||
|
||||
@@ -174,12 +174,12 @@ func JobToSelectableFields(job *batch.Job) fields.Set {
|
||||
}
|
||||
|
||||
// GetAttrs returns labels and fields of a given object for filtering purposes.
|
||||
func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, error) {
|
||||
func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, bool, error) {
|
||||
job, ok := obj.(*batch.Job)
|
||||
if !ok {
|
||||
return nil, nil, fmt.Errorf("Given object is not a job.")
|
||||
return nil, nil, false, fmt.Errorf("given object is not a job.")
|
||||
}
|
||||
return labels.Set(job.ObjectMeta.Labels), JobToSelectableFields(job), nil
|
||||
return labels.Set(job.ObjectMeta.Labels), JobToSelectableFields(job), job.Initializers != nil, nil
|
||||
}
|
||||
|
||||
// MatchJob is the filter used by the generic etcd backend to route
|
||||
|
||||
Reference in New Issue
Block a user