mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
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 ```
This commit is contained in:
commit
d17bbf8d38
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user