Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(status): make route types generic #12661

Conversation

the-wondersmith
Copy link
Contributor

@the-wondersmith the-wondersmith commented May 30, 2024

Subject

Prepare to expand linkerd's repertoire of supported Gateway API route types in linkerd-policy-controller-k8s-status.

Problem

Currently, the policy controller's status component is written with HTTPRoute support (effectively) exclusively, both in its structure/organization as well as its naming (e.g. HttpRoute as a primary type name, update_http_route as a method name, etc...).

In order to expand linkerd's support for the route types defined by the Gateway API, the policy controller's status component needs to be made more generic in both respects.

Solution

NOTE: PR was opened out of order and should only be merged after #12662

PR introduces structural and naming changes making the codebase generic with respect to the type of route being handled (e.g. HTTPRoute -> Route). Changes are almost entirely cosmetic introducing only a couple of minor functional changes, most notably:

  • making the status argument to make_patch generic
  • adding a type-aware api_version helper method to NamespaceGroupKindName
    • note: required for proper handling of different route types in the future

Validation

  • maintainer review
  • tests pass

Screenshot 2024-05-30 at 11 50 28 AM

Fixes Lays Groundwork For Addressing

@the-wondersmith the-wondersmith requested a review from a team as a code owner May 30, 2024 15:51
@adleong adleong merged commit 2b1d09f into linkerd:main Jun 3, 2024
27 checks passed
@the-wondersmith the-wondersmith deleted the policy-refactor-status-generalize-route-types branch June 5, 2024 18:30
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.

3 participants