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

Skip to content

Commit 2f28cb1

Browse files
committed
feat: properly handle CRDs that are type Secret
1 parent b31f818 commit 2f28cb1

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

flux_local/git_repo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ async def visit_kustomization(
520520
if doc.get("kind") == CONFIG_MAP_KIND
521521
],
522522
secrets=[
523-
Secret.parse_doc(doc) for doc in cfg_docs if doc.get("kind") == SECRET_KIND
523+
Secret.parse_doc(doc) for doc in cfg_docs if doc.get("kind") == SECRET_KIND and doc.get("apiVersion") == "v1"
524524
],
525525
)
526526

@@ -709,7 +709,7 @@ async def build_kustomization(
709709
if doc.get("kind") == CONFIG_MAP_KIND
710710
]
711711
kustomization.secrets = [
712-
Secret.parse_doc(doc) for doc in docs if doc.get("kind") == SECRET_KIND
712+
Secret.parse_doc(doc) for doc in docs if doc.get("kind") == SECRET_KIND and doc.get("apiVersion") == "v1"
713713
]
714714

715715

flux_local/manifest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ def parse_raw_obj(obj: dict[str, Any], *, wipe_secrets: bool = True) -> BaseMani
10181018
return OCIRepository.parse_doc(obj)
10191019
if kind == CONFIG_MAP_KIND:
10201020
return ConfigMap.parse_doc(obj)
1021-
if kind == SECRET_KIND:
1021+
if kind == SECRET_KIND and api_version == "v1":
10221022
return Secret.parse_doc(obj, wipe_secrets=wipe_secrets)
10231023
return RawObject.parse_doc(obj)
10241024

0 commit comments

Comments
 (0)