Skip to content

Commit

Permalink
Add v1.30.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnavion committed Apr 17, 2024
1 parent b74a0e3 commit 452e00d
Show file tree
Hide file tree
Showing 650 changed files with 120,673 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ v1_26 = []
v1_27 = []
v1_28 = []
v1_29 = []
latest = ["v1_29"]
v1_30 = []
latest = ["v1_30"]
# Enable `schemars::JsonSchema` implementations on resource types.
schemars = ["dep:schemars"]

Expand Down
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
use std::io::Write;

const MIN: usize = 24;
const MAX: usize = 29;
const MAX: usize = 30;

println!("cargo:rerun-if-env-changed=K8S_OPENAPI_ENABLED_VERSION");

Expand Down
2 changes: 1 addition & 1 deletion devenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -euo pipefail

session_name='k8s-openapi'
max_version='1.29'
max_version='1.30'

if ! tmux has-session -t "=$session_name"; then
cd "$(dirname "$0")"
Expand Down
34 changes: 34 additions & 0 deletions k8s-openapi-codegen/src/fixups/upstream_bugs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,40 @@ pub(crate) mod required_properties {

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

// `ValidatingAdmissionPolicyBindingList::items`
pub(crate) fn validating_admission_policy_binding_list(spec: &mut crate::swagger20::Spec) -> Result<(), crate::Error> {
let definition_path = crate::swagger20::DefinitionPath("io.k8s.api.admissionregistration.v1.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/v1.ValidatingAdmissionPolicyBindingList required properties override".into())
}

// `ValidatingAdmissionPolicyList::items`
pub(crate) fn validating_admission_policy_list(spec: &mut crate::swagger20::Spec) -> Result<(), crate::Error> {
let definition_path = crate::swagger20::DefinitionPath("io.k8s.api.admissionregistration.v1.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/v1.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
17 changes: 17 additions & 0 deletions k8s-openapi-codegen/src/supported_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pub(crate) const ALL: &[SupportedVersion] = &[
SupportedVersion::V1_27,
SupportedVersion::V1_28,
SupportedVersion::V1_29,
SupportedVersion::V1_30,
];

#[derive(Clone, Copy, Debug)]
Expand All @@ -15,6 +16,7 @@ pub(crate) enum SupportedVersion {
V1_27,
V1_28,
V1_29,
V1_30,
}

impl SupportedVersion {
Expand All @@ -26,6 +28,7 @@ impl SupportedVersion {
SupportedVersion::V1_27 => "1.27",
SupportedVersion::V1_28 => "1.28",
SupportedVersion::V1_29 => "1.29",
SupportedVersion::V1_30 => "1.30",
}
}

Expand All @@ -37,6 +40,7 @@ impl SupportedVersion {
SupportedVersion::V1_27 => "v1_27",
SupportedVersion::V1_28 => "v1_28",
SupportedVersion::V1_29 => "v1_29",
SupportedVersion::V1_30 => "v1_30",
}
}

Expand All @@ -48,6 +52,7 @@ impl SupportedVersion {
SupportedVersion::V1_27 => "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.27.13/api/openapi-spec/swagger.json",
SupportedVersion::V1_28 => "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.28.9/api/openapi-spec/swagger.json",
SupportedVersion::V1_29 => "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.29.4/api/openapi-spec/swagger.json",
SupportedVersion::V1_30 => "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.30.0/api/openapi-spec/swagger.json",
}
}

Expand Down Expand Up @@ -105,6 +110,18 @@ impl SupportedVersion {
crate::fixups::upstream_bugs::required_properties::beta1_validating_admission_policy_list,
crate::fixups::upstream_bugs::status_extra_gvk,
],

SupportedVersion::V1_30 => &[
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::beta1_validating_admission_policy_binding_list,
crate::fixups::upstream_bugs::required_properties::beta1_validating_admission_policy_list,
crate::fixups::upstream_bugs::required_properties::validating_admission_policy_binding_list,
crate::fixups::upstream_bugs::required_properties::validating_admission_policy_list,
crate::fixups::upstream_bugs::status_extra_gvk,
],
};

