Skip to content

Commit 032ffb4

Browse files
committed
controllers: tweak events and logging
- Ensure all logged messages start with a lowercase. - Make some pushed (and logged) events of type `EventTypeTrace` to prevent them from being sinked to the external event recorder, to prevent spam. - Only log if artifact is up-to-date with upstream (instead of pushing an event). Signed-off-by: Hidde Beydals <[email protected]>
1 parent 527fce0 commit 032ffb4

File tree

8 files changed

+55
-48
lines changed

8 files changed

+55
-48
lines changed

controllers/bucket_controller.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"time"
2929

3030
gcpstorage "cloud.google.com/go/storage"
31+
"github.com/fluxcd/pkg/runtime/events"
3132
"github.com/fluxcd/source-controller/pkg/gcp"
3233
"github.com/minio/minio-go/v7"
3334
"github.com/minio/minio-go/v7/pkg/credentials"
@@ -134,7 +135,7 @@ func (r *BucketReconciler) Reconcile(ctx context.Context, req ctrl.Request) (res
134135

135136
// Return early if the object is suspended
136137
if obj.Spec.Suspend {
137-
log.Info("Reconciliation is suspended for this object")
138+
log.Info("reconciliation is suspended for this object")
138139
return ctrl.Result{}, nil
139140
}
140141

@@ -221,7 +222,7 @@ func (r *BucketReconciler) summarizeAndPatch(ctx context.Context, obj *sourcev1.
221222
// error.
222223
func (r *BucketReconciler) reconcile(ctx context.Context, obj *sourcev1.Bucket, reconcilers []bucketReconcilerFunc) (sreconcile.Result, error) {
223224
if obj.Generation != obj.Status.ObservedGeneration {
224-
conditions.MarkReconciling(obj, "NewGeneration", "Reconciling new generation %d", obj.Generation)
225+
conditions.MarkReconciling(obj, "NewGeneration", "reconciling new generation %d", obj.Generation)
225226
}
226227

227228
var artifact sourcev1.Artifact
@@ -275,7 +276,7 @@ func (r *BucketReconciler) reconcileStorage(ctx context.Context, obj *sourcev1.B
275276

276277
// Record that we do not have an artifact
277278
if obj.GetArtifact() == nil {
278-
conditions.MarkReconciling(obj, "NoArtifact", "No artifact for resource in storage")
279+
conditions.MarkReconciling(obj, "NoArtifact", "no artifact for resource in storage")
279280
return sreconcile.ResultSuccess, nil
280281
}
281282

@@ -463,8 +464,8 @@ func (r *BucketReconciler) reconcileMinioSource(ctx context.Context, obj *source
463464
conditions.MarkTrue(obj, sourcev1.FetchFailedCondition, sourcev1.BucketOperationFailedReason, e.Err.Error())
464465
return sreconcile.ResultEmpty, e
465466
}
466-
r.eventLogf(ctx, obj, corev1.EventTypeNormal, sourcev1.BucketOperationSucceedReason,
467-
"downloaded %d files from bucket '%s' revision '%s'", len(index), obj.Spec.BucketName, revision)
467+
r.eventLogf(ctx, obj, events.EventTypeTrace, sourcev1.BucketOperationSucceedReason,
468+
"downloaded %d files with revision '%s' from '%s'", len(index), revision, obj.Spec.BucketName)
468469
}
469470
conditions.Delete(obj, sourcev1.FetchFailedCondition)
470471

@@ -618,8 +619,8 @@ func (r *BucketReconciler) reconcileGCPSource(ctx context.Context, obj *sourcev1
618619
conditions.MarkTrue(obj, sourcev1.FetchFailedCondition, sourcev1.BucketOperationFailedReason, e.Err.Error())
619620
return sreconcile.ResultEmpty, e
620621
}
621-
r.eventLogf(ctx, obj, corev1.EventTypeNormal, sourcev1.BucketOperationSucceedReason,
622-
"downloaded %d files from bucket '%s' revision '%s'", len(index), obj.Spec.BucketName, revision)
622+
r.eventLogf(ctx, obj, events.EventTypeTrace, sourcev1.BucketOperationSucceedReason,
623+
"downloaded %d files from bucket '%s'", len(index), obj.Spec.BucketName)
623624
}
624625
conditions.Delete(obj, sourcev1.FetchFailedCondition)
625626

@@ -647,7 +648,7 @@ func (r *BucketReconciler) reconcileArtifact(ctx context.Context, obj *sourcev1.
647648

648649
// The artifact is up-to-date
649650
if obj.GetArtifact().HasRevision(artifact.Revision) {
650-
r.eventLogf(ctx, obj, corev1.EventTypeNormal, meta.SucceededReason, "already up to date, current revision '%s'", artifact.Revision)
651+
ctrl.LoggerFrom(ctx).Info("artifact up-to-date", "revision", artifact.Revision)
651652
return sreconcile.ResultSuccess, nil
652653
}
653654

@@ -713,7 +714,6 @@ func (r *BucketReconciler) reconcileArtifact(ctx context.Context, obj *sourcev1.
713714

714715
// reconcileDelete handles the deletion of an object. It first garbage collects all artifacts for the object from the
715716
// artifact storage, if successful, the finalizer is removed from the object.
716-
// func (r *BucketReconciler) reconcileDelete(ctx context.Context, obj *sourcev1.Bucket) (ctrl.Result, error) {
717717
func (r *BucketReconciler) reconcileDelete(ctx context.Context, obj *sourcev1.Bucket) (sreconcile.Result, error) {
718718
// Garbage collect the resource's artifacts
719719
if err := r.garbageCollect(ctx, obj); err != nil {
@@ -741,7 +741,7 @@ func (r *BucketReconciler) garbageCollect(ctx context.Context, obj *sourcev1.Buc
741741
}
742742
obj.Status.Artifact = nil
743743
// TODO(hidde): we should only push this event if we actually garbage collected something
744-
r.eventLogf(ctx, obj, corev1.EventTypeNormal, "GarbageCollectionSucceeded",
744+
r.eventLogf(ctx, obj, events.EventTypeTrace, "GarbageCollectionSucceeded",
745745
"garbage collected artifacts for deleted resource")
746746
return nil
747747
}
@@ -753,7 +753,7 @@ func (r *BucketReconciler) garbageCollect(ctx context.Context, obj *sourcev1.Buc
753753
}
754754
}
755755
// TODO(hidde): we should only push this event if we actually garbage collected something
756-
r.eventLogf(ctx, obj, corev1.EventTypeNormal, "GarbageCollectionSucceeded", "garbage collected old artifacts")
756+
r.eventLogf(ctx, obj, events.EventTypeTrace, "GarbageCollectionSucceeded", "garbage collected old artifacts")
757757
}
758758
return nil
759759
}

controllers/bucket_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func TestBucketReconciler_reconcileStorage(t *testing.T) {
201201
"!/reconcile-storage/invalid.txt",
202202
},
203203
assertConditions: []metav1.Condition{
204-
*conditions.TrueCondition(meta.ReconcilingCondition, "NoArtifact", "No artifact for resource in storage"),
204+
*conditions.TrueCondition(meta.ReconcilingCondition, "NoArtifact", "no artifact for resource in storage"),
205205
},
206206
},
207207
{

controllers/gitrepository_controller.go

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"time"
2626

2727
securejoin "github.com/cyphar/filepath-securejoin"
28+
"github.com/fluxcd/pkg/runtime/logger"
2829
corev1 "k8s.io/api/core/v1"
2930
apierrors "k8s.io/apimachinery/pkg/api/errors"
3031
"k8s.io/apimachinery/pkg/runtime"
@@ -41,16 +42,17 @@ import (
4142
"github.com/fluxcd/pkg/apis/meta"
4243
"github.com/fluxcd/pkg/runtime/conditions"
4344
helper "github.com/fluxcd/pkg/runtime/controller"
45+
"github.com/fluxcd/pkg/runtime/events"
4446
"github.com/fluxcd/pkg/runtime/patch"
4547
"github.com/fluxcd/pkg/runtime/predicates"
46-
"github.com/fluxcd/source-controller/pkg/sourceignore"
4748

4849
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
4950
serror "github.com/fluxcd/source-controller/internal/error"
5051
sreconcile "github.com/fluxcd/source-controller/internal/reconcile"
5152
"github.com/fluxcd/source-controller/internal/util"
5253
"github.com/fluxcd/source-controller/pkg/git"
5354
"github.com/fluxcd/source-controller/pkg/git/strategy"
55+
"github.com/fluxcd/source-controller/pkg/sourceignore"
5456
)
5557

5658
// Status conditions owned by the GitRepository reconciler.
@@ -139,7 +141,7 @@ func (r *GitRepositoryReconciler) Reconcile(ctx context.Context, req ctrl.Reques
139141

140142
// Return early if the object is suspended
141143
if obj.Spec.Suspend {
142-
log.Info("Reconciliation is suspended for this object")
144+
log.Info("reconciliation is suspended for this object")
143145
return ctrl.Result{}, nil
144146
}
145147

@@ -308,7 +310,7 @@ func (r *GitRepositoryReconciler) reconcileStorage(ctx context.Context, obj *sou
308310
// If both the checkout and signature verification are successful, the given artifact pointer is set to a new artifact
309311
// with the available metadata.
310312
func (r *GitRepositoryReconciler) reconcileSource(ctx context.Context,
311-
obj *sourcev1.GitRepository, artifact *sourcev1.Artifact, includes *artifactSet, dir string) (sreconcile.Result, error) {
313+
obj *sourcev1.GitRepository, artifact *sourcev1.Artifact, _ *artifactSet, dir string) (sreconcile.Result, error) {
312314
// Configure authentication strategy to access the source
313315
var authOpts *git.AuthOptions
314316
var err error
@@ -378,8 +380,7 @@ func (r *GitRepositoryReconciler) reconcileSource(ctx context.Context,
378380
// Coin flip on transient or persistent error, return error and hope for the best
379381
return sreconcile.ResultEmpty, e
380382
}
381-
r.eventLogf(ctx, obj, corev1.EventTypeNormal, sourcev1.GitOperationSucceedReason,
382-
"cloned repository '%s' and checked out revision '%s'", obj.Spec.URL, commit.String())
383+
ctrl.LoggerFrom(ctx).V(logger.DebugLevel).Info("git repository checked out", "url", obj.Spec.URL, "revision", commit.String())
383384
conditions.Delete(obj, sourcev1.FetchFailedCondition)
384385

385386
// Verify commit signature
@@ -420,7 +421,7 @@ func (r *GitRepositoryReconciler) reconcileArtifact(ctx context.Context, obj *so
420421

421422
// The artifact is up-to-date
422423
if obj.GetArtifact().HasRevision(artifact.Revision) && !includes.Diff(obj.Status.IncludedArtifacts) {
423-
r.eventLogf(ctx, obj, corev1.EventTypeNormal, meta.SucceededReason, "already up to date, current revision '%s'", artifact.Revision)
424+
ctrl.LoggerFrom(ctx).Info("artifact up-to-date", "revision", artifact.Revision)
424425
return sreconcile.ResultSuccess, nil
425426
}
426427

@@ -492,7 +493,7 @@ func (r *GitRepositoryReconciler) reconcileArtifact(ctx context.Context, obj *so
492493
url, err := r.Storage.Symlink(*artifact, "latest.tar.gz")
493494
if err != nil {
494495
r.eventLogf(ctx, obj, corev1.EventTypeWarning, sourcev1.StorageOperationFailedReason,
495-
"Failed to update status URL symlink: %s", err)
496+
"failed to update status URL symlink: %s", err)
496497
}
497498
if url != "" {
498499
obj.Status.URL = url
@@ -506,7 +507,7 @@ func (r *GitRepositoryReconciler) reconcileArtifact(ctx context.Context, obj *so
506507
// If an include is unavailable, it marks the object with v1beta1.IncludeUnavailableCondition and returns early.
507508
// If the copy operations are successful, it deletes the v1beta1.IncludeUnavailableCondition from the object.
508509
// If the artifactSet differs from the current set, it marks the object with v1beta1.ArtifactOutdatedCondition.
509-
func (r *GitRepositoryReconciler) reconcileInclude(ctx context.Context, obj *sourcev1.GitRepository, artifact *sourcev1.Artifact, includes *artifactSet, dir string) (sreconcile.Result, error) {
510+
func (r *GitRepositoryReconciler) reconcileInclude(ctx context.Context, obj *sourcev1.GitRepository, _ *sourcev1.Artifact, includes *artifactSet, dir string) (sreconcile.Result, error) {
510511
artifacts := make(artifactSet, len(obj.Spec.Include))
511512
for i, incl := range obj.Spec.Include {
512513
// Do this first as it is much cheaper than copy operations
@@ -544,7 +545,7 @@ func (r *GitRepositoryReconciler) reconcileInclude(ctx context.Context, obj *sou
544545
// Copy artifact (sub)contents to configured directory
545546
if err := r.Storage.CopyToPath(dep.GetArtifact(), incl.GetFromPath(), toPath); err != nil {
546547
e := &serror.Event{
547-
Err: fmt.Errorf("Failed to copy '%s' include from %s to %s: %w", incl.GitRepositoryRef.Name, incl.GetFromPath(), incl.GetToPath(), err),
548+
Err: fmt.Errorf("failed to copy '%s' include from %s to %s: %w", incl.GitRepositoryRef.Name, incl.GetFromPath(), incl.GetToPath(), err),
548549
Reason: "CopyFailure",
549550
}
550551
conditions.MarkTrue(obj, sourcev1.IncludeUnavailableCondition, "CopyFailure", e.Err.Error())
@@ -623,7 +624,7 @@ func (r *GitRepositoryReconciler) verifyCommitSignature(ctx context.Context, obj
623624

624625
conditions.MarkTrue(obj, sourcev1.SourceVerifiedCondition, meta.SucceededReason,
625626
"verified signature of commit '%s'", commit.Hash.String())
626-
r.eventLogf(ctx, obj, corev1.EventTypeNormal, "VerifiedCommit",
627+
r.eventLogf(ctx, obj, events.EventTypeTrace, "VerifiedCommit",
627628
"verified signature of commit '%s'", commit.Hash.String())
628629
return sreconcile.ResultSuccess, nil
629630
}
@@ -641,7 +642,7 @@ func (r *GitRepositoryReconciler) garbageCollect(ctx context.Context, obj *sourc
641642
}
642643
obj.Status.Artifact = nil
643644
// TODO(hidde): we should only push this event if we actually garbage collected something
644-
r.eventLogf(ctx, obj, corev1.EventTypeNormal, "GarbageCollectionSucceeded",
645+
r.eventLogf(ctx, obj, events.EventTypeTrace, "GarbageCollectionSucceeded",
645646
"garbage collected artifacts for deleted resource")
646647
return nil
647648
}
@@ -652,7 +653,7 @@ func (r *GitRepositoryReconciler) garbageCollect(ctx context.Context, obj *sourc
652653
}
653654
}
654655
// TODO(hidde): we should only push this event if we actually garbage collected something
655-
r.eventLogf(ctx, obj, corev1.EventTypeNormal, "GarbageCollectionSucceeded",
656+
r.eventLogf(ctx, obj, events.EventTypeTrace, "GarbageCollectionSucceeded",
656657
"garbage collected old artifacts")
657658
}
658659
return nil

controllers/helmchart_controller.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ func (r *HelmChartReconciler) reconcileSource(ctx context.Context, obj *sourcev1
358358
// a sudden (partial) disappearance of observed state.
359359
// TODO(hidde): include specific name/version information?
360360
if depNum := build.ResolvedDependencies; build.Complete() && depNum > 0 {
361-
r.Eventf(obj, corev1.EventTypeNormal, "ResolvedDependencies", "Resolved %d chart dependencies", depNum)
361+
r.Eventf(obj, events.EventTypeTrace, "ResolvedDependencies", "resolved %d chart dependencies", depNum)
362362
}
363363

364364
// Handle any build error
@@ -638,7 +638,7 @@ func (r *HelmChartReconciler) reconcileArtifact(ctx context.Context, obj *source
638638

639639
// Return early if the build path equals the current artifact path
640640
if curArtifact := obj.GetArtifact(); curArtifact != nil && r.Storage.LocalPath(*curArtifact) == b.Path {
641-
r.eventLogf(ctx, obj, corev1.EventTypeNormal, meta.SucceededReason, "already up to date, current revision '%s'", curArtifact.Revision)
641+
ctrl.LoggerFrom(ctx).Info("artifact up-to-date", "revision", artifact.Revision)
642642
return sreconcile.ResultSuccess, nil
643643
}
644644

@@ -754,7 +754,7 @@ func (r *HelmChartReconciler) garbageCollect(ctx context.Context, obj *sourcev1.
754754
}
755755
obj.Status.Artifact = nil
756756
// TODO(hidde): we should only push this event if we actually garbage collected something
757-
r.eventLogf(ctx, obj, corev1.EventTypeNormal, "GarbageCollectionSucceeded",
757+
r.eventLogf(ctx, obj, events.EventTypeTrace, "GarbageCollectionSucceeded",
758758
"garbage collected artifacts for deleted resource")
759759
return nil
760760
}
@@ -766,7 +766,7 @@ func (r *HelmChartReconciler) garbageCollect(ctx context.Context, obj *sourcev1.
766766
}
767767
}
768768
// TODO(hidde): we should only push this event if we actually garbage collected something
769-
r.eventLogf(ctx, obj, corev1.EventTypeNormal, "GarbageCollectionSucceeded", "garbage collected old artifacts")
769+
r.eventLogf(ctx, obj, events.EventTypeTrace, "GarbageCollectionSucceeded", "garbage collected old artifacts")
770770
}
771771
return nil
772772
}

controllers/helmchart_controller_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ func TestHelmChartReconciler_reconcileSource(t *testing.T) {
232232

233233
g.Expect(obj.Status.ObservedSourceArtifactRevision).To(Equal(gitArtifact.Revision))
234234
g.Expect(obj.Status.Conditions).To(conditions.MatchConditions([]metav1.Condition{
235-
*conditions.TrueCondition(sourcev1.ArtifactOutdatedCondition, "NewChart", "Pulled 'helmchart' chart with version '0.1.0'"),
235+
*conditions.TrueCondition(sourcev1.ArtifactOutdatedCondition, "NewChart", "pulled 'helmchart' chart with version '0.1.0'"),
236236
}))
237237
},
238238
cleanFunc: func(g *WithT, build *chart.Build) {
@@ -880,7 +880,7 @@ func TestHelmChartReconciler_reconcileArtifact(t *testing.T) {
880880
},
881881
want: sreconcile.ResultSuccess,
882882
assertConditions: []metav1.Condition{
883-
*conditions.TrueCondition(meta.ReadyCondition, sourcev1.ChartPullSucceededReason, "Pulled 'helmchart' chart with version '0.1.0'"),
883+
*conditions.TrueCondition(meta.ReadyCondition, sourcev1.ChartPullSucceededReason, "pulled 'helmchart' chart with version '0.1.0'"),
884884
},
885885
},
886886
{
@@ -923,7 +923,7 @@ func TestHelmChartReconciler_reconcileArtifact(t *testing.T) {
923923
t.Expect(obj.Status.URL).To(BeEmpty())
924924
},
925925
assertConditions: []metav1.Condition{
926-
*conditions.TrueCondition(meta.ReadyCondition, sourcev1.ChartPackageSucceededReason, "Packaged 'helmchart' chart with version '0.1.0'"),
926+
*conditions.TrueCondition(meta.ReadyCondition, sourcev1.ChartPackageSucceededReason, "packaged 'helmchart' chart with version '0.1.0'"),
927927
},
928928
},
929929
{
@@ -941,7 +941,7 @@ func TestHelmChartReconciler_reconcileArtifact(t *testing.T) {
941941
},
942942
want: sreconcile.ResultSuccess,
943943
assertConditions: []metav1.Condition{
944-
*conditions.TrueCondition(meta.ReadyCondition, sourcev1.ChartPullSucceededReason, "Pulled 'helmchart' chart with version '0.1.0'"),
944+
*conditions.TrueCondition(meta.ReadyCondition, sourcev1.ChartPullSucceededReason, "pulled 'helmchart' chart with version '0.1.0'"),
945945
},
946946
},
947947
{
@@ -958,7 +958,7 @@ func TestHelmChartReconciler_reconcileArtifact(t *testing.T) {
958958
},
959959
want: sreconcile.ResultSuccess,
960960
assertConditions: []metav1.Condition{
961-
*conditions.TrueCondition(meta.ReadyCondition, sourcev1.ChartPullSucceededReason, "Pulled 'helmchart' chart with version '0.1.0'"),
961+
*conditions.TrueCondition(meta.ReadyCondition, sourcev1.ChartPullSucceededReason, "pulled 'helmchart' chart with version '0.1.0'"),
962962
},
963963
},
964964
}

controllers/helmrepository_controller.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import (
4040
"github.com/fluxcd/pkg/apis/meta"
4141
"github.com/fluxcd/pkg/runtime/conditions"
4242
helper "github.com/fluxcd/pkg/runtime/controller"
43+
"github.com/fluxcd/pkg/runtime/events"
4344
"github.com/fluxcd/pkg/runtime/patch"
4445
"github.com/fluxcd/pkg/runtime/predicates"
4546

@@ -127,7 +128,7 @@ func (r *HelmRepositoryReconciler) Reconcile(ctx context.Context, req ctrl.Reque
127128

128129
// Return early if the object is suspended
129130
if obj.Spec.Suspend {
130-
log.Info("Reconciliation is suspended for this object")
131+
log.Info("reconciliation is suspended for this object")
131132
return ctrl.Result{}, nil
132133
}
133134

@@ -252,7 +253,7 @@ func (r *HelmRepositoryReconciler) reconcile(ctx context.Context, obj *sourcev1.
252253
//
253254
// All artifacts for the resource except for the current one are garbage collected from the storage.
254255
// If the artifact in the Status object of the resource disappeared from storage, it is removed from the object.
255-
// If the hostname of any of the URLs on the object do not match the current storage server hostname, they are updated.
256+
// If the hostname of the URLs on the object do not match the current storage server hostname, they are updated.
256257
func (r *HelmRepositoryReconciler) reconcileStorage(ctx context.Context, obj *sourcev1.HelmRepository, artifact *sourcev1.Artifact, chartRepo *repository.ChartRepository) (sreconcile.Result, error) {
257258
// Garbage collect previous advertised artifact(s) from storage
258259
_ = r.garbageCollect(ctx, obj)
@@ -413,7 +414,7 @@ func (r *HelmRepositoryReconciler) reconcileArtifact(ctx context.Context, obj *s
413414
}()
414415

415416
if obj.GetArtifact().HasRevision(artifact.Revision) {
416-
r.eventLogf(ctx, obj, corev1.EventTypeNormal, meta.SucceededReason, "already up to date, current revision '%s'", artifact.Revision)
417+
ctrl.LoggerFrom(ctx).Info("artifact up-to-date", "revision", artifact.Revision)
417418
return sreconcile.ResultSuccess, nil
418419
}
419420

@@ -450,6 +451,11 @@ func (r *HelmRepositoryReconciler) reconcileArtifact(ctx context.Context, obj *s
450451
}
451452
}
452453

454+
r.AnnotatedEventf(obj, map[string]string{
455+
"revision": artifact.Revision,
456+
"checksum": artifact.Checksum,
457+
}, corev1.EventTypeNormal, "NewArtifact", "stored artifact for revision '%s'", artifact.Revision)
458+
453459
// Record it on the object.
454460
obj.Status.Artifact = artifact.DeepCopy()
455461

@@ -495,7 +501,7 @@ func (r *HelmRepositoryReconciler) garbageCollect(ctx context.Context, obj *sour
495501
}
496502
obj.Status.Artifact = nil
497503
// TODO(hidde): we should only push this event if we actually garbage collected something
498-
r.eventLogf(ctx, obj, corev1.EventTypeNormal, "GarbageCollectionSucceeded",
504+
r.eventLogf(ctx, obj, events.EventTypeTrace, "GarbageCollectionSucceeded",
499505
"garbage collected artifacts for deleted resource")
500506
return nil
501507
}
@@ -507,7 +513,7 @@ func (r *HelmRepositoryReconciler) garbageCollect(ctx context.Context, obj *sour
507513
}
508514
}
509515
// TODO(hidde): we should only push this event if we actually garbage collected something
510-
r.eventLogf(ctx, obj, corev1.EventTypeNormal, "GarbageCollectionSucceeded",
516+
r.eventLogf(ctx, obj, events.EventTypeTrace, "GarbageCollectionSucceeded",
511517
"garbage collected old artifacts")
512518
}
513519
return nil

internal/helm/chart/builder.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,16 @@ type Build struct {
140140
// Summary returns a human-readable summary of the Build.
141141
func (b *Build) Summary() string {
142142
if !b.HasMetadata() {
143-
return "No chart build"
143+
return "no chart build"
144144
}
145145

146146
var s strings.Builder
147147

148-
var action = "New"
148+
var action = "new"
149149
if b.Path != "" {
150-
action = "Pulled"
150+
action = "pulled"
151151
if b.Packaged {
152-
action = "Packaged"
152+
action = "packaged"
153153
}
154154
}
155155
s.WriteString(fmt.Sprintf("%s '%s' chart with version '%s'", action, b.Name, b.Version))

0 commit comments

Comments
 (0)