mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
fix apiserver crashed when priority classs already exists
This commit is contained in:
parent
6274590518
commit
a99b619c11
@ -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