controllers: emit event and log source up-to-date
Signed-off-by: Sunny <darkowlzz@protonmail.com>
This commit is contained in:
parent
86860ec913
commit
b41c717e16
|
@ -93,4 +93,8 @@ const (
|
||||||
|
|
||||||
// SymlinkUpdateFailedReason signals a failure in updating a symlink.
|
// SymlinkUpdateFailedReason signals a failure in updating a symlink.
|
||||||
SymlinkUpdateFailedReason string = "SymlinkUpdateFailed"
|
SymlinkUpdateFailedReason string = "SymlinkUpdateFailed"
|
||||||
|
|
||||||
|
// ArtifactUpToDateReason signals that an existing Artifact is up-to-date
|
||||||
|
// with the Source.
|
||||||
|
ArtifactUpToDateReason string = "ArtifactUpToDate"
|
||||||
)
|
)
|
||||||
|
|
|
@ -526,7 +526,7 @@ func (r *BucketReconciler) reconcileArtifact(ctx context.Context, obj *sourcev1.
|
||||||
|
|
||||||
// The artifact is up-to-date
|
// The artifact is up-to-date
|
||||||
if obj.GetArtifact().HasRevision(artifact.Revision) {
|
if obj.GetArtifact().HasRevision(artifact.Revision) {
|
||||||
ctrl.LoggerFrom(ctx).Info("artifact up-to-date", "revision", artifact.Revision)
|
r.eventLogf(ctx, obj, events.EventTypeTrace, sourcev1.ArtifactUpToDateReason, "artifact up-to-date with remote revision: '%s'", artifact.Revision)
|
||||||
return sreconcile.ResultSuccess, nil
|
return sreconcile.ResultSuccess, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -462,7 +462,7 @@ func (r *GitRepositoryReconciler) reconcileArtifact(ctx context.Context,
|
||||||
|
|
||||||
// The artifact is up-to-date
|
// The artifact is up-to-date
|
||||||
if obj.GetArtifact().HasRevision(artifact.Revision) && !includes.Diff(obj.Status.IncludedArtifacts) {
|
if obj.GetArtifact().HasRevision(artifact.Revision) && !includes.Diff(obj.Status.IncludedArtifacts) {
|
||||||
ctrl.LoggerFrom(ctx).Info("artifact up-to-date", "revision", artifact.Revision)
|
r.eventLogf(ctx, obj, events.EventTypeTrace, sourcev1.ArtifactUpToDateReason, "artifact up-to-date with remote revision: '%s'", artifact.Revision)
|
||||||
return sreconcile.ResultSuccess, nil
|
return sreconcile.ResultSuccess, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -638,7 +638,7 @@ func (r *HelmChartReconciler) reconcileArtifact(ctx context.Context, obj *source
|
||||||
|
|
||||||
// Return early if the build path equals the current artifact path
|
// Return early if the build path equals the current artifact path
|
||||||
if curArtifact := obj.GetArtifact(); curArtifact != nil && r.Storage.LocalPath(*curArtifact) == b.Path {
|
if curArtifact := obj.GetArtifact(); curArtifact != nil && r.Storage.LocalPath(*curArtifact) == b.Path {
|
||||||
ctrl.LoggerFrom(ctx).Info("artifact up-to-date", "revision", artifact.Revision)
|
r.eventLogf(ctx, obj, events.EventTypeTrace, sourcev1.ArtifactUpToDateReason, "artifact up-to-date with remote revision: '%s'", artifact.Revision)
|
||||||
return sreconcile.ResultSuccess, nil
|
return sreconcile.ResultSuccess, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -411,7 +411,7 @@ func (r *HelmRepositoryReconciler) reconcileArtifact(ctx context.Context, obj *s
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if obj.GetArtifact().HasRevision(artifact.Revision) {
|
if obj.GetArtifact().HasRevision(artifact.Revision) {
|
||||||
ctrl.LoggerFrom(ctx).Info("artifact up-to-date", "revision", artifact.Revision)
|
r.eventLogf(ctx, obj, events.EventTypeTrace, sourcev1.ArtifactUpToDateReason, "artifact up-to-date with remote revision: '%s'", artifact.Revision)
|
||||||
return sreconcile.ResultSuccess, nil
|
return sreconcile.ResultSuccess, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue