Skip to content

Commit

Permalink
Add a log message before restarting pods
Browse files Browse the repository at this point in the history
fixes: #973
  • Loading branch information
git-hyagi authored and openshift-merge-robot committed Jun 21, 2023
1 parent 2a12794 commit 7195e75
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES/973.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Added a log message when restarting `api` and `content` pods in case of a
secret reconciliation.
3 changes: 2 additions & 1 deletion controllers/repo_manager/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,12 @@ func (r *RepoManagerReconciler) pulpApiController(ctx context.Context, pulp *rep
r.Get(ctx, types.NamespacedName{Name: pulp.Name + "-server", Namespace: pulp.Namespace}, serverSecret)
expectedServerSecret := pulpServerSecret(funcResources)
if requeue, err := reconcileObject(funcResources, expectedServerSecret, serverSecret, conditionType); err != nil || requeue {

log.Info("Reprovisioning pulpcore-api pods to get the new settings ...")
// when requeue==true it means the secret changed so we need to redeploy api and content pods to get the new settings.py
r.restartPods(pulp, apiDeployment)
contentDeployment := &appsv1.Deployment{}
r.Get(ctx, types.NamespacedName{Name: pulp.Name + "-content", Namespace: pulp.Namespace}, contentDeployment)
log.Info("Reprovisioning pulpcore-content pods to get the new settings ...")
r.restartPods(pulp, contentDeployment)

return ctrl.Result{Requeue: requeue}, err
Expand Down

0 comments on commit 7195e75

Please sign in to comment.