Skip to content

Commit

Permalink
remove namespace from BaseClusterSecret
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyler-W committed Dec 30, 2024
1 parent e2ceec0 commit 338f66b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
6 changes: 0 additions & 6 deletions src/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ def on_field_match_namespace(
logger: logging.Logger,
**_,
):
namespace = body['data']['valueFrom']['secretKeyRef']['namespace']

logger.debug(f'Namespaces changed: {old} -> {new}')

if old is None:
Expand Down Expand Up @@ -92,7 +90,6 @@ def on_field_match_namespace(
csecs_cache.set_cluster_secret(BaseClusterSecret(
uid=uid,
name=name,
namespace=namespace,
body=body,
synced_namespace=updated_matched,
))
Expand Down Expand Up @@ -148,7 +145,6 @@ async def create_fn(
):
# get all ns matching.
matchedns = get_ns_list(logger, body, v1)
namespace = body['data']['valueFrom']['secretKeyRef']['namespace']

# sync in all matched NS
logger.info(f'Syncing on Namespaces: {matchedns}')
Expand All @@ -164,7 +160,6 @@ async def create_fn(
csecs_cache.set_cluster_secret(BaseClusterSecret(
uid=uid,
name=name,
namespace=namespace or "",
body=body,
synced_namespace=matchedns,
))
Expand Down Expand Up @@ -236,7 +231,6 @@ async def startup_fn(logger: logging.Logger, **_):
BaseClusterSecret(
uid=metadata.get('uid'),
name=metadata.get('name'),
namespace=metadata.get('namespace', ''),
body=item,
synced_namespace=item.get('status', {}).get('create_fn', {}).get('syncedns', []),
)
Expand Down
1 change: 0 additions & 1 deletion src/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
class BaseClusterSecret(BaseModel):
uid: str
name: str
namespace: str
body: Dict[str, Any]
synced_namespace: List[str]

0 comments on commit 338f66b

Please sign in to comment.