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

Don't log when a pod can't be found on startup #3393

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pkg/gameservers/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,6 @@ func (c *Controller) createGameServerPod(ctx context.Context, gs *agonesv1.GameS
gs, err = c.moveToErrorState(ctx, gs, err.Error())
return gs, err
default:
loggerForGameServer(gs, c.baseLogger).WithField("pod", pod).WithError(err)
c.recorder.Eventf(gs, corev1.EventTypeWarning, string(gs.Status.State), "error creating Pod for GameServer %s", gs.Name)
return gs, errors.Wrapf(err, "error creating Pod for GameServer %s", gs.Name)
}
Expand Down Expand Up @@ -787,6 +786,12 @@ func (c *Controller) syncGameServerStartingState(ctx context.Context, gs *agones
// so if there is an error of any kind, then move this to queue backoff
pod, err := c.gameServerPod(gs)
if err != nil {
// expected to happen, so don't log it.
if k8serrors.IsNotFound(err) {
return nil, workerqueue.NewDebugError(err)
}

// do log if it's something other than NotFound, since that's weird.
return nil, err
}
if pod.Spec.NodeName == "" {
Expand Down