From 6ef75fb43a312efc5932b36f4cf0ae3e641fa738 Mon Sep 17 00:00:00 2001 From: alliasgher Date: Sun, 26 Apr 2026 18:56:08 +0500 Subject: [PATCH] docs: clarify that .spec.ignore extends defaults rather than overriding Both the v1 API godoc and the v1 spec docs say that .spec.ignore 'overrides' the default exclusion list, but the controller appends spec.ignore to the default sourceignore patterns rather than replacing them (see e.g. internal/controller/gitrepository_controller.go:887, ocirepository_controller.go:1163, bucket_controller.go:708). Setting spec.ignore: '.git/' therefore still drops the rest of the default exclusions (.gitignore, .gitmodules, .gitattributes), which is 'extend' semantics, not 'override'. Update the API godoc comments, regenerated docs/api/v1/source.md, and the prose in docs/spec/v1/{gitrepositories,buckets,ocirepositories}.md to say 'extends' instead of 'overrides'. No behaviour change. Fixes #429 Signed-off-by: alliasgher Assisted-by: Claude/claude-opus-4-7 --- api/v1/bucket_types.go | 2 +- api/v1/gitrepository_types.go | 2 +- api/v1/ocirepository_types.go | 2 +- docs/api/v1/source.md | 12 ++++++------ docs/spec/v1/buckets.md | 2 +- docs/spec/v1/gitrepositories.md | 4 ++-- docs/spec/v1/ocirepositories.md | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/api/v1/bucket_types.go b/api/v1/bucket_types.go index bbedcefb3..8af27755b 100644 --- a/api/v1/bucket_types.go +++ b/api/v1/bucket_types.go @@ -140,7 +140,7 @@ type BucketSpec struct { // +optional Timeout *metav1.Duration `json:"timeout,omitempty"` - // Ignore overrides the set of excluded patterns in the .sourceignore format + // Ignore extends the set of excluded patterns in the .sourceignore format // (which is the same as .gitignore). If not provided, a default will be used, // consult the documentation for your version to find out what those are. // +optional diff --git a/api/v1/gitrepository_types.go b/api/v1/gitrepository_types.go index d7468fca6..3ba24fee4 100644 --- a/api/v1/gitrepository_types.go +++ b/api/v1/gitrepository_types.go @@ -138,7 +138,7 @@ type GitRepositorySpec struct { // +optional ProxySecretRef *meta.LocalObjectReference `json:"proxySecretRef,omitempty"` - // Ignore overrides the set of excluded patterns in the .sourceignore format + // Ignore extends the set of excluded patterns in the .sourceignore format // (which is the same as .gitignore). If not provided, a default will be used, // consult the documentation for your version to find out what those are. // +optional diff --git a/api/v1/ocirepository_types.go b/api/v1/ocirepository_types.go index 8c4d3f0fc..fd2c6b8ae 100644 --- a/api/v1/ocirepository_types.go +++ b/api/v1/ocirepository_types.go @@ -131,7 +131,7 @@ type OCIRepositorySpec struct { // +optional Timeout *metav1.Duration `json:"timeout,omitempty"` - // Ignore overrides the set of excluded patterns in the .sourceignore format + // Ignore extends the set of excluded patterns in the .sourceignore format // (which is the same as .gitignore). If not provided, a default will be used, // consult the documentation for your version to find out what those are. // +optional diff --git a/docs/api/v1/source.md b/docs/api/v1/source.md index b58c99029..ac9922878 100644 --- a/docs/api/v1/source.md +++ b/docs/api/v1/source.md @@ -274,7 +274,7 @@ string (Optional) -

Ignore overrides the set of excluded patterns in the .sourceignore format +

Ignore extends the set of excluded patterns in the .sourceignore format (which is the same as .gitignore). If not provided, a default will be used, consult the documentation for your version to find out what those are.

@@ -507,7 +507,7 @@ string (Optional) -

