#1784

Console egress edits remove existing credential-injection rules

Opendipeshbabuopened 18d ago

Editing an egress policy in the console can clear its existing credential-injection rules. networkPolicyFromMode and networkPolicyFromDetailed in ui/src/lib/network-policy.ts construct replacement policies without copying network_credential_rules. networkPoliciesEqual also ignores those rules, so credential-only differences compare equal.

Synthetic reproduction:

  1. Load a policy with network_credential_rules containing a rule for api.example.com and a synthetic credential reference ID.
  2. Pass that policy to either networkPolicyFromMode (open or closed) or networkPolicyFromDetailed while editing egress settings.
  3. The resulting policy omits the credential rule. Saving the replacement therefore removes credential injection, although the operator only edited egress settings.

Expected: egress edits retain credential rules; policy equality detects changes to them while treating absent and empty rule lists consistently.

Proposed fix: preserve the existing rules in both builders and include them in normalized policy comparison. PR #540 contains the fix and the regression tests egress edits preserve credential injection rules in every designer mode and policy equality detects credential changes and normalizes absent rules.

Self-assessed severity: moderate. An ordinary egress edit can break workloads that rely on injected credentials.

AI assistance: Codex drafted this issue and contributed the implementation, regression tests, and PR description. Filed to complete the maintainer-requested issue link for #540.

Activity

1
github-actions[bot]18d ago

Thanks for opening this issue! A SPACE maintainer will take a look.

CONTRIBUTING.md explains how we review outside contributions.