(ctx context.Context, src snapshot.SourceInfo, rep repo.Repository)
| 445 | } |
| 446 | |
| 447 | func shouldSnapshotSource(ctx context.Context, src snapshot.SourceInfo, rep repo.Repository) (bool, error) { |
| 448 | policyTree, err := policy.TreeForSource(ctx, rep, src) |
| 449 | if err != nil { |
| 450 | return false, errors.Wrapf(err, "unable to get policy tree for source %v", src) |
| 451 | } |
| 452 | |
| 453 | return src.Host == rep.ClientOptions().Hostname && |
| 454 | src.UserName == rep.ClientOptions().Username && |
| 455 | !policy.IsManualSnapshot(policyTree), nil |
| 456 | } |
| 457 | |
| 458 | // the setManual return value is true when a snapshot is manually created, such |
| 459 | // as when overriding the source info or snapshotting from stdin. |
no test coverage detected