let special_fixups = &[
Expand Down
1 change: 1 addition & 0 deletions k8s-openapi-tests-macro-deps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ 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"]
1 change: 1 addition & 0 deletions k8s-openapi-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,4 @@ 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"]
2 changes: 1 addition & 1 deletion k8s-openapi-tests/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,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 MAX: usize = 29;
const MAX: usize = 30;

let enabled_version = {
let mut enabled_versions = (MIN..=MAX).filter(|v| std::env::var(format!("CARGO_FEATURE_TEST_V1_{v}")).is_ok());
Expand Down
4 changes: 4 additions & 0 deletions k8s-openapi-tests/cluster-configs/v1.30.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
featureGates:
WatchList: true
1 change: 1 addition & 0 deletions k8s-openapi-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ impl Client {
#[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";

let replays_directory =
std::path::Path::new(concat!(env!("CARGO_MANIFEST_DIR")))
Expand Down
10 changes: 10 additions & 0 deletions k8s-openapi-tests/test-replays/v1-30/api_versions-list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"request_url": "/apis",
"request_method": "GET",
"request_body": "",
"request_content_type": null,
"response_status_code": 200,
"response_body": "{\"kind\":\"APIGroupList\",\"apiVersion\":\"v1\",\"groups\":[{\"name\":\"apiregistration.k8s.io\",\"versions\":[{\"groupVersion\":\"apiregistration.k8s.io/v1\",\"version\":\"v1\"}],\"preferredVersion\":{\"groupVersion\":\"apiregistration.k8s.io/v1\",\"version\":\"v1\"}},{\"name\":\"apps\",\"versions\":[{\"groupVersion\":\"apps/v1\",\"version\":\"v1\"}],\"preferredVersion\":{\"groupVersion\":\"apps/v1\",\"version\":\"v1\"}},{\"name\":\"events.k8s.io\",\"versions\":[{\"groupVersion\":\"events.k8s.io/v1\",\"version\":\"v1\"}],\"preferredVersion\":{\"groupVersion\":\"events.k8s.io/v1\",\"version\":\"v1\"}},{\"name\":\"authentication.k8s.io\",\"versions\":[{\"groupVersion\":\"authentication.k8s.io/v1\",\"version\":\"v1\"}],\"preferredVersion\":{\"groupVersion\":\"authentication.k8s.io/v1\",\"version\":\"v1\"}},{\"name\":\"authorization.k8s.io\",\"versions\":[{\"groupVersion\":\"authorization.k8s.io/v1\",\"version\":\"v1\"}],\"preferredVersion\":{\"groupVersion\":\"authorization.k8s.io/v1\",\"version\":\"v1\"}},{\"name\":\"autoscaling\",\"versions\":[{\"groupVersion\":\"autoscaling/v2\",\"version\":\"v2\"},{\"groupVersion\":\"autoscaling/v1\",\"version\":\"v1\"}],\"preferredVersion\":{\"groupVersion\":\"autoscaling/v2\",\"version\":\"v2\"}},{\"name\":\"batch\",\"versions\":[{\"groupVersion\":\"batch/v1\",\"version\":\"v1\"}],\"preferredVersion\":{\"groupVersion\":\"batch/v1\",\"version\":\"v1\"}},{\"name\":\"certificates.k8s.io\",\"versions\":[{\"groupVersion\":\"certificates.k8s.io/v1\",\"version\":\"v1\"}],\"preferredVersion\":{\"groupVersion\":\"certificates.k8s.io/v1\",\"version\":\"v1\"}},{\"name\":\"networking.k8s.io\",\"versions\":[{\"groupVersion\":\"networking.k8s.io/v1\",\"version\":\"v1\"}],\"preferredVersion\":{\"groupVersion\":\"networking.k8s.io/v1\",\"version\":\"v1\"}},{\"name\":\"policy\",\"versions\":[{\"groupVersion\":\"policy/v1\",\"version\":\"v1\"}],\"preferredVersion\":{\"groupVersion\":\"policy/v1\",\"version\":\"v1\"}},{\"name\":\"rbac.authorization.k8s.io\",\"versions\":[{\"groupVersion\":\"rbac.authorization.k8s.io/v1\",\"version\":\"v1\"}],\"preferredVersion\":{\"groupVersion\":\"rbac.authorization.k8s.io/v1\",\"version\":\"v1\"}},{\"name\":\"storage.k8s.io\",\"versions\":[{\"groupVersion\":\"storage.k8s.io/v1\",\"version\":\"v1\"}],\"preferredVersion\":{\"groupVersion\":\"storage.k8s.io/v1\",\"version\":\"v1\"}},{\"name\":\"admissionregistration.k8s.io\",\"versions\":[{\"groupVersion\":\"admissionregistration.k8s.io/v1\",\"version\":\"v1\"}],\"preferredVersion\":{\"groupVersion\":\"admissionregistration.k8s.io/v1\",\"version\":\"v1\"}},{\"name\":\"apiextensions.k8s.io\",\"versions\":[{\"groupVersion\":\"apiextensions.k8s.io/v1\",\"version\":\"v1\"}],\"preferredVersion\":{\"groupVersion\":\"apiextensions.k8s.io/v1\",\"version\":\"v1\"}},{\"name\":\"scheduling.k8s.io\",\"versions\":[{\"groupVersion\":\"scheduling.k8s.io/v1\",\"version\":\"v1\"}],\"preferredVersion\":{\"groupVersion\":\"scheduling.k8s.io/v1\",\"version\":\"v1\"}},{\"name\":\"coordination.k8s.io\",\"versions\":[{\"groupVersion\":\"coordination.k8s.io/v1\",\"version\":\"v1\"}],\"preferredVersion\":{\"groupVersion\":\"coordination.k8s.io/v1\",\"version\":\"v1\"}},{\"name\":\"node.k8s.io\",\"versions\":[{\"groupVersion\":\"node.k8s.io/v1\",\"version\":\"v1\"}],\"preferredVersion\":{\"groupVersion\":\"node.k8s.io/v1\",\"version\":\"v1\"}},{\"name\":\"discovery.k8s.io\",\"versions\":[{\"groupVersion\":\"discovery.k8s.io/v1\",\"version\":\"v1\"}],\"preferredVersion\":{\"groupVersion\":\"discovery.k8s.io/v1\",\"version\":\"v1\"}},{\"name\":\"flowcontrol.apiserver.k8s.io\",\"versions\":[{\"groupVersion\":\"flowcontrol.apiserver.k8s.io/v1\",\"version\":\"v1\"},{\"groupVersion\":\"flowcontrol.apiserver.k8s.io/v1beta3\",\"version\":\"v1beta3\"}],\"preferredVersion\":{\"groupVersion\":\"flowcontrol.apiserver.k8s.io/v1\",\"version\":\"v1\"}}]}\n"
}
]
Loading

0 comments on commit 452e00d

Please sign in to comment.