Ignore overrides the set of excluded patterns in the .sourceignore format +

Ignore extends the set of excluded patterns in the .sourceignore format (which is the same as .gitignore). If not provided, a default will be used, consult the documentation for your version to find out what those are.

@@ -1279,7 +1279,7 @@ string (Optional) -

Ignore overrides the set of excluded patterns in the .sourceignore format +

Ignore extends the set of excluded patterns in the .sourceignore format (which is the same as .gitignore). If not provided, a default will be used, consult the documentation for your version to find out what those are.

@@ -1631,7 +1631,7 @@ string (Optional) -

Ignore overrides the set of excluded patterns in the .sourceignore format +

Ignore extends the set of excluded patterns in the .sourceignore format (which is the same as .gitignore). If not provided, a default will be used, consult the documentation for your version to find out what those are.

@@ -2220,7 +2220,7 @@ string (Optional) -

Ignore overrides the set of excluded patterns in the .sourceignore format +

Ignore extends the set of excluded patterns in the .sourceignore format (which is the same as .gitignore). If not provided, a default will be used, consult the documentation for your version to find out what those are.

@@ -3451,7 +3451,7 @@ string (Optional) -

Ignore overrides the set of excluded patterns in the .sourceignore format +

Ignore extends the set of excluded patterns in the .sourceignore format (which is the same as .gitignore). If not provided, a default will be used, consult the documentation for your version to find out what those are.

diff --git a/docs/spec/v1/buckets.md b/docs/spec/v1/buckets.md index 077ac952b..a10d1d5b3 100644 --- a/docs/spec/v1/buckets.md +++ b/docs/spec/v1/buckets.md @@ -1022,7 +1022,7 @@ as a more efficient way of excluding files. pattern format](https://git-scm.com/docs/gitignore#_pattern_format). Storage objects which keys match the defined rules are excluded while fetching. -When specified, `.spec.ignore` overrides the [default exclusion +When specified, `.spec.ignore` extends the [default exclusion list](#default-exclusions), and may overrule the [`.sourceignore` file exclusions](#sourceignore-file). See [excluding files](#excluding-files) for more information. diff --git a/docs/spec/v1/gitrepositories.md b/docs/spec/v1/gitrepositories.md index 96e1590dc..d0de4e639 100644 --- a/docs/spec/v1/gitrepositories.md +++ b/docs/spec/v1/gitrepositories.md @@ -701,7 +701,7 @@ kubectl create secret generic pgp-public-keys \ pattern format](https://git-scm.com/docs/gitignore#_pattern_format). Paths matching the defined rules are excluded while archiving. -When specified, `.spec.ignore` overrides the [default exclusion +When specified, `.spec.ignore` extends the [default exclusion list](#default-exclusions), and may overrule the [`.sourceignore` file exclusions](#sourceignore-file). See [excluding files](#excluding-files) for more information. @@ -851,7 +851,7 @@ placed in the repository root or in subdirectories. #### Ignore spec Another option is to define the exclusions within the GitRepository spec, using -the [`.spec.ignore` field](#ignore). Specified rules override the [default +the [`.spec.ignore` field](#ignore). Specified rules extend the [default exclusion list](#default-exclusions), and may overrule `.sourceignore` file exclusions. diff --git a/docs/spec/v1/ocirepositories.md b/docs/spec/v1/ocirepositories.md index d2bfa399e..eb6d8ba81 100644 --- a/docs/spec/v1/ocirepositories.md +++ b/docs/spec/v1/ocirepositories.md @@ -538,7 +538,7 @@ keeping the original content unaltered. pattern format](https://git-scm.com/docs/gitignore#_pattern_format). Paths matching the defined rules are excluded while archiving. -When specified, `.spec.ignore` overrides the [default exclusion +When specified, `.spec.ignore` extends the [default exclusion list](#default-exclusions), and may overrule the [`.sourceignore` file exclusions](#sourceignore-file). See [excluding files](#excluding-files) for more information.