Skip to content

Commit

Permalink
Drop v1.24, v1.25
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnavion committed Sep 16, 2024
1 parent ff4ad75 commit 6bc4d23
Show file tree
Hide file tree
Showing 1,125 changed files with 28 additions and 211,086 deletions.
4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ serde-value = { version = "0.7", default-features = false }

[features]
# Each feature corresponds to a supported version of Kubernetes
earliest = ["v1_24"]
v1_24 = []
v1_25 = []
earliest = ["v1_26"]
v1_26 = []
v1_27 = []
v1_28 = []
Expand Down
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fn main() -> Result<(), Box<dyn std::error::Error>> {
use std::io::Write;

const MIN: usize = 24;
const MIN: usize = 26;
const MAX: usize = 31;

println!("cargo::rerun-if-env-changed=K8S_OPENAPI_ENABLED_VERSION");
Expand Down
17 changes: 0 additions & 17 deletions k8s-openapi-codegen/src/fixups/upstream_bugs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,6 @@ pub(crate) fn connect_options_gvk(spec: &mut crate::swagger20::Spec) -> Result<(
//
// Override it to be optional to achieve the same effect.
pub(crate) mod optional_properties {
// `Event::eventTime`
pub(crate) fn eventsv1beta1_event(spec: &mut crate::swagger20::Spec) -> Result<(), crate::Error> {
let definition_path = crate::swagger20::DefinitionPath("io.k8s.api.events.v1beta1.Event".to_owned());
if let Some(definition) = spec.definitions.get_mut(&definition_path) {
if let crate::swagger20::SchemaKind::Properties(properties) = &mut definition.kind {
if let Some(property) = properties.get_mut("eventTime") {
if property.1 {
property.1 = false;
return Ok(());
}
}
}
}

Err("never applied events.k8s.io/v1beta1.Event optional properties override".into())
}

// `Event::eventTime`
pub(crate) fn eventsv1_event(spec: &mut crate::swagger20::Spec) -> Result<(), crate::Error> {
let definition_path = crate::swagger20::DefinitionPath("io.k8s.api.events.v1.Event".to_owned());
Expand Down
33 changes: 0 additions & 33 deletions k8s-openapi-codegen/src/supported_version.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
pub(crate) const ALL: &[SupportedVersion] = &[
SupportedVersion::V1_24,
SupportedVersion::V1_25,
SupportedVersion::V1_26,
SupportedVersion::V1_27,
SupportedVersion::V1_28,
Expand All @@ -11,8 +9,6 @@ pub(crate) const ALL: &[SupportedVersion] = &[

#[derive(Clone, Copy, Debug)]
pub(crate) enum SupportedVersion {
V1_24,
V1_25,
V1_26,
V1_27,
V1_28,
Expand All @@ -24,8 +20,6 @@ pub(crate) enum SupportedVersion {
impl SupportedVersion {
pub(crate) fn name(self) -> &'static str {
match self {
SupportedVersion::V1_24 => "1.24",
SupportedVersion::V1_25 => "1.25",
SupportedVersion::V1_26 => "1.26",
SupportedVersion::V1_27 => "1.27",
SupportedVersion::V1_28 => "1.28",
Expand All @@ -37,8 +31,6 @@ impl SupportedVersion {

pub(crate) fn mod_root(self) -> &'static str {
match self {
SupportedVersion::V1_24 => "v1_24",
SupportedVersion::V1_25 => "v1_25",
SupportedVersion::V1_26 => "v1_26",
SupportedVersion::V1_27 => "v1_27",
SupportedVersion::V1_28 => "v1_28",
Expand All @@ -50,8 +42,6 @@ impl SupportedVersion {

pub(crate) fn spec_url(self) -> &'static str {
match self {
SupportedVersion::V1_24 => "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.24.17/api/openapi-spec/swagger.json",
SupportedVersion::V1_25 => "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.25.16/api/openapi-spec/swagger.json",
SupportedVersion::V1_26 => "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.26.15/api/openapi-spec/swagger.json",
SupportedVersion::V1_27 => "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.27.16/api/openapi-spec/swagger.json",
SupportedVersion::V1_28 => "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.28.14/api/openapi-spec/swagger.json",
Expand All @@ -64,29 +54,6 @@ impl SupportedVersion {
pub(crate) fn fixup(self, spec: &mut crate::swagger20::Spec) -> Result<(), crate::Error> {
#[allow(clippy::match_same_arms, clippy::type_complexity)]
let upstream_bugs_fixups: &[fn(&mut crate::swagger20::Spec) -> Result<(), crate::Error>] = match self {
SupportedVersion::V1_24 => &[
crate::fixups::upstream_bugs::connect_options_gvk,
crate::fixups::upstream_bugs::optional_properties::eventsv1beta1_event,
crate::fixups::upstream_bugs::optional_properties::eventsv1_event,
crate::fixups::upstream_bugs::required_properties::config_map_env_source,
crate::fixups::upstream_bugs::required_properties::config_map_key_selector,
crate::fixups::upstream_bugs::required_properties::config_map_projection,
crate::fixups::upstream_bugs::required_properties::config_map_volume_source,
crate::fixups::upstream_bugs::required_properties::host_alias,
crate::fixups::upstream_bugs::required_properties::local_object_reference,
crate::fixups::upstream_bugs::required_properties::pod_ip,
crate::fixups::upstream_bugs::required_properties::secret_env_source,
crate::fixups::upstream_bugs::required_properties::secret_key_selector,
crate::fixups::upstream_bugs::required_properties::secret_projection,
],

SupportedVersion::V1_25 => &[
crate::fixups::upstream_bugs::connect_options_gvk,
crate::fixups::upstream_bugs::optional_properties::eventsv1_event,
crate::fixups::upstream_bugs::required_properties::local_object_reference,
crate::fixups::upstream_bugs::required_properties::pod_ip,
],

SupportedVersion::V1_26 => &[
crate::fixups::upstream_bugs::connect_options_gvk,
crate::fixups::upstream_bugs::optional_properties::eventsv1_event,
Expand Down
2 changes: 0 additions & 2 deletions k8s-openapi-tests-macro-deps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ k8s-openapi = { path = ".." }
k8s-openapi-derive = { path = "../k8s-openapi-derive" }

[features]
test_v1_24 = ["k8s-openapi/v1_24"]
test_v1_25 = ["k8s-openapi/v1_25"]
test_v1_26 = ["k8s-openapi/v1_26"]
test_v1_27 = ["k8s-openapi/v1_27"]
test_v1_28 = ["k8s-openapi/v1_28"]
Expand Down
2 changes: 0 additions & 2 deletions k8s-openapi-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ tokio = { version = "1", default-features = false, features = [
url = { version = "2", default-features = false }

[features]
test_v1_24 = ["k8s-openapi/v1_24"]
test_v1_25 = ["k8s-openapi/v1_25"]
test_v1_26 = ["k8s-openapi/v1_26"]
test_v1_27 = ["k8s-openapi/v1_27"]
test_v1_28 = ["k8s-openapi/v1_28"]
Expand Down
2 changes: 1 addition & 1 deletion k8s-openapi-tests/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
fn main() {
// Assert that the DEP_K8S_OPENAPI_*_VERSION is set by the k8s-openapi crate's build script correctly.

const MIN: usize = 24;
const MIN: usize = 26;
const MAX: usize = 31;

let enabled_version = {
Expand Down
2 changes: 0 additions & 2 deletions k8s-openapi-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ struct Replay {

impl Client {
fn new(test_name: &'static str) -> Self {
#[cfg(feature = "test_v1_24")] let replays_directory = "v1-24";
#[cfg(feature = "test_v1_25")] let replays_directory = "v1-25";
#[cfg(feature = "test_v1_26")] let replays_directory = "v1-26";
#[cfg(feature = "test_v1_27")] let replays_directory = "v1-27";
#[cfg(feature = "test_v1_28")] let replays_directory = "v1-28";
Expand Down
10 changes: 0 additions & 10 deletions k8s-openapi-tests/test-replays/v1-24/api_versions-list.json

This file was deleted.

Loading

0 comments on commit 6bc4d23

Please sign in to comment.