-
Notifications
You must be signed in to change notification settings - Fork 826
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
Refactor err check in GS controller a bit. Add event if Pod was not created #1499
Conversation
Build Succeeded 👏 Build Id: 4f8f474a-a085-4606-b9bd-f5a5abe05796 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
4e1a7d0
to
6072398
Compare
Stackdriver logs for this situation:
|
How to reproduce panic:
But this is ok, like in Agones master, do not panic:
|
Build Failed 😱 Build Id: d2cb0f04-1c15-4548-a381-626d906836b6 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
6072398
to
29116c3
Compare
Build Succeeded 👏 Build Id: fc168da0-17e6-44f9-aa70-e8781181b224 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
if err != nil { | ||
if k8serrors.IsInvalid(err) { | ||
switch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Niiiiice.
pkg/gameservers/controller.go
Outdated
c.loggerForGameServer(gs).WithField("pod", pod).Errorf("Pod created is forbidden") | ||
gs, err = c.moveToErrorState(gs, err.Error()) | ||
return gs, err | ||
} | ||
c.loggerForGameServer(gs).WithField("pod", pod).WithError(err) | ||
c.recorder.Eventf(gs, corev1.EventTypeWarning, string(gs.Status.State), "error creating Pod for GameServer %s", gs.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a default:
state of the switch, rather than sit outside the switch?
Since moveToErrorState
will create an event, then we'll get 2 events with the same Error warning if the errors types is AlreadyExists
, Invalid
or Forbidden
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is true
Propagate error to event.
29116c3
to
d6151ba
Compare
Build Succeeded 👏 Build Id: e48a50c6-c640-4402-b4ef-50704890d5f8 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aLekSer, markmandel 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 |
Propagate error to event.
Fix panic when error is nil. Propagate error to event, to see which validation has failed.
Example of this if branch:
What type of PR is this?
/kind feature
What this PR does / Why we need it:
Which issue(s) this PR fixes:
For #1475 .
Special notes for your reviewer: