Emit waiting error when no changes occurred since last reconciliation
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
This commit is contained in:
parent
44e166e576
commit
87e03431b0
|
|
@ -463,7 +463,8 @@ func (r *GitRepositoryReconciler) reconcileSource(ctx context.Context,
|
||||||
if err != nil {
|
if err != nil {
|
||||||
var v git.NoChangesError
|
var v git.NoChangesError
|
||||||
if errors.As(err, &v) {
|
if errors.As(err, &v) {
|
||||||
return sreconcile.ResultSuccess, nil
|
return sreconcile.ResultSuccess,
|
||||||
|
&serror.Waiting{Err: v, Reason: v.Message}
|
||||||
}
|
}
|
||||||
|
|
||||||
e := &serror.Event{
|
e := &serror.Event{
|
||||||
|
|
@ -506,12 +507,6 @@ func (r *GitRepositoryReconciler) reconcileSource(ctx context.Context,
|
||||||
// object are set, and the symlink in the Storage is updated to its path.
|
// object are set, and the symlink in the Storage is updated to its path.
|
||||||
func (r *GitRepositoryReconciler) reconcileArtifact(ctx context.Context,
|
func (r *GitRepositoryReconciler) reconcileArtifact(ctx context.Context,
|
||||||
obj *sourcev1.GitRepository, commit *git.Commit, includes *artifactSet, dir string) (sreconcile.Result, error) {
|
obj *sourcev1.GitRepository, commit *git.Commit, includes *artifactSet, dir string) (sreconcile.Result, error) {
|
||||||
// If reconciliation resulted in git.NoChangesError,
|
|
||||||
// avoid reconciling artifact, as this was already done
|
|
||||||
// on a previous reconciliation.
|
|
||||||
if commit == nil || commit.Hash.String() == "" {
|
|
||||||
return sreconcile.ResultSuccess, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create potential new artifact with current available metadata
|
// Create potential new artifact with current available metadata
|
||||||
artifact := r.Storage.NewArtifactFor(obj.Kind, obj.GetObjectMeta(), commit.String(), fmt.Sprintf("%s.tar.gz", commit.Hash.String()))
|
artifact := r.Storage.NewArtifactFor(obj.Kind, obj.GetObjectMeta(), commit.String(), fmt.Sprintf("%s.tar.gz", commit.Hash.String()))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue