source-controller/controllers
Hidde Beydals b5004a93bc Make Storage#Archive file filtering configurable
This commit makes the filtering applied during the archiving
configurable by introducing an optional `ArchiveFileFilter`
callback argument and a `SourceIgnoreFilter` implementation.

`SourceIgnoreFilter` filters out files matching
sourceignore.VCSPatterns and any of the provided patterns.
If an empty gitignore.Pattern slice is given, the matcher is set to
sourceignore.NewDefaultMatcher.

The `GitRepository` now loads the ignore patterns before archiving
the repository contents by calling `sourceignore.LoadIgnorePatterns`
and other helpers. The loading behavior is **breaking** as
`.sourceignore` files in the (subdirectories of the) repository are
now still taken into account if `spec.ignore` for a resource is
defined, overwriting is still possible by creating an overwriting
rule in the `spec.ignore` of the resource.

This change also makes it possible for the `BucketReconciler` to not
configure a callback at all and prevent looking for ignore
matches twice. To finalize the bucket refactor, a change to the
reconciler has been made to look for a `.sourceignore` file in
the root of the bucket to provide an additional way of configuring
(global) exclusions.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-13 15:34:20 +02:00
..
testdata Test values overrides 2021-04-08 18:57:05 -04:00
bucket_controller.go Make Storage#Archive file filtering configurable 2021-04-13 15:34:20 +02:00
gitrepository_controller.go Make Storage#Archive file filtering configurable 2021-04-13 15:34:20 +02:00
gitrepository_controller_test.go Test RecurseSubmodules 2021-03-31 12:22:10 +01:00
helmchart_controller.go Record suspension metric 2021-03-17 14:04:21 +01:00
helmchart_controller_test.go Test values overrides 2021-04-08 18:57:05 -04:00
helmrepository_controller.go Record suspension metric 2021-03-17 14:04:21 +01:00
helmrepository_controller_test.go Use LocalObjectReference from fluxcd/pkg/meta v0.7 2021-01-21 14:18:42 +02:00
source_predicate.go Upgrade controller-runtime to v0.7.0 2020-12-18 19:17:10 +01:00
storage.go Make Storage#Archive file filtering configurable 2021-04-13 15:34:20 +02:00
storage_test.go Make Storage#Archive file filtering configurable 2021-04-13 15:34:20 +02:00
suite_test.go Test RecurseSubmodules 2021-03-31 12:22:10 +01:00