Skip to content
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

fix apiserver crashed when priority classs already exists #67372

Merged
merged 1 commit into from
Aug 16, 2018

Conversation

tanshanshan
Copy link

@tanshanshan tanshanshan commented Aug 14, 2018

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:

kube-apiserver: fixes error creating system priority classes when starting multiple apiservers simultaneously

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Aug 14, 2018
@tanshanshan
Copy link
Author

/test pull-kubernetes-e2e-kops-aws

@@ -101,7 +101,7 @@ func AddSystemPriorityClasses() genericapiserver.PostStartHookFunc {
return true, nil
})
// if we're never able to make it through initialization, kill the API server.
if err != nil {
if err != nil && !apierrors.IsAlreadyExists(err) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the AlreadyExists error should be tolerated on line 87, not here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the AlreadyExists error should be tolerated on line 87, not here

agree. returning a false, nil here will give a retry, amiright?

@yue9944882
Copy link
Member

yue9944882 commented Aug 15, 2018

/hold

/cc @liggitt i'd prefer a create-on-update to simplify all such initializers. it would be cleaner and hassle-free. wdyt?

(xref similar complex logic)

return c.CreateOrUpdateMasterServiceIfNeeded(serviceName, serviceIP, servicePorts, serviceType, reconcile)

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 15, 2018
@liggitt
Copy link
Member

liggitt commented Aug 15, 2018

/cc @liggitt i'd prefer a create-on-update to simplify all such initializers. it would be cleaner and hassle-free. wdyt?

tolerating AlreadyExists here is a fine change to make, and is a much smaller change, and we'd want that picked back to 1.11

@liggitt
Copy link
Member

liggitt commented Aug 15, 2018

@tanshanshan were you planning on reopening this PR? I think this fix was on the right track

@yue9944882
Copy link
Member

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 15, 2018
@tanshanshan tanshanshan reopened this Aug 16, 2018
@tanshanshan
Copy link
Author

/assign @liggitt

@liggitt
Copy link
Member

liggitt commented Aug 16, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 16, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, tanshanshan

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 16, 2018
@k8s-github-robot
Copy link

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 here.

@k8s-github-robot k8s-github-robot merged commit d17bbf8 into kubernetes:master Aug 16, 2018
@k8s-ci-robot k8s-ci-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Aug 21, 2018
@k8s-ci-robot k8s-ci-robot removed the release-note-none Denotes a PR that doesn't merit a release note. label Aug 21, 2018
@neolit123
Copy link
Member

/sig api-machinery

@k8s-ci-robot k8s-ci-robot added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Aug 24, 2018
k8s-github-robot pushed a commit that referenced this pull request Aug 28, 2018
…67372-upstream-release-1.11

Automatic merge from submit-queue.

Automated cherry pick of #67372: fix apiserver crashed when priority classs already exists

Cherry pick of #67372 on release-1.11.

#67372: fix apiserver crashed when priority classs already exists

```release-note
kube-apiserver: fixes error creating system priority classes when starting multiple apiservers simultaneously
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

apiserver crashed when priority classs already exists
6 participants