Skip to content

Commit

Permalink
add some logs to SPC controller (#976)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatousJobanek authored Feb 29, 2024
1 parent c4bf618 commit 8779420
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) err
// Reconcile ensures that SpaceProvisionerConfig is valid and points to an existing ToolchainCluster.
func (r *Reconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error) {
logger := log.FromContext(ctx)
logger.Info("reconciling SpaceProvisonerConfig")

spaceProvisionerConfig := &toolchainv1alpha1.SpaceProvisionerConfig{}
if err := r.Client.Get(ctx, request.NamespacedName, spaceProvisionerConfig); err != nil {
Expand Down Expand Up @@ -100,6 +101,7 @@ func (r *Reconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.
Message: toolchainPresenceMessage,
})

logger.Info("updating SpaceProvisionerConfig", "status", toolchainPresent, "reason", toolchainPresenceReason)
if err := r.Client.Status().Update(ctx, spaceProvisionerConfig); err != nil {
if reportedError != nil {
logger.Info("failed to update the status (reported as failed reconciliation) with a previous unreported error during reconciliation", "unreportedError", reportedError)
Expand Down

0 comments on commit 8779420

Please sign in to comment.