refactor(api)!: drop dead PolicyDescription fields and IsTargetRefBased descriptor flag - #18733
Draft
lobkovilya wants to merge 2 commits into
Draft
lobkovilya wants to merge 2 commits into
lobkovilya wants to merge 2 commits into
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
With every policy now targetRef based and the
from-style targetRef gone, three flags describing that distinction carry no information any more:PolicyDescription.hasFromTargetRefandPolicyDescription.isFromAsRulesinGET /_resourceshave been literalfalsein the mapper since refactor(api): remove dead from-targetRef descriptor flags #18005 removed the descriptor flags behind them.ResourceTypeDescriptor.IsTargetRefBasedwas generated by policy-gen as{{.IsPolicy}}, so every reader was branching on a value equal toIsPolicy.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 byhasFromTargetRefand has therefore never rendered against a 3.0 control plane.Implementation information
hasFromTargetRefandisFromAsRulesfrom thePolicyDescriptionOpenAPI schema, the mapper, the_resourcesgolden file and thekumactlclient test fixture.docs/generated/openapi.yamlregenerated.IsTargetRefBasedfromResourceTypeDescriptorand the policy-gen template; everyzz_generated.resource.goregenerated.PolicyDescription.isTargetRefand the legacyGET /policiesisTargetRefBasedare now emitted astrue, andmatchingDataplanesForPolicyalways loadsMeshHTTPRouteas a dependent type since the route is only registered for policies.isTargetRefstays 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. Thekumactl exportfederation profile also still branches on it; that simplification belongs in that follow-up.UPGRADE.mdgets 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