mirror of https://github.com/k3s-io/k3s
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 ```pull/8/head
commit
d17bbf8d38
|
@ -85,7 +85,7 @@ func AddSystemPriorityClasses() genericapiserver.PostStartHookFunc {
|
|||
if err != nil {
|
||||
if apierrors.IsNotFound(err) {
|
||||
_, err := schedClientSet.PriorityClasses().Create(pc)
|
||||
if err != nil {
|
||||
if err != nil && !apierrors.IsAlreadyExists(err) {
|
||||
return false, err
|
||||
} else {
|
||||
glog.Infof("created PriorityClass %s with value %v", pc.Name, pc.Value)
|
||||
|
|
Loading…
Reference in New Issue