Unverified Commit d17bbf8d authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #67372 from tanshanshan/priority-814

Automatic merge from submit-queue (batch tested with PRs 67137, 67372, 67505, 67373, 67357). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. fix apiserver crashed when priority classs already exists **What this PR does / why we need it**: when priority classs already exists , ignore error **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes #67367 **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
parents d3a0bb6a a99b619c
...@@ -85,7 +85,7 @@ func AddSystemPriorityClasses() genericapiserver.PostStartHookFunc { ...@@ -85,7 +85,7 @@ func AddSystemPriorityClasses() genericapiserver.PostStartHookFunc {
if err != nil { if err != nil {
if apierrors.IsNotFound(err) { if apierrors.IsNotFound(err) {
_, err := schedClientSet.PriorityClasses().Create(pc) _, err := schedClientSet.PriorityClasses().Create(pc)
if err != nil { if err != nil && !apierrors.IsAlreadyExists(err) {
return false, err return false, err
} else { } else {
glog.Infof("created PriorityClass %s with value %v", pc.Name, pc.Value) glog.Infof("created PriorityClass %s with value %v", pc.Name, pc.Value)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment