Skip to content

Commit f97bbb6

Browse files
authored
Merge pull request #887 from fluxcd/rm-log-rec-id
Remove custom reconcileID value from OCI HelmRepo logger and context overwrite
2 parents 6a560d9 + 59294bf commit f97bbb6

6 files changed

+1
-28
lines changed

controllers/bucket_controller.go

-4
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,6 @@ func (r *BucketReconciler) Reconcile(ctx context.Context, req ctrl.Request) (res
249249
start := time.Now()
250250
log := ctrl.LoggerFrom(ctx)
251251

252-
// logger will be associated to the new context that is
253-
// returned from ctrl.LoggerInto.
254-
ctx = ctrl.LoggerInto(ctx, log)
255-
256252
// Fetch the Bucket
257253
obj := &sourcev1.Bucket{}
258254
if err := r.Get(ctx, req.NamespacedName, obj); err != nil {

controllers/gitrepository_controller.go

-4
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,6 @@ func (r *GitRepositoryReconciler) Reconcile(ctx context.Context, req ctrl.Reques
164164
start := time.Now()
165165
log := ctrl.LoggerFrom(ctx)
166166

167-
// logger will be associated to the new context that is
168-
// returned from ctrl.LoggerInto.
169-
ctx = ctrl.LoggerInto(ctx, log)
170-
171167
// Fetch the GitRepository
172168
obj := &sourcev1.GitRepository{}
173169
if err := r.Get(ctx, req.NamespacedName, obj); err != nil {

controllers/helmchart_controller.go

-4
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,6 @@ func (r *HelmChartReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
185185
start := time.Now()
186186
log := ctrl.LoggerFrom(ctx)
187187

188-
// logger will be associated to the new context that is
189-
// returned from ctrl.LoggerInto.
190-
ctx = ctrl.LoggerInto(ctx, log)
191-
192188
// Fetch the HelmChart
193189
obj := &sourcev1.HelmChart{}
194190
if err := r.Get(ctx, req.NamespacedName, obj); err != nil {

controllers/helmrepository_controller.go

-4
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,6 @@ func (r *HelmRepositoryReconciler) Reconcile(ctx context.Context, req ctrl.Reque
150150
start := time.Now()
151151
log := ctrl.LoggerFrom(ctx)
152152

153-
// logger will be associated to the new context that is
154-
// returned from ctrl.LoggerInto.
155-
ctx = ctrl.LoggerInto(ctx, log)
156-
157153
// Fetch the HelmRepository
158154
obj := &sourcev1.HelmRepository{}
159155
if err := r.Get(ctx, req.NamespacedName, obj); err != nil {

controllers/helmrepository_controller_oci.go

+1-8
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import (
3333
"k8s.io/apimachinery/pkg/runtime"
3434
"k8s.io/apimachinery/pkg/types"
3535
kerrors "k8s.io/apimachinery/pkg/util/errors"
36-
"k8s.io/apimachinery/pkg/util/uuid"
3736
kuberecorder "k8s.io/client-go/tools/record"
3837
ctrl "sigs.k8s.io/controller-runtime"
3938
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -113,13 +112,7 @@ func (r *HelmRepositoryOCIReconciler) SetupWithManagerAndOptions(mgr ctrl.Manage
113112

114113
func (r *HelmRepositoryOCIReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, retErr error) {
115114
start := time.Now()
116-
log := ctrl.LoggerFrom(ctx).
117-
// Sets a reconcile ID to correlate logs from all suboperations.
118-
WithValues("reconcileID", uuid.NewUUID())
119-
120-
// logger will be associated to the new context that is
121-
// returned from ctrl.LoggerInto.
122-
ctx = ctrl.LoggerInto(ctx, log)
115+
log := ctrl.LoggerFrom(ctx)
123116

124117
// Fetch the HelmRepository
125118
obj := &sourcev1.HelmRepository{}

controllers/ocirepository_controller.go

-4
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,6 @@ func (r *OCIRepositoryReconciler) Reconcile(ctx context.Context, req ctrl.Reques
161161
start := time.Now()
162162
log := ctrl.LoggerFrom(ctx)
163163

164-
// logger will be associated to the new context that is
165-
// returned from ctrl.LoggerInto.
166-
ctx = ctrl.LoggerInto(ctx, log)
167-
168164
// Fetch the OCIRepository
169165
obj := &sourcev1.OCIRepository{}
170166
if err := r.Get(ctx, req.NamespacedName, obj); err != nil {

0 commit comments

Comments
 (0)