Skip to content

Commit

Permalink
Drop v1.26, v1.27
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnavion committed Dec 11, 2024
1 parent 9413a9a commit 3f16b5e
Show file tree
Hide file tree
Showing 1,123 changed files with 3 additions and 209,523 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_26"]
v1_26 = []
v1_27 = []
earliest = ["v1_28"]
v1_28 = []
v1_29 = []
v1_30 = []
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 = 26;
const MIN: usize = 28;
const MAX: usize = 32;

println!("cargo::rerun-if-env-changed=K8S_OPENAPI_ENABLED_VERSION");
Expand Down
56 changes: 0 additions & 56 deletions k8s-openapi-codegen/src/fixups/upstream_bugs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,40 +283,6 @@ pub(crate) mod required_properties {

Err("never applied SecretProjection required properties override".into())
}

// `ValidatingAdmissionPolicyBindingList::items`
pub(crate) fn alpha1_validating_admission_policy_binding_list(spec: &mut crate::swagger20::Spec) -> Result<(), crate::Error> {
let definition_path = crate::swagger20::DefinitionPath("io.k8s.api.admissionregistration.v1alpha1.ValidatingAdmissionPolicyBindingList".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("items") {
if !property.1 {
property.1 = true;
return Ok(());
}
}
}
}

Err("never applied admissionregistration.k8s.io/v1alpha1.ValidatingAdmissionPolicyBindingList required properties override".into())
}

// `ValidatingAdmissionPolicyList::items`
pub(crate) fn alpha1_validating_admission_policy_list(spec: &mut crate::swagger20::Spec) -> Result<(), crate::Error> {
let definition_path = crate::swagger20::DefinitionPath("io.k8s.api.admissionregistration.v1alpha1.ValidatingAdmissionPolicyList".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("items") {
if !property.1 {
property.1 = true;
return Ok(());
}
}
}
}

Err("never applied admissionregistration.k8s.io/v1alpha1.ValidatingAdmissionPolicyList required properties override".into())
}
}

// `Status` has extra group-version-kind entries than the original `"":v1:Status` that cause it to not be detected as a `Resource`.
Expand Down Expand Up @@ -362,28 +328,6 @@ pub(crate) fn pod_scheduling_context_spec_potential_nodes_merge_strategy(spec: &
Err("never applied PodSchedulingContextSpec.potentialNodes merge strategy override".into())
}

// `ResourceClaimSchedulingStatus` has `set` merge strategy in versions before v1.29
// but v1.29 decided it would like clients to treat it as `atomic`.
//
// Ref: https://github.com/kubernetes/kubernetes/pull/119962
pub(crate) fn v1alpha1_resource_claim_scheduling_status_unsuitable_nodes_merge_strategy(spec: &mut crate::swagger20::Spec) -> Result<(), crate::Error> {
let definition_path = crate::swagger20::DefinitionPath("io.k8s.api.resource.v1alpha1.ResourceClaimSchedulingStatus".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("unsuitableNodes") {
if let crate::swagger20::MergeType::List { strategy, .. } = &mut property.0.merge_type {
if *strategy == crate::swagger20::KubernetesListType::Set {
*strategy = crate::swagger20::KubernetesListType::Atomic;
return Ok(());
}
}
}
}
}

Err("never applied ResourceClaimSchedulingStatus.unsuitableNodes merge strategy override".into())
}

