@@ -28,6 +28,7 @@ import (
2828 "strings"
2929 "time"
3030
31+ eventv1 "github.com/fluxcd/pkg/apis/event/v1beta1"
3132 soci "github.com/fluxcd/source-controller/internal/oci"
3233 helmgetter "helm.sh/helm/v3/pkg/getter"
3334 helmreg "helm.sh/helm/v3/pkg/registry"
@@ -53,7 +54,6 @@ import (
5354 "github.com/fluxcd/pkg/oci"
5455 "github.com/fluxcd/pkg/runtime/conditions"
5556 helper "github.com/fluxcd/pkg/runtime/controller"
56- "github.com/fluxcd/pkg/runtime/events"
5757 "github.com/fluxcd/pkg/runtime/patch"
5858 "github.com/fluxcd/pkg/runtime/predicates"
5959 "github.com/fluxcd/pkg/untar"
@@ -404,7 +404,7 @@ func (r *HelmChartReconciler) reconcileSource(ctx context.Context, obj *sourcev1
404404 if helmRepo , ok := s .(* sourcev1.HelmRepository ); ! ok || helmRepo .Spec .Type != sourcev1 .HelmRepositoryTypeOCI {
405405 conditions .MarkTrue (obj , sourcev1 .FetchFailedCondition , "NoSourceArtifact" ,
406406 "no artifact available for %s source '%s'" , obj .Spec .SourceRef .Kind , obj .Spec .SourceRef .Name )
407- r .eventLogf (ctx , obj , events .EventTypeTrace , "NoSourceArtifact" ,
407+ r .eventLogf (ctx , obj , eventv1 .EventTypeTrace , "NoSourceArtifact" ,
408408 "no artifact available for %s source '%s'" , obj .Spec .SourceRef .Kind , obj .Spec .SourceRef .Name )
409409 return sreconcile .ResultRequeue , nil
410410 }
@@ -426,7 +426,7 @@ func (r *HelmChartReconciler) reconcileSource(ctx context.Context, obj *sourcev1
426426 // a sudden (partial) disappearance of observed state.
427427 // TODO(hidde): include specific name/version information?
428428 if depNum := build .ResolvedDependencies ; build .Complete () && depNum > 0 {
429- r .Eventf (obj , events .EventTypeTrace , "ResolvedDependencies" , "resolved %d chart dependencies" , depNum )
429+ r .Eventf (obj , eventv1 .EventTypeTrace , "ResolvedDependencies" , "resolved %d chart dependencies" , depNum )
430430 }
431431
432432 // Handle any build error
@@ -638,7 +638,7 @@ func (r *HelmChartReconciler) buildFromHelmRepository(ctx context.Context, obj *
638638 // Using r.Storage.LocalPath(*repo.GetArtifact() is safe as the path is in the format /<helm-repository-name>/<chart-name>/<filename>.
639639 err := httpChartRepo .CacheIndexInMemory ()
640640 if err != nil {
641- r .eventLogf (ctx , obj , events .EventTypeTrace , sourcev1 .CacheOperationFailedReason , "failed to cache index: %s" , err )
641+ r .eventLogf (ctx , obj , eventv1 .EventTypeTrace , sourcev1 .CacheOperationFailedReason , "failed to cache index: %s" , err )
642642 }
643643 }
644644
@@ -829,7 +829,7 @@ func (r *HelmChartReconciler) reconcileArtifact(ctx context.Context, obj *source
829829
830830 // Return early if the build path equals the current artifact path
831831 if curArtifact := obj .GetArtifact (); curArtifact != nil && r .Storage .LocalPath (* curArtifact ) == b .Path {
832- r .eventLogf (ctx , obj , events .EventTypeTrace , sourcev1 .ArtifactUpToDateReason , "artifact up-to-date with remote revision: '%s'" , artifact .Revision )
832+ r .eventLogf (ctx , obj , eventv1 .EventTypeTrace , sourcev1 .ArtifactUpToDateReason , "artifact up-to-date with remote revision: '%s'" , artifact .Revision )
833833 return sreconcile .ResultSuccess , nil
834834 }
835835
@@ -873,7 +873,7 @@ func (r *HelmChartReconciler) reconcileArtifact(ctx context.Context, obj *source
873873 // Update symlink on a "best effort" basis
874874 symURL , err := r .Storage .Symlink (artifact , "latest.tar.gz" )
875875 if err != nil {
876- r .eventLogf (ctx , obj , events .EventTypeTrace , sourcev1 .SymlinkUpdateFailedReason ,
876+ r .eventLogf (ctx , obj , eventv1 .EventTypeTrace , sourcev1 .SymlinkUpdateFailedReason ,
877877 "failed to update status URL symlink: %s" , err )
878878 }
879879 if symURL != "" {
@@ -947,7 +947,7 @@ func (r *HelmChartReconciler) garbageCollect(ctx context.Context, obj *sourcev1.
947947 Reason : "GarbageCollectionFailed" ,
948948 }
949949 } else if deleted != "" {
950- r .eventLogf (ctx , obj , events .EventTypeTrace , "GarbageCollectionSucceeded" ,
950+ r .eventLogf (ctx , obj , eventv1 .EventTypeTrace , "GarbageCollectionSucceeded" ,
951951 "garbage collected artifacts for deleted resource" )
952952 }
953953 obj .Status .Artifact = nil
@@ -962,7 +962,7 @@ func (r *HelmChartReconciler) garbageCollect(ctx context.Context, obj *sourcev1.
962962 }
963963 }
964964 if len (delFiles ) > 0 {
965- r .eventLogf (ctx , obj , events .EventTypeTrace , "GarbageCollectionSucceeded" ,
965+ r .eventLogf (ctx , obj , eventv1 .EventTypeTrace , "GarbageCollectionSucceeded" ,
966966 fmt .Sprintf ("garbage collected %d artifacts" , len (delFiles )))
967967 return nil
968968 }
0 commit comments