-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace agent's logger with logr.Logger
- Loading branch information
Mario Manno
committed
Oct 23, 2023
1 parent
2a5ab4d
commit 2a60f2a
Showing
8 changed files
with
84 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,8 @@ type BundleDeploymentReconciler struct { | |
// For more details, check Reconcile and its Result here: | ||
// - https://pkg.go.dev/sigs.k8s.io/[email protected]/pkg/reconcile | ||
func (r *BundleDeploymentReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { | ||
_ = log.FromContext(ctx).WithName("bundledeployment") | ||
logger := log.FromContext(ctx).WithName("bundledeployment") | ||
ctx = log.IntoContext(ctx, logger) | ||
|
||
// get latest BundleDeployment from cluster | ||
bd := &fleetv1.BundleDeployment{} | ||
|
@@ -73,13 +74,15 @@ func (r *BundleDeploymentReconciler) Reconcile(ctx context.Context, req ctrl.Req | |
var updateErr error | ||
bd, updateErr = updateCondition(ctx, r.Client, bd, &status, err, condition.Cond(fleetv1.BundleDeploymentConditionDeployed)) | ||
if err != nil { | ||
logger.V(1).Error(err, "Failed to deploy bundle", "status", status) | ||
return ctrl.Result{ | ||
// Defaults | ||
Requeue: false, | ||
RequeueAfter: 0, | ||
}, err | ||
} | ||
if updateErr != nil { | ||
logger.V(1).Error(updateErr, "Failed to update bundledeployment status", "step", "deploy", "status", status) | ||
return ctrl.Result{}, updateErr | ||
} | ||
|
||
|
@@ -95,11 +98,13 @@ func (r *BundleDeploymentReconciler) Reconcile(ctx context.Context, req ctrl.Req | |
return ctrl.Result{}, err | ||
} | ||
if updateErr != nil { | ||
logger.V(1).Error(updateErr, "Failed to update bundledeployment status", "step", "monitor", "status", status) | ||
return ctrl.Result{}, updateErr | ||
} | ||
|
||
_, err = r.DriftDetect.Refresh(req.String(), bd) | ||
_, err = r.DriftDetect.Refresh(logger, req.String(), bd) | ||
if err != nil { | ||
logger.V(1).Error(err, "Failed to refresh drift detection", "step", "drift") | ||
return ctrl.Result{}, err | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.