Skip to content

Commit

Permalink
Add v4.6 to SupportedVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanchaoa committed Sep 26, 2023
1 parent 6498131 commit ee48b9d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
9 changes: 9 additions & 0 deletions openshift-openapi-codegen/src/supported_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pub(crate) const ALL: &[SupportedVersion] = &[
SupportedVersion::V4_3,
SupportedVersion::V4_4,
SupportedVersion::V4_5,
SupportedVersion::V4_6,
];

#[derive(Clone, Copy, Debug)]
Expand All @@ -11,6 +12,7 @@ pub(crate) enum SupportedVersion {
V4_3,
V4_4,
V4_5,
V4_6,
}

impl SupportedVersion {
Expand All @@ -20,6 +22,7 @@ impl SupportedVersion {
SupportedVersion::V4_3 => "v4_3",
SupportedVersion::V4_4 => "v4_4",
SupportedVersion::V4_5 => "v4_5",
SupportedVersion::V4_6 => "v4_6",
}
}

Expand All @@ -29,6 +32,7 @@ impl SupportedVersion {
SupportedVersion::V4_3 => "https://raw.githubusercontent.com/openshift/origin/release-4.3/api/swagger-spec/openshift-openapi-spec.json",
SupportedVersion::V4_4 => "https://raw.githubusercontent.com/openshift/origin/release-4.4/api/swagger-spec/openshift-openapi-spec.json",
SupportedVersion::V4_5 => "https://raw.githubusercontent.com/openshift/origin/release-4.5/api/swagger-spec/openshift-openapi-spec.json",
SupportedVersion::V4_6 => "https://raw.githubusercontent.com/openshift/origin/release-4.6/api/swagger-spec/openshift-openapi-spec.json",
}
}

Expand Down Expand Up @@ -57,6 +61,11 @@ impl SupportedVersion {
crate::fixups::openshift::fix_imagestream_secrets_list,
crate::fixups::openshift::remove_legacy_gvk,
],
SupportedVersion::V4_6 => &[
crate::fixups::openshift::connect_options_gvk,
crate::fixups::openshift::fix_imagestream_secrets_list,
crate::fixups::openshift::remove_legacy_gvk,
],
};

let special_fixups: &[fn(&mut crate::swagger20::Spec) -> Result<(), crate::Error>] = &[
Expand Down
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,15 +466,15 @@ mod v4_4;
pub use self::v4_4::*;

#[cfg(feature = "v4_5")]
mod v4_5;
#[cfg(feature = "v4_5")]
pub use self::v4_5::*;

#[cfg(feature = "v4_6")]
mod v4_6;
#[cfg(feature = "v4_6")]
#[cfg(feature = "v4_5")]
pub use self::v4_6::*;

//#[cfg(feature = "v4_6")]
//mod v4_6;
//#[cfg(feature = "v4_6")]
//pub use self::v4_6::*;


include!(concat!(
env!("OUT_DIR"),
Expand Down

0 comments on commit ee48b9d

Please sign in to comment.