Skip to content

Commit

Permalink
less import lines
Browse files Browse the repository at this point in the history
  • Loading branch information
clux committed Jun 7, 2021
1 parent 719633f commit 15d3297
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions kube-core/src/crd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,31 @@ use k8s_openapi::apiextensions_apiserver::pkg::apis::apiextensions as apiexts;

/// Types for v1 CustomResourceDefinitions
pub mod v1 {
use super::apiexts;
use crate::discovery::ApiResource;
/// Extension trait that will be implemented by kube-derive
///
/// This trait variant is implemented by default (or when `#[kube(apiextensions = "v1")]`)
pub trait CustomResourceExt {
/// Helper to generate the CRD including the JsonSchema
///
/// This is using the stable v1::CustomResourceDefinitions (present in kubernetes >= 1.16)
fn crd() -> apiexts::v1::CustomResourceDefinition;
fn crd() -> super::apiexts::v1::CustomResourceDefinition;
/// Helper to generate the api information type for use with the dynamic `Api`
fn api_resource() -> ApiResource;
fn api_resource() -> crate::discovery::ApiResource;
}
}

/// Types for legacy v1beta1 CustomResourceDefinitions
pub mod v1beta1 {
use super::apiexts;
use crate::discovery::ApiResource;
/// Extension trait that will be implemented by kube-derive for legacy v1beta1::CustomResourceDefinitions
///
/// This trait variant is only implemented with `#[kube(apiextensions = "v1beta1")]`
pub trait CustomResourceExt {
/// Helper to generate the legacy CRD without a JsonSchema
///
/// This is using v1beta1::CustomResourceDefinitions (which will be removed in kubernetes 1.22)
fn crd() -> apiexts::v1beta1::CustomResourceDefinition;
fn crd() -> super::apiexts::v1beta1::CustomResourceDefinition;
/// Helper to generate the api information type for use with the dynamic `Api`
fn api_resource() -> ApiResource;
fn api_resource() -> crate::discovery::ApiResource;
}
}

Expand Down

0 comments on commit 15d3297

Please sign in to comment.