Skip to content

Commit

Permalink
DNM: more logging
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Tantsur <dtantsur@protonmail.com>
  • Loading branch information
dtantsur committed Mar 22, 2024
1 parent dd28a83 commit 6858eb8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/ironic/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ func ensureDatabaseDeployment(cctx ControllerContext, db *metal3api.IronicDataba
ObjectMeta: metav1.ObjectMeta{Name: databaseDeploymentName(db), Namespace: db.Namespace},
}
_, err := controllerutil.CreateOrUpdate(cctx.Context, cctx.Client, deploy, func() error {
cctx.Logger.Info("CreateOrUpdate: before change", "Deploy", deploy)
if deploy.ObjectMeta.CreationTimestamp.IsZero() {
cctx.Logger.Info("creating a new deployment")
matchLabels := map[string]string{metal3api.IronicOperatorLabel: databaseDeploymentName(db)}
Expand All @@ -133,7 +134,10 @@ func ensureDatabaseDeployment(cctx ControllerContext, db *metal3api.IronicDataba
deploy.Spec.Replicas = pointer.Int32(1)
}
deploy.Spec.Template = newDatabasePodTemplate(db)
return controllerutil.SetControllerReference(db, deploy, cctx.Scheme)
cctx.Logger.Info("CreateOrUpdate: after change", "Deploy", deploy)
err1 := controllerutil.SetControllerReference(db, deploy, cctx.Scheme)
cctx.Logger.Info("CreateOrUpdate: after reference", "Deploy", deploy)
return err1
})
if err != nil {
return metal3api.IronicStatusProgressing, err
Expand Down

0 comments on commit 6858eb8

Please sign in to comment.