Skip to content

Exclude Fleet config files regardless of their naming#4207

Merged
weyfonk merged 1 commit into
rancher:mainfrom
weyfonk:307-exclude-bundle-file
Oct 10, 2025
Merged

Exclude Fleet config files regardless of their naming#4207
weyfonk merged 1 commit into
rancher:mainfrom
weyfonk:307-exclude-bundle-file

Conversation

@weyfonk

@weyfonk weyfonk commented Oct 9, 2025

Copy link
Copy Markdown
Contributor

While Fleet config files are typically named fleet.yaml, the recent introduction of user-driven bundle scanning enables a config file to be named arbitrarily, in which case it must still be excluded from the corresponding bundle. Fleet now takes care of this without any action needed from the user.

Integration tests also demonstrate that .fleetignore files can be leveraged to exclude config files living in the same directory as the config file referenced explicitly through user-driven bundle scanning. Fleet would otherwise not exclude those files from the bundle.

Refers to rancher/fleet-docs#307

Additional Information

Checklist

While Fleet config files are typically named `fleet.yaml`, the recent
introduction of user-driven bundle scanning enables a config file to be
named arbitrarily, in which case it must still be excluded from the
corresponding bundle. Fleet now takes care of this without any action
needed from the user.

Integration tests also demonstrate that `.fleetignore` files can be
leveraged to exclude config files living in the same directory as
the config file referenced explicitly through user-driven bundle
scanning. Fleet would otherwise not exclude those files from the bundle.
@p-se

p-se commented Oct 10, 2025

Copy link
Copy Markdown
Contributor

I was wondering .fleetignore is being tested separately elsewhere? Because it looks like both prod.yaml and dev.yaml are supposed to be excluded from the bundle without even having a .fleetignore. Which would mean that .fleetignore wouldn't be tested at all in that particular test. But I have found separate tests for .fleetignore elsewhere in our code.

@weyfonk

weyfonk commented Oct 10, 2025

Copy link
Copy Markdown
Contributor Author

I was wondering .fleetignore is being tested separately elsewhere?

Yes, we test its behaviour in internal/bundlereader/loaddirectory_test.go.

Because it looks like both prod.yaml and dev.yaml are supposed to be excluded from the bundle without even having a .fleetignore.

The test case using the driven/kustomize directory uses a .fleetignore excluding only dev.yaml, to check that it's then excluded from both dev and prod bundles. See this comment.

Conversely, the test case using driven2/kustomize uses a .fleetignore excluding only prod.yaml, for similar reasons (see this comment).

@weyfonk
weyfonk merged commit 6840a0e into rancher:main Oct 10, 2025
35 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants