Skip to content

Commit

Permalink
Update to v1.30.5, v1.31.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnavion committed Sep 12, 2024
1 parent 669fdb7 commit 0bbbd32
Show file tree
Hide file tree
Showing 20 changed files with 83 additions and 117 deletions.
27 changes: 0 additions & 27 deletions k8s-openapi-codegen/src/fixups/upstream_bugs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,30 +384,3 @@ pub(crate) fn v1alpha2_resource_claim_scheduling_status_unsuitable_nodes_merge_s

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

// `ResourceSliceList` is a list with a standard `metadata: ListMeta` field,
// but the spec thinks it has a `listMeta: ListMeta` field instead.
//
// This fixup fixes the OpenAPI spec so that the type is detected as a list, but actually deserializing the JSON object
// will be broken because there is nothing in the generated code to parse a `"listMeta"` object key as if it was
// `"metadata"`. That would require a bunch of changes in codegen-common, which are not worth it for a single alpha type,
// especially since the API server will presumably be fixed at some point anyway.
//
// Ref: https://github.com/kubernetes/kubernetes/issues/126659
pub(crate) fn v1alpha3_resource_slice_list_metadata(spec: &mut crate::swagger20::Spec) -> Result<(), crate::Error> {
let definition_path = crate::swagger20::DefinitionPath("io.k8s.api.resource.v1alpha3.ResourceSliceList".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.remove("listMeta") {
let metadata = properties.insert(crate::swagger20::PropertyName("metadata".to_owned()), property);
if metadata.is_some() {
return Err("ResourceSliceList has both listMeta and metadata properties".into());
}

return Ok(());
}
}
}

Err("never applied ResourceSliceList.metadata field rename override".into())
}
5 changes: 2 additions & 3 deletions k8s-openapi-codegen/src/supported_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ impl SupportedVersion {
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",
SupportedVersion::V1_29 => "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.29.9/api/openapi-spec/swagger.json",
SupportedVersion::V1_30 => "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.30.4/api/openapi-spec/swagger.json",
SupportedVersion::V1_31 => "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.31.0/api/openapi-spec/swagger.json",
SupportedVersion::V1_30 => "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.30.5/api/openapi-spec/swagger.json",
SupportedVersion::V1_31 => "https://raw.githubusercontent.com/kubernetes/kubernetes/v1.31.1/api/openapi-spec/swagger.json",
}
}

Expand Down Expand Up @@ -179,7 +179,6 @@ impl SupportedVersion {
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::v1alpha3_resource_slice_list_metadata,
],
};

Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion k8s-openapi-tests/test-replays/v1-30/deployment-list.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"request_body": "",
"request_content_type": null,
"response_status_code": 200,
"response_body": "{\"kind\":\"DeploymentList\",\"apiVersion\":\"apps/v1\",\"metadata\":{\"resourceVersion\":\"497\"},\"items\":[{\"metadata\":{\"name\":\"coredns\",\"namespace\":\"kube-system\",\"uid\":\"0c74b659-8da9-447c-92d7-fc65c215281d\",\"resourceVersion\":\"437\",\"generation\":1,\"creationTimestamp\":\"2024-08-15T02:44:00Z\",\"labels\":{\"k8s-app\":\"kube-dns\"},\"annotations\":{\"deployment.kubernetes.io/revision\":\"1\"},\"managedFields\":[{\"manager\":\"kubeadm\",\"operation\":\"Update\",\"apiVersion\":\"apps/v1\",\"time\":\"2024-08-15T02:44:00Z\",\"fieldsType\":\"FieldsV1\",\"fieldsV1\":{\"f:metadata\":{\"f:labels\":{\".\":{},\"f:k8s-app\":{}}},\"f:spec\":{\"f:progressDeadlineSeconds\":{},\"f:replicas\":{},\"f:revisionHistoryLimit\":{},\"f:selector\":{},\"f:strategy\":{\"f:rollingUpdate\":{\".\":{},\"f:maxSurge\":{},\"f:maxUnavailable\":{}},\"f:type\":{}},\"f:template\":{\"f:metadata\":{\"f:labels\":{\".\":{},\"f:k8s-app\":{}}},\"f:spec\":{\"f:affinity\":{\".\":{},\"f:podAntiAffinity\":{\".\":{},\"f:preferredDuringSchedulingIgnoredDuringExecution\":{}}},\"f:containers\":{\"k:{\\\"name\\\":\\\"coredns\\\"}\":{\".\":{},\"f:args\":{},\"f:image\":{},\"f:imagePullPolicy\":{},\"f:livenessProbe\":{\".\":{},\"f:failureThreshold\":{},\"f:httpGet\":{\".\":{},\"f:path\":{},\"f:port\":{},\"f:scheme\":{}},\"f:initialDelaySeconds\":{},\"f:periodSeconds\":{},\"f:successThreshold\":{},\"f:timeoutSeconds\":{}},\"f:name\":{},\"f:ports\":{\".\":{},\"k:{\\\"containerPort\\\":53,\\\"protocol\\\":\\\"TCP\\\"}\":{\".\":{},\"f:containerPort\":{},\"f:name\":{},\"f:protocol\":{}},\"k:{\\\"containerPort\\\":53,\\\"protocol\\\":\\\"UDP\\\"}\":{\".\":{},\"f:containerPort\":{},\"f:name\":{},\"f:protocol\":{}},\"k:{\\\"containerPort\\\":9153,\\\"protocol\\\":\\\"TCP\\\"}\":{\".\":{},\"f:containerPort\":{},\"f:name\":{},\"f:protocol\":{}}},\"f:readinessProbe\":{\".\":{},\"f:failureThreshold\":{},\"f:httpGet\":{\".\":{},\"f:path\":{},\"f:port\":{},\"f:scheme\":{}},\"f:periodSeconds\":{},\"f:successThreshold\":{},\"f:timeoutSeconds\":{}},\"f:resources\":{\".\":{},\"f:limits\":{\".\":{},\"f:memory\":{}},\"f:requests\":{\".\":{},\"f:cpu\":{},\"f:memory\":{}}},\"f:securityContext\":{\".\":{},\"f:allowPrivilegeEscalation\":{},\"f:capabilities\":{\".\":{},\"f:add\":{},\"f:drop\":{}},\"f:readOnlyRootFilesystem\":{}},\"f:terminationMessagePath\":{},\"f:terminationMessagePolicy\":{},\"f:volumeMounts\":{\".\":{},\"k:{\\\"mountPath\\\":\\\"/etc/coredns\\\"}\":{\".\":{},\"f:mountPath\":{},\"f:name\":{},\"f:readOnly\":{}}}}},\"f:dnsPolicy\":{},\"f:nodeSelector\":{},\"f:priorityClassName\":{},\"f:restartPolicy\":{},\"f:schedulerName\":{},\"f:securityContext\":{},\"f:serviceAccount\":{},\"f:serviceAccountName\":{},\"f:terminationGracePeriodSeconds\":{},\"f:tolerations\":{},\"f:volumes\":{\".\":{},\"k:{\\\"name\\\":\\\"config-volume\\\"}\":{\".\":{},\"f:configMap\":{\".\":{},\"f:defaultMode\":{},\"f:items\":{},\"f:name\":{}},\"f:name\":{}}}}}}}},{\"manager\":\"kube-controller-manager\",\"operation\":\"Update\",\"apiVersion\":\"apps/v1\",\"time\":\"2024-08-15T02:44:20Z\",\"fieldsType\":\"FieldsV1\",\"fieldsV1\":{\"f:metadata\":{\"f:annotations\":{\".\":{},\"f:deployment.kubernetes.io/revision\":{}}},\"f:status\":{\"f:availableReplicas\":{},\"f:conditions\":{\".\":{},\"k:{\\\"type\\\":\\\"Available\\\"}\":{\".\":{},\"f:lastTransitionTime\":{},\"f:lastUpdateTime\":{},\"f:message\":{},\"f:reason\":{},\"f:status\":{},\"f:type\":{}},\"k:{\\\"type\\\":\\\"Progressing\\\"}\":{\".\":{},\"f:lastTransitionTime\":{},\"f:lastUpdateTime\":{},\"f:message\":{},\"f:reason\":{},\"f:status\":{},\"f:type\":{}}},\"f:observedGeneration\":{},\"f:readyReplicas\":{},\"f:replicas\":{},\"f:updatedReplicas\":{}}},\"subresource\":\"status\"}]},\"spec\":{\"replicas\":2,\"selector\":{\"matchLabels\":{\"k8s-app\":\"kube-dns\"}},\"template\":{\"metadata\":{\"creationTimestamp\":null,\"labels\":{\"k8s-app\":\"kube-dns\"}},\"spec\":{\"volumes\":[{\"name\":\"config-volume\",\"configMap\":{\"name\":\"coredns\",\"items\":[{\"key\":\"Corefile\",\"path\":\"Corefile\"}],\"defaultMode\":420}}],\"containers\":[{\"name\":\"coredns\",\"image\":\"registry.k8s.io/coredns/coredns:v1.11.1\",\"args\":[\"-conf\",\"/etc/coredns/Corefile\"],\"ports\":[{\"name\":\"dns\",\"containerPort\":53,\"protocol\":\"UDP\"},{\"name\":\"dns-tcp\",\"containerPort\":53,\"protocol\":\"TCP\"},{\"name\":\"metrics\",\"containerPort\":9153,\"protocol\":\"TCP\"}],\"resources\":{\"limits\":{\"memory\":\"170Mi\"},\"requests\":{\"cpu\":\"100m\",\"memory\":\"70Mi\"}},\"volumeMounts\":[{\"name\":\"config-volume\",\"readOnly\":true,\"mountPath\":\"/etc/coredns\"}],\"livenessProbe\":{\"httpGet\":{\"path\":\"/health\",\"port\":8080,\"scheme\":\"HTTP\"},\"initialDelaySeconds\":60,\"timeoutSeconds\":5,\"periodSeconds\":10,\"successThreshold\":1,\"failureThreshold\":5},\"readinessProbe\":{\"httpGet\":{\"path\":\"/ready\",\"port\":8181,\"scheme\":\"HTTP\"},\"timeoutSeconds\":1,\"periodSeconds\":10,\"successThreshold\":1,\"failureThreshold\":3},\"terminationMessagePath\":\"/dev/termination-log\",\"terminationMessagePolicy\":\"File\",\"imagePullPolicy\":\"IfNotPresent\",\"securityContext\":{\"capabilities\":{\"add\":[\"NET_BIND_SERVICE\"],\"drop\":[\"ALL\"]},\"readOnlyRootFilesystem\":true,\"allowPrivilegeEscalation\":false}}],\"restartPolicy\":\"Always\",\"terminationGracePeriodSeconds\":30,\"dnsPolicy\":\"Default\",\"nodeSelector\":{\"kubernetes.io/os\":\"linux\"},\"serviceAccountName\":\"coredns\",\"serviceAccount\":\"coredns\",\"securityContext\":{},\"affinity\":{\"podAntiAffinity\":{\"preferredDuringSchedulingIgnoredDuringExecution\":[{\"weight\":100,\"podAffinityTerm\":{\"labelSelector\":{\"matchExpressions\":[{\"key\":\"k8s-app\",\"operator\":\"In\",\"values\":[\"kube-dns\"]}]},\"topologyKey\":\"kubernetes.io/hostname\"}}]}},\"schedulerName\":\"default-scheduler\",\"tolerations\":[{\"key\":\"CriticalAddonsOnly\",\"operator\":\"Exists\"},{\"key\":\"node-role.kubernetes.io/control-plane\",\"effect\":\"NoSchedule\"}],\"priorityClassName\":\"system-cluster-critical\"}},\"strategy\":{\"type\":\"RollingUpdate\",\"rollingUpdate\":{\"maxUnavailable\":1,\"maxSurge\":\"25%\"}},\"revisionHistoryLimit\":10,\"progressDeadlineSeconds\":600},\"status\":{\"observedGeneration\":1,\"replicas\":2,\"updatedReplicas\":2,\"readyReplicas\":2,\"availableReplicas\":2,\"conditions\":[{\"type\":\"Available\",\"status\":\"True\",\"lastUpdateTime\":\"2024-08-15T02:44:20Z\",\"lastTransitionTime\":\"2024-08-15T02:44:20Z\",\"reason\":\"MinimumReplicasAvailable\",\"message\":\"Deployment has minimum availability.\"},{\"type\":\"Progressing\",\"status\":\"True\",\"lastUpdateTime\":\"2024-08-15T02:44:20Z\",\"lastTransitionTime\":\"2024-08-15T02:44:16Z\",\"reason\":\"NewReplicaSetAvailable\",\"message\":\"ReplicaSet \\\"coredns-7db6d8ff4d\\\" has successfully progressed.\"}]}}]}\n"
"response_body": "{\"kind\":\"DeploymentList\",\"apiVersion\":\"apps/v1\",\"metadata\":{\"resourceVersion\":\"563\"},\"items\":[{\"metadata\":{\"name\":\"coredns\",\"namespace\":\"kube-system\",\"uid\":\"97f6cda9-7f0a-4f5b-a5a3-e72082ab574c\",\"resourceVersion\":\"461\",\"generation\":1,\"creationTimestamp\":\"2024-09-12T06:20:42Z\",\"labels\":{\"k8s-app\":\"kube-dns\"},\"annotations\":{\"deployment.kubernetes.io/revision\":\"1\"},\"managedFields\":[{\"manager\":\"kubeadm\",\"operation\":\"Update\",\"apiVersion\":\"apps/v1\",\"time\":\"2024-09-12T06:20:42Z\",\"fieldsType\":\"FieldsV1\",\"fieldsV1\":{\"f:metadata\":{\"f:labels\":{\".\":{},\"f:k8s-app\":{}}},\"f:spec\":{\"f:progressDeadlineSeconds\":{},\"f:replicas\":{},\"f:revisionHistoryLimit\":{},\"f:selector\":{},\"f:strategy\":{\"f:rollingUpdate\":{\".\":{},\"f:maxSurge\":{},\"f:maxUnavailable\":{}},\"f:type\":{}},\"f:template\":{\"f:metadata\":{\"f:labels\":{\".\":{},\"f:k8s-app\":{}}},\"f:spec\":{\"f:affinity\":{\".\":{},\"f:podAntiAffinity\":{\".\":{},\"f:preferredDuringSchedulingIgnoredDuringExecution\":{}}},\"f:containers\":{\"k:{\\\"name\\\":\\\"coredns\\\"}\":{\".\":{},\"f:args\":{},\"f:image\":{},\"f:imagePullPolicy\":{},\"f:livenessProbe\":{\".\":{},\"f:failureThreshold\":{},\"f:httpGet\":{\".\":{},\"f:path\":{},\"f:port\":{},\"f:scheme\":{}},\"f:initialDelaySeconds\":{},\"f:periodSeconds\":{},\"f:successThreshold\":{},\"f:timeoutSeconds\":{}},\"f:name\":{},\"f:ports\":{\".\":{},\"k:{\\\"containerPort\\\":53,\\\"protocol\\\":\\\"TCP\\\"}\":{\".\":{},\"f:containerPort\":{},\"f:name\":{},\"f:protocol\":{}},\"k:{\\\"containerPort\\\":53,\\\"protocol\\\":\\\"UDP\\\"}\":{\".\":{},\"f:containerPort\":{},\"f:name\":{},\"f:protocol\":{}},\"k:{\\\"containerPort\\\":9153,\\\"protocol\\\":\\\"TCP\\\"}\":{\".\":{},\"f:containerPort\":{},\"f:name\":{},\"f:protocol\":{}}},\"f:readinessProbe\":{\".\":{},\"f:failureThreshold\":{},\"f:httpGet\":{\".\":{},\"f:path\":{},\"f:port\":{},\"f:scheme\":{}},\"f:periodSeconds\":{},\"f:successThreshold\":{},\"f:timeoutSeconds\":{}},\"f:resources\":{\".\":{},\"f:limits\":{\".\":{},\"f:memory\":{}},\"f:requests\":{\".\":{},\"f:cpu\":{},\"f:memory\":{}}},\"f:securityContext\":{\".\":{},\"f:allowPrivilegeEscalation\":{},\"f:capabilities\":{\".\":{},\"f:add\":{},\"f:drop\":{}},\"f:readOnlyRootFilesystem\":{}},\"f:terminationMessagePath\":{},\"f:terminationMessagePolicy\":{},\"f:volumeMounts\":{\".\":{},\"k:{\\\"mountPath\\\":\\\"/etc/coredns\\\"}\":{\".\":{},\"f:mountPath\":{},\"f:name\":{},\"f:readOnly\":{}}}}},\"f:dnsPolicy\":{},\"f:nodeSelector\":{},\"f:priorityClassName\":{},\"f:restartPolicy\":{},\"f:schedulerName\":{},\"f:securityContext\":{},\"f:serviceAccount\":{},\"f:serviceAccountName\":{},\"f:terminationGracePeriodSeconds\":{},\"f:tolerations\":{},\"f:volumes\":{\".\":{},\"k:{\\\"name\\\":\\\"config-volume\\\"}\":{\".\":{},\"f:configMap\":{\".\":{},\"f:defaultMode\":{},\"f:items\":{},\"f:name\":{}},\"f:name\":{}}}}}}}},{\"manager\":\"kube-controller-manager\",\"operation\":\"Update\",\"apiVersion\":\"apps/v1\",\"time\":\"2024-09-12T06:21:11Z\",\"fieldsType\":\"FieldsV1\",\"fieldsV1\":{\"f:metadata\":{\"f:annotations\":{\".\":{},\"f:deployment.kubernetes.io/revision\":{}}},\"f:status\":{\"f:availableReplicas\":{},\"f:conditions\":{\".\":{},\"k:{\\\"type\\\":\\\"Available\\\"}\":{\".\":{},\"f:lastTransitionTime\":{},\"f:lastUpdateTime\":{},\"f:message\":{},\"f:reason\":{},\"f:status\":{},\"f:type\":{}},\"k:{\\\"type\\\":\\\"Progressing\\\"}\":{\".\":{},\"f:lastTransitionTime\":{},\"f:lastUpdateTime\":{},\"f:message\":{},\"f:reason\":{},\"f:status\":{},\"f:type\":{}}},\"f:observedGeneration\":{},\"f:readyReplicas\":{},\"f:replicas\":{},\"f:updatedReplicas\":{}}},\"subresource\":\"status\"}]},\"spec\":{\"replicas\":2,\"selector\":{\"matchLabels\":{\"k8s-app\":\"kube-dns\"}},\"template\":{\"metadata\":{\"creationTimestamp\":null,\"labels\":{\"k8s-app\":\"kube-dns\"}},\"spec\":{\"volumes\":[{\"name\":\"config-volume\",\"configMap\":{\"name\":\"coredns\",\"items\":[{\"key\":\"Corefile\",\"path\":\"Corefile\"}],\"defaultMode\":420}}],\"containers\":[{\"name\":\"coredns\",\"image\":\"registry.k8s.io/coredns/coredns:v1.11.3\",\"args\":[\"-conf\",\"/etc/coredns/Corefile\"],\"ports\":[{\"name\":\"dns\",\"containerPort\":53,\"protocol\":\"UDP\"},{\"name\":\"dns-tcp\",\"containerPort\":53,\"protocol\":\"TCP\"},{\"name\":\"metrics\",\"containerPort\":9153,\"protocol\":\"TCP\"}],\"resources\":{\"limits\":{\"memory\":\"170Mi\"},\"requests\":{\"cpu\":\"100m\",\"memory\":\"70Mi\"}},\"volumeMounts\":[{\"name\":\"config-volume\",\"readOnly\":true,\"mountPath\":\"/etc/coredns\"}],\"livenessProbe\":{\"httpGet\":{\"path\":\"/health\",\"port\":8080,\"scheme\":\"HTTP\"},\"initialDelaySeconds\":60,\"timeoutSeconds\":5,\"periodSeconds\":10,\"successThreshold\":1,\"failureThreshold\":5},\"readinessProbe\":{\"httpGet\":{\"path\":\"/ready\",\"port\":8181,\"scheme\":\"HTTP\"},\"timeoutSeconds\":1,\"periodSeconds\":10,\"successThreshold\":1,\"failureThreshold\":3},\"terminationMessagePath\":\"/dev/termination-log\",\"terminationMessagePolicy\":\"File\",\"imagePullPolicy\":\"IfNotPresent\",\"securityContext\":{\"capabilities\":{\"add\":[\"NET_BIND_SERVICE\"],\"drop\":[\"ALL\"]},\"readOnlyRootFilesystem\":true,\"allowPrivilegeEscalation\":false}}],\"restartPolicy\":\"Always\",\"terminationGracePeriodSeconds\":30,\"dnsPolicy\":\"Default\",\"nodeSelector\":{\"kubernetes.io/os\":\"linux\"},\"serviceAccountName\":\"coredns\",\"serviceAccount\":\"coredns\",\"securityContext\":{},\"affinity\":{\"podAntiAffinity\":{\"preferredDuringSchedulingIgnoredDuringExecution\":[{\"weight\":100,\"podAffinityTerm\":{\"labelSelector\":{\"matchExpressions\":[{\"key\":\"k8s-app\",\"operator\":\"In\",\"values\":[\"kube-dns\"]}]},\"topologyKey\":\"kubernetes.io/hostname\"}}]}},\"schedulerName\":\"default-scheduler\",\"tolerations\":[{\"key\":\"CriticalAddonsOnly\",\"operator\":\"Exists\"},{\"key\":\"node-role.kubernetes.io/control-plane\",\"effect\":\"NoSchedule\"}],\"priorityClassName\":\"system-cluster-critical\"}},\"strategy\":{\"type\":\"RollingUpdate\",\"rollingUpdate\":{\"maxUnavailable\":1,\"maxSurge\":\"25%\"}},\"revisionHistoryLimit\":10,\"progressDeadlineSeconds\":600},\"status\":{\"observedGeneration\":1,\"replicas\":2,\"updatedReplicas\":2,\"readyReplicas\":2,\"availableReplicas\":2,\"conditions\":[{\"type\":\"Available\",\"status\":\"True\",\"lastUpdateTime\":\"2024-09-12T06:21:11Z\",\"lastTransitionTime\":\"2024-09-12T06:21:11Z\",\"reason\":\"MinimumReplicasAvailable\",\"message\":\"Deployment has minimum availability.\"},{\"type\":\"Progressing\",\"status\":\"True\",\"lastUpdateTime\":\"2024-09-12T06:21:11Z\",\"lastTransitionTime\":\"2024-09-12T06:20:57Z\",\"reason\":\"NewReplicaSetAvailable\",\"message\":\"ReplicaSet \\\"coredns-55cb58b774\\\" has successfully progressed.\"}]}}]}\n"
}
]
Loading

0 comments on commit 0bbbd32

Please sign in to comment.