Skip to content

refactor(api)!: drop dead PolicyDescription fields and IsTargetRefBased descriptor flag - #18733

Draft
lobkovilya wants to merge 2 commits into
kumahq:masterfrom
lobkovilya:inv-policydesc-fields
Draft

lobkovilya wants to merge 2 commits into
kumahq:masterfrom
lobkovilya:inv-policydesc-fields

Conversation

@lobkovilya

Copy link
Copy Markdown
Contributor

Motivation

With every policy now targetRef based and the from-style targetRef gone, three flags describing that distinction carry no information any more:

  • PolicyDescription.hasFromTargetRef and PolicyDescription.isFromAsRules in GET /_resources have been literal false in the mapper since refactor(api): remove dead from-targetRef descriptor flags #18005 removed the descriptor flags behind them.
  • ResourceTypeDescriptor.IsTargetRefBased was generated by policy-gen as {{.IsPolicy}}, so every reader was branching on a value equal to IsPolicy.

Nothing reads the two REST fields in kuma, kumactl, the enterprise fork, or the kuma-gui source (only its mock fixtures). The GUI's "Inbound" badge is driven by hasFromTargetRef and has therefore never rendered against a 3.0 control plane.

Implementation information

  • Removed hasFromTargetRef and isFromAsRules from the PolicyDescription OpenAPI schema, the mapper, the _resources golden file and the kumactl client test fixture. docs/generated/openapi.yaml regenerated.
  • Removed IsTargetRefBased from ResourceTypeDescriptor and the policy-gen template; every zz_generated.resource.go regenerated.
  • Its readers collapse to constants: PolicyDescription.isTargetRef and the legacy GET /policies isTargetRefBased are now emitted as true, and matchingDataplanesForPolicy always loads MeshHTTPRoute as a dependent type since the route is only registered for policies.
  • isTargetRef stays on the wire for now because kuma-gui still reads it to decide legacy rendering and zone column visibility. It will be removed once the GUI no longer depends on it, tracked in Stop reading removed PolicyDescription fields from GET /_resources kuma-gui#5309. The kumactl export federation profile also still branches on it; that simplification belongs in that follow-up.
  • UPGRADE.md gets a note under the 3.0 section.

Supporting documentation

Follow-up in the GUI: kumahq/kuma-gui#5309
Previous cleanup of the descriptor flags: #18005

…ed descriptor flag

hasFromTargetRef and isFromAsRules have been hardcoded to false since the
from-targetRef descriptor flags were removed. IsTargetRefBased was always
generated as IsPolicy, so every reader collapses to a constant.

Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>
Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>
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.

1 participant