Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: properly handle CRDs that are type Secret#999

Draft
nicolerenee wants to merge 1 commit into
allenporter:mainfrom
nicolerenee:handle-secret-crds
Draft

fix: properly handle CRDs that are type Secret#999
nicolerenee wants to merge 1 commit into
allenporter:mainfrom
nicolerenee:handle-secret-crds

Conversation

@nicolerenee
Copy link
Copy Markdown

When working with CRDs that have a type of Secret flux-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.

@nicolerenee nicolerenee changed the title feat: properly handle CRDs that are type Secret fix: properly handle CRDs that are type Secret Sep 6, 2025
Copy link
Copy Markdown
Owner

@allenporter allenporter left a comment

Choose a reason for hiding this comment

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

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.

@nicolerenee nicolerenee marked this pull request as ready for review September 11, 2025 19:59
@nicolerenee
Copy link
Copy Markdown
Author

@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.

Comment thread tests/test_git_repo.py

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
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Put imports at the top of the file, not inlined in tehe test.

(I'm assuming this is ai generated)

Comment thread tests/test_git_repo.py
assert await get_hr() == []


async def test_secret_crd_filtering() -> None:
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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?

@allenporter allenporter marked this pull request as draft October 29, 2025 02:26
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