fix: properly handle CRDs that are type Secret#999
Conversation
allenporter
left a comment
There was a problem hiding this comment.
Looks great, thank you. Can you also add tests? This logic is in middle of being rewritten and will change in the future so i wouldn't want it to get accidentally broken.
2f28cb1 to
15511c3
Compare
|
@allenporter I've added some tests that verify that both v1/secrets and CRD secrets are properly handled. Let me know if you want any changes to them or anything. |
|
|
||
| async def test_secret_crd_filtering() -> None: | ||
| """Test that CRDs with kind Secret but non-v1 apiVersion are not parsed as Secret objects.""" | ||
| from flux_local.manifest import Kustomization, Secret, ConfigMap |
There was a problem hiding this comment.
Put imports at the top of the file, not inlined in tehe test.
(I'm assuming this is ai generated)
| assert await get_hr() == [] | ||
|
|
||
|
|
||
| async def test_secret_crd_filtering() -> None: |
There was a problem hiding this comment.
This test is not testing crd filtering in the library, Its exercising code within the test only. This needs to actually call the real code, right?
When working with CRDs that have a type of
Secretflux-local fails to build kustomizations. Currently the code assumes anything that is a Secret will be a member of the v1 api group, this instead adds a check to only treat things as a secret if they are in v1.