// `ResourceClaimSchedulingStatus` has `set` merge strategy in versions before v1.29
// but v1.29 decided it would like clients to treat it as `atomic`.
//
Expand Down
49 changes: 0 additions & 49 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_26,
SupportedVersion::V1_27,
SupportedVersion::V1_28,
SupportedVersion::V1_29,
SupportedVersion::V1_30,
Expand All @@ -10,8 +8,6 @@ pub(crate) const ALL: &[SupportedVersion] = &[

#[derive(Clone, Copy, Debug)]
pub(crate) enum SupportedVersion {
V1_26,
V1_27,
V1_28,
V1_29,
V1_30,
Expand All @@ -22,8 +18,6 @@ pub(crate) enum SupportedVersion {
impl SupportedVersion {
pub(crate) fn name(self) -> &'static str {
match self {
SupportedVersion::V1_26 => "1.26",
SupportedVersion::V1_27 => "1.27",
SupportedVersion::V1_28 => "1.28",
SupportedVersion::V1_29 => "1.29",
SupportedVersion::V1_30 => "1.30",
Expand All @@ -34,8 +28,6 @@ impl SupportedVersion {

pub(crate) fn mod_root(self) -> &'static str {
match self {
SupportedVersion::V1_26 => "v1_26",
SupportedVersion::V1_27 => "v1_27",
SupportedVersion::V1_28 => "v1_28",
SupportedVersion::V1_29 => "v1_29",
SupportedVersion::V1_30 => "v1_30",
Expand All @@ -46,8 +38,6 @@ impl SupportedVersion {

pub(crate) fn spec_url(self) -> &'static str {
match self {
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.15/api/openapi-spec/swagger.json",
SupportedVersion::V1_29 => "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.29.12/api/openapi-spec/swagger.json",
SupportedVersion::V1_30 => "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.30.8/api/openapi-spec/swagger.json",
Expand All @@ -59,45 +49,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_26 => &[
crate::fixups::upstream_bugs::connect_options_gvk,
crate::fixups::upstream_bugs::optional_properties::eventsv1_event,
crate::fixups::upstream_bugs::required_properties::alpha1_validating_admission_policy_binding_list,
crate::fixups::upstream_bugs::required_properties::alpha1_validating_admission_policy_list,
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,
crate::fixups::upstream_bugs::status_extra_gvk,
crate::fixups::upstream_bugs::v1alpha1_resource_claim_scheduling_status_unsuitable_nodes_merge_strategy,
],

SupportedVersion::V1_27 => &[
crate::fixups::upstream_bugs::connect_options_gvk,
crate::fixups::upstream_bugs::optional_properties::eventsv1_event,
crate::fixups::upstream_bugs::required_properties::alpha1_validating_admission_policy_binding_list,
crate::fixups::upstream_bugs::required_properties::alpha1_validating_admission_policy_list,
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,
crate::fixups::upstream_bugs::pod_scheduling_context_spec_potential_nodes_merge_strategy,
crate::fixups::upstream_bugs::status_extra_gvk,
crate::fixups::upstream_bugs::v1alpha2_resource_claim_scheduling_status_unsuitable_nodes_merge_strategy,
],

SupportedVersion::V1_28 => &[
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_26 = ["k8s-openapi/v1_26"]
test_v1_27 = ["k8s-openapi/v1_27"]
test_v1_28 = ["k8s-openapi/v1_28"]
test_v1_29 = ["k8s-openapi/v1_29"]
test_v1_30 = ["k8s-openapi/v1_30"]
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_26 = ["k8s-openapi/v1_26"]
test_v1_27 = ["k8s-openapi/v1_27"]
test_v1_28 = ["k8s-openapi/v1_28"]
test_v1_29 = ["k8s-openapi/v1_29"]
test_v1_30 = ["k8s-openapi/v1_30"]
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 = 26;
const MIN: usize = 28;
const MAX: usize = 32;

let enabled_version = {
Expand Down
4 changes: 0 additions & 4 deletions k8s-openapi-tests/cluster-configs/v1.27.yaml

This file was deleted.

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_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";
#[cfg(feature = "test_v1_29")] let replays_directory = "v1-29";
#[cfg(feature = "test_v1_30")] let replays_directory = "v1-30";
Expand Down
10 changes: 0 additions & 10 deletions k8s-openapi-tests/test-replays/v1-26/api_versions-list.json

This file was deleted.

Loading

0 comments on commit 3f16b5e

Please sign in to comment.