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

[DNM] Use upstream gateway-api types #13643

Draft
wants to merge 2 commits into
base: ver/kube-alpha
Choose a base branch
from
Draft

Conversation

adleong
Copy link
Member

@adleong adleong commented Feb 10, 2025

This change removes our dependency on the hand-rolled kubernetes gateway API bindings from the k8s-gateway-api crate and replaces them with the official generated bindings from the gateway-api crate.

This change is in progress and at this time does not yet compile and requires polish and import naming consistency improvements.

Signed-off-by: Alex Leong <[email protected]>
@olix0r olix0r changed the base branch from main to ver/kube-alpha February 10, 2025 17:27
Signed-off-by: Alex Leong <[email protected]>
@@ -7,7 +7,7 @@ pub mod labels;
pub mod policy;

pub use self::labels::Labels;
pub use k8s_gateway_api as gateway;
pub use gateway_api::apis::experimental as gateway;
Copy link
Member

@olix0r olix0r Feb 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that you do not necessarily need to expose this as a pure re-export. You can potentially avoid changing many type signatures by providing some consistent naming between versions.

This might look something like:

pub mod gateway {
    pub use gateway_api::apis::experimental::{
        httproutes::*,
        grpcroutes::*,
        tlsroutes::*,
    };
}

This would preserve references to k8s_gateway_api::GrpcRoute as they were before (avoiding the change to k8s_gateway_api::grpcroutes::GrpcRoute)

Furthermore, you could potentially use this approach to front-load some type naming changes before updating the crate version.

For example, we could stage out some of the changes with:

pub mod gateway {
    pub use k8s_gateway_api::*;

    pub type HTTPRouteStatus = k8s_gateway_api::RouteStatus;
    // etc... 
}

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.

2 participants