Skip to content

Commit

Permalink
Merge pull request #402 from stlaz/deployment_panic
Browse files Browse the repository at this point in the history
Bug 1921275: deploymentController: treat error retrieving authentication.operator/cluster
  • Loading branch information
openshift-merge-robot committed Jan 28, 2021
2 parents 50ab4dc + 9fbe5e2 commit 7f0e2b1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/controllers/deployment/deployment_controller.go
Expand Up @@ -366,15 +366,18 @@ func (c *deploymentController) updateOperatorDeploymentInfo(

if operatorStatusOutdated {
if err := retry.RetryOnConflict(retry.DefaultRetry, func() error {
operatorConfig, _ := c.getAuthConfig(ctx)
operatorConfig, err := c.auth.Authentications().Get(ctx, "cluster", metav1.GetOptions{})
if err != nil {
return err
}

// make sure we record the changes to the deployment
// if this fail, lets resync, this should not fail
resourcemerge.SetDeploymentGeneration(&operatorConfig.Status.Generations, deployment)
operatorConfig.Status.ObservedGeneration = operatorConfig.Generation
operatorConfig.Status.ReadyReplicas = deployment.Status.UpdatedReplicas

_, err := c.auth.Authentications().UpdateStatus(ctx, operatorConfig, metav1.UpdateOptions{})
_, err = c.auth.Authentications().UpdateStatus(ctx, operatorConfig, metav1.UpdateOptions{})
return err
}); err != nil {
syncContext.Recorder().Warningf("AuthenticationUpdateStatusFailed", "Failed to update authentication operator status: %v", err)
Expand Down

0 comments on commit 7f0e2b1

Please sign in to comment.