-
Notifications
You must be signed in to change notification settings - Fork 972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove shadowPodgroup in scheduler #406
Conversation
pkg/scheduler/cache/cache.go
Outdated
sc.Recorder.Eventf(pg, v1.EventTypeNormal, "Evict", reason) | ||
} else { | ||
return fmt.Errorf("Invalid PodGroup Version: %s", job.PodGroup.Version) | ||
if job.PodGroup.Version == api.PodGroupVersionV1Alpha1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's move this into a helper function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new a func convertPodGroupInfo() :)
pkg/scheduler/cache/util.go
Outdated
if len(jobID) == 0 { | ||
jobID = api.JobID(pod.UID) | ||
} | ||
pgName := helpers.GeneratePodgroupName(pod) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we still need this function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should also update pod's podgroup-name in podgroup controller for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
? ? in podgroup controller pg name is the same as here, don't need update pg-name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At lease we should rename this function, since the ShadowPodGroup
concept has been deprecated.
Hey @wangyuqing4, TravisCI finished with status TravisBuddy Request Identifier: fbfdde80-b5ce-11e9-a786-5b97e93928e7 |
Travis tests have failedHey @wangyuqing4, TravisBuddy Request Identifier: 148af2b0-b5d6-11e9-a786-5b97e93928e7 |
pkg/scheduler/cache/cache.go
Outdated
glog.Errorf("Error While converting api.PodGroup to v1alpha.PodGroup with error: %v", err) | ||
return err | ||
} | ||
sc.Recorder.Eventf(pg, eventtype, reason, message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we record this event?
pkg/scheduler/cache/cache.go
Outdated
} else { | ||
return fmt.Errorf("Invalid PodGroup Version: %s", job.PodGroup.Version) | ||
} | ||
if err := sc.convertPodGroupInfo(job, v1.EventTypeNormal, "Evict", reason); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move the record event code outside of the convertPodGroupInfo.
// If pending or unschedulable, record unschedulable event. | ||
if pgUnschedulable || pdbUnschedulabe { | ||
if err := sc.convertPodGroupInfo(job); err != nil { | ||
glog.Errorf("Error While converting api.PodGroup %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should record event here :)
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: k82cn, wangyuqing4 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
in pr #401, podgroup controller can create pg for normal pod, so remove shadowPodgroup part code in scheduler.