Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add note about sourceignore recursion #1007

Merged
merged 1 commit into from
Jan 30, 2023

Conversation

kingdonb
Copy link
Member

We do a recursive search for .sourceignore

https://github.com/fluxcd/pkg/blob/main/sourceignore/sourceignore.go#L114

    for _, fi := range fis {

With references: https://cloud-native.slack.com/archives/CLAJ40HV3/p1674742375696939?thread_ts=1674741099.305269&cid=CLAJ40HV3

Today we advised a user who was looking for another way to tell Flux to ignore a file in Git, and we found this fact about the recursion was not documented. I thought this was a common expectation, but I didn't want to reassure someone that it would work without testing to be sure, or a direct reference to that effect, so @stefanprodan found it for us 馃憤

Let's add a note about this to the docs, to save the trouble next time.

@stefanprodan stefanprodan added the area/docs Documentation related issues and pull requests label Jan 27, 2023
Copy link
Member

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An OCIRepository also looks for ignore files:

ps, err := sourceignore.LoadIgnorePatterns(dir, ignoreDomain)

docs/spec/v1beta2/buckets.md Outdated Show resolved Hide resolved
docs/spec/v1beta2/gitrepositories.md Outdated Show resolved Hide resolved
@kingdonb
Copy link
Member Author

It looks like whenever LoadIgnorePatterns is called, the recursive approach is being used. Thanks for the clarifications.

@kingdonb
Copy link
Member Author

It also looks like the OCIRepository doc is missing a section that is targeted by the link text:

and may overrule the [`.sourceignore` file exclusions](#sourceignore-file)`

I'll add some text and make it aligned with the other docs.

Signed-off-by: Kingdon Barrett <kingdon@weave.works>
Copy link
Member

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @kingdonb 馃檱

@hiddeco hiddeco merged commit 874cfd2 into fluxcd:main Jan 30, 2023
@kingdonb kingdonb deleted the about-sourceignore branch January 30, 2023 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs Documentation related issues and pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants