Skip to content

Commit 981ad40

Browse files
committed
schema: Added OpenAPI schema for 1.25.0
1 parent c148274 commit 981ad40

39 files changed

+83000
-37
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
kubernetes: [v1.24.0,v1.12.0]
14+
kubernetes: [v1.25.0,1.24.4,1.23.10,v1.12.0]
1515
env:
1616
K8S_VERSION: ${{ matrix.kubernetes }}
1717
steps:
@@ -34,7 +34,7 @@ jobs:
3434
if: success()
3535
run: ./gradlew build -PskipPublishing
3636
- name: Sonar Analysis
37-
if: success() && startsWith(matrix.kubernetes, 'v1.24')
37+
if: success() && startsWith(matrix.kubernetes, 'v1.25')
3838
env:
3939
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4040
run: ./gradlew jacocoRootReport sonarqube -PskipPublishing

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
uses: manusa/[email protected]
1717
with:
1818
minikube version: v1.25.2
19-
kubernetes version: v1.24.0
19+
kubernetes version: v1.25.0
2020
github token: ${{ secrets.GITHUB_TOKEN }}
2121
start args: '--addons=metrics-server --force'
2222
# --extra-config=apiserver.runtime-config=api/beta=true'

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Provides the basic interfaces and Exception types to be used across the differen
9696

9797
Kubernetes model objects to be used for REST API serialization/deserialization.
9898

99-
Model types are generated for Kubernetes equivalents in versions ranging from 1.15 to 1.24.
99+
Model types are generated for Kubernetes equivalents in versions ranging from 1.15 to 1.25.
100100

101101
#### kubernetes-api
102102
[![Maven Central](https://img.shields.io/maven-central/v/com.marcnuri.yakc/kubernetes-api)
@@ -108,7 +108,7 @@ Model types are generated for Kubernetes equivalents in versions ranging from 1.
108108
[Kubernetes JSON](https://github.com/kubernetes/kubernetes/blob/master/api/openapi-spec/swagger.json)
109109
[OpenAPI](https://swagger.io/specification/) schema.
110110

111-
API methods for Kubernetes REST endpoints in versions ranging from 1.15 to 1.24.
111+
API methods for Kubernetes REST endpoints in versions ranging from 1.15 to 1.25.
112112

113113
#### kubernetes-client
114114
[![Maven Central](https://img.shields.io/maven-central/v/com.marcnuri.yakc/kubernetes-client)

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def availableSchemaNames = Arrays.asList(
2020
"kubernetes-1.21.0.json",
2121
"kubernetes-1.22.13.json",
2222
"kubernetes-1.23.10.json",
23-
"kubernetes-1.24.4.json"
23+
"kubernetes-1.24.4.json",
24+
"kubernetes-1.25.0.json"
2425
)
2526
def availableSchemas = availableSchemaNames.stream()
2627
.map { s -> new File(schemaDir, s) }

kubernetes-api/src/api/java/com/marcnuri/yakc/api/networking/v1alpha1/NetworkingV1alpha1Api.java

Lines changed: 904 additions & 0 deletions
Large diffs are not rendered by default.

kubernetes-model/src/model/java/com/marcnuri/yakc/model/io/k8s/api/apps/v1/StatefulSet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import lombok.ToString;
2727

2828
/**
29-
* StatefulSet represents a set of pods with consistent identities. Identities are defined as:<br><p> - Network: A single stable DNS and hostname.<br><p> - Storage: As many VolumeClaims as requested.<br><p> The StatefulSet guarantees that a given network identity will always map to the same storage identity.
29+
* StatefulSet represents a set of pods with consistent identities. Identities are defined as:<br><p> - Network: A single stable DNS and hostname.<br><p> - Storage: As many VolumeClaims as requested.<br><p> <br><p> The StatefulSet guarantees that a given network identity will always map to the same storage identity.
3030
*/
3131
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
3232
@Builder(toBuilder = true, builderClassName = "Builder")

kubernetes-model/src/model/java/com/marcnuri/yakc/model/io/k8s/api/apps/v1/StatefulSetSpec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class StatefulSetSpec implements Model {
4343

4444

4545
/**
46-
* Minimum number of seconds for which a newly created pod should be ready without any of its container crashing for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready) This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate.
46+
* Minimum number of seconds for which a newly created pod should be ready without any of its container crashing for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)
4747
*/
4848
@JsonProperty("minReadySeconds")
4949
private Number minReadySeconds;

kubernetes-model/src/model/java/com/marcnuri/yakc/model/io/k8s/api/apps/v1/StatefulSetStatus.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class StatefulSetStatus implements Model {
4040

4141

4242
/**
43-
* Total number of available pods (ready for at least minReadySeconds) targeted by this statefulset. This is a beta field and enabled/disabled by StatefulSetMinReadySeconds feature gate.
43+
* Total number of available pods (ready for at least minReadySeconds) targeted by this statefulset.
4444
*/
4545
@JsonProperty("availableReplicas")
4646
private Number availableReplicas;

kubernetes-model/src/model/java/com/marcnuri/yakc/model/io/k8s/api/authentication/v1/TokenRequestSpec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class TokenRequestSpec implements Model {
4040

4141

4242
/**
43-
* Audiences are the intendend audiences of the token. A recipient of a token must identitfy themself with an identifier in the list of audiences of the token, and otherwise should reject the token. A token issued for multiple audiences may be used to authenticate against any of the audiences listed but implies a high degree of trust between the target audiences.
43+
* Audiences are the intendend audiences of the token. A recipient of a token must identify themself with an identifier in the list of audiences of the token, and otherwise should reject the token. A token issued for multiple audiences may be used to authenticate against any of the audiences listed but implies a high degree of trust between the target audiences.
4444
*/
4545
@NonNull
4646
@JsonProperty("audiences")

kubernetes-model/src/model/java/com/marcnuri/yakc/model/io/k8s/api/batch/v1/CronJobSpec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public class CronJobSpec implements Model {
7979
private Boolean suspend;
8080

8181
/**
82-
* The time zone for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. If not specified, this will rely on the time zone of the kube-controller-manager process. ALPHA: This field is in alpha and must be enabled via the `CronJobTimeZone` feature gate.
82+
* The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. If not specified, this will default to the time zone of the kube-controller-manager process. The set of valid time zone names and the time zone offset is loaded from the system-wide time zone database by the API server during CronJob validation and the controller manager during execution. If no system-wide time zone database can be found a bundled version of the database is used instead. If the time zone name becomes invalid during the lifetime of a CronJob or due to a change in host configuration, the controller will stop creating new new Jobs and will create a system event with the reason UnknownTimeZone. More information can be found in https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#time-zones This is beta field and must be enabled via the `CronJobTimeZone` feature gate.
8383
*/
8484
@JsonProperty("timeZone")
8585
private String timeZone;

kubernetes-model/src/model/java/com/marcnuri/yakc/model/io/k8s/api/batch/v1/JobSpec.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ public class JobSpec implements Model {
7575
@JsonProperty("parallelism")
7676
private Number parallelism;
7777

78+
@JsonProperty("podFailurePolicy")
79+
private PodFailurePolicy podFailurePolicy;
80+
7881
@JsonProperty("selector")
7982
private LabelSelector selector;
8083

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright 2020 Marc Nuri
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.marcnuri.yakc.model.io.k8s.api.batch.v1;
18+
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
import com.marcnuri.yakc.model.Model;
21+
import java.util.List;
22+
import lombok.AllArgsConstructor;
23+
import lombok.Builder;
24+
import lombok.Data;
25+
import lombok.NoArgsConstructor;
26+
import lombok.NonNull;
27+
import lombok.Singular;
28+
import lombok.ToString;
29+
30+
/**
31+
* PodFailurePolicy describes how failed pods influence the backoffLimit.
32+
*/
33+
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
34+
@Builder(toBuilder = true, builderClassName = "Builder")
35+
@AllArgsConstructor
36+
@NoArgsConstructor
37+
@Data
38+
@ToString
39+
public class PodFailurePolicy implements Model {
40+
41+
42+
/**
43+
* A list of pod failure policy rules. The rules are evaluated in order. Once a rule matches a Pod failure, the remaining of the rules are ignored. When no rule matches the Pod failure, the default handling applies - the counter of pod failures is incremented and it is checked against the backoffLimit. At most 20 elements are allowed.
44+
*/
45+
@NonNull
46+
@JsonProperty("rules")
47+
@Singular(value = "addToRules", ignoreNullCollections = true)
48+
private List<PodFailurePolicyRule> rules;
49+
50+
}
51+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* Copyright 2020 Marc Nuri
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.marcnuri.yakc.model.io.k8s.api.batch.v1;
18+
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
import com.marcnuri.yakc.model.Model;
21+
import java.util.List;
22+
import lombok.AllArgsConstructor;
23+
import lombok.Builder;
24+
import lombok.Data;
25+
import lombok.NoArgsConstructor;
26+
import lombok.NonNull;
27+
import lombok.Singular;
28+
import lombok.ToString;
29+
30+
/**
31+
* PodFailurePolicyOnExitCodesRequirement describes the requirement for handling a failed pod based on its container exit codes. In particular, it lookups the .state.terminated.exitCode for each app container and init container status, represented by the .status.containerStatuses and .status.initContainerStatuses fields in the Pod status, respectively. Containers completed with success (exit code 0) are excluded from the requirement check.
32+
*/
33+
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
34+
@Builder(toBuilder = true, builderClassName = "Builder")
35+
@AllArgsConstructor
36+
@NoArgsConstructor
37+
@Data
38+
@ToString
39+
public class PodFailurePolicyOnExitCodesRequirement implements Model {
40+
41+
42+
/**
43+
* Restricts the check for exit codes to the container with the specified name. When null, the rule applies to all containers. When specified, it should match one the container or initContainer names in the pod template.
44+
*/
45+
@JsonProperty("containerName")
46+
private String containerName;
47+
48+
/**
49+
* Represents the relationship between the container exit code(s) and the specified values. Containers completed with success (exit code 0) are excluded from the requirement check. Possible values are: - In: the requirement is satisfied if at least one container exit code<br><p> (might be multiple if there are multiple containers not restricted<br><p> by the 'containerName' field) is in the set of specified values.<br><p> - NotIn: the requirement is satisfied if at least one container exit code<br><p> (might be multiple if there are multiple containers not restricted<br><p> by the 'containerName' field) is not in the set of specified values.<br><p> Additional values are considered to be added in the future. Clients should react to an unknown operator by assuming the requirement is not satisfied.<br><p> <br><p>
50+
*/
51+
@NonNull
52+
@JsonProperty("operator")
53+
private String operator;
54+
55+
/**
56+
* Specifies the set of values. Each returned container exit code (might be multiple in case of multiple containers) is checked against this set of values with respect to the operator. The list of values must be ordered and must not contain duplicates. Value '0' cannot be used for the In operator. At least one element is required. At most 255 elements are allowed.
57+
*/
58+
@NonNull
59+
@JsonProperty("values")
60+
@Singular(value = "addToValues", ignoreNullCollections = true)
61+
private List<Number> values;
62+
63+
}
64+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Copyright 2020 Marc Nuri
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.marcnuri.yakc.model.io.k8s.api.batch.v1;
18+
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
import com.marcnuri.yakc.model.Model;
21+
import lombok.AllArgsConstructor;
22+
import lombok.Builder;
23+
import lombok.Data;
24+
import lombok.NoArgsConstructor;
25+
import lombok.NonNull;
26+
import lombok.ToString;
27+
28+
/**
29+
* PodFailurePolicyOnPodConditionsPattern describes a pattern for matching an actual pod condition type.
30+
*/
31+
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
32+
@Builder(toBuilder = true, builderClassName = "Builder")
33+
@AllArgsConstructor
34+
@NoArgsConstructor
35+
@Data
36+
@ToString
37+
public class PodFailurePolicyOnPodConditionsPattern implements Model {
38+
39+
40+
/**
41+
* Specifies the required Pod condition status. To match a pod condition it is required that the specified status equals the pod condition status. Defaults to True.
42+
*/
43+
@NonNull
44+
@JsonProperty("status")
45+
private String status;
46+
47+
/**
48+
* Specifies the required Pod condition type. To match a pod condition it is required that specified type equals the pod condition type.
49+
*/
50+
@NonNull
51+
@JsonProperty("type")
52+
private String type;
53+
54+
}
55+
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Copyright 2020 Marc Nuri
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.marcnuri.yakc.model.io.k8s.api.batch.v1;
18+
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
import com.marcnuri.yakc.model.Model;
21+
import java.util.List;
22+
import lombok.AllArgsConstructor;
23+
import lombok.Builder;
24+
import lombok.Data;
25+
import lombok.NoArgsConstructor;
26+
import lombok.NonNull;
27+
import lombok.Singular;
28+
import lombok.ToString;
29+
30+
/**
31+
* PodFailurePolicyRule describes how a pod failure is handled when the requirements are met. One of OnExitCodes and onPodConditions, but not both, can be used in each rule.
32+
*/
33+
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
34+
@Builder(toBuilder = true, builderClassName = "Builder")
35+
@AllArgsConstructor
36+
@NoArgsConstructor
37+
@Data
38+
@ToString
39+
public class PodFailurePolicyRule implements Model {
40+
41+
42+
/**
43+
* Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are: - FailJob: indicates that the pod's job is marked as Failed and all<br><p> running pods are terminated.<br><p> - Ignore: indicates that the counter towards the .backoffLimit is not<br><p> incremented and a replacement pod is created.<br><p> - Count: indicates that the pod is handled in the default way - the<br><p> counter towards the .backoffLimit is incremented.<br><p> Additional values are considered to be added in the future. Clients should react to an unknown action by skipping the rule.<br><p> <br><p>
44+
*/
45+
@NonNull
46+
@JsonProperty("action")
47+
private String action;
48+
49+
@JsonProperty("onExitCodes")
50+
private PodFailurePolicyOnExitCodesRequirement onExitCodes;
51+
52+
/**
53+
* Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. At most 20 elements are allowed.
54+
*/
55+
@NonNull
56+
@JsonProperty("onPodConditions")
57+
@Singular(value = "addToOnPodConditions", ignoreNullCollections = true)
58+
private List<PodFailurePolicyOnPodConditionsPattern> onPodConditions;
59+
60+
}
61+

kubernetes-model/src/model/java/com/marcnuri/yakc/model/io/k8s/api/core/v1/CSIPersistentVolumeSource.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ public class CSIPersistentVolumeSource implements Model {
5858
@JsonProperty("fsType")
5959
private String fsType;
6060

61+
@JsonProperty("nodeExpandSecretRef")
62+
private SecretReference nodeExpandSecretRef;
63+
6164
@JsonProperty("nodePublishSecretRef")
6265
private SecretReference nodePublishSecretRef;
6366

kubernetes-model/src/model/java/com/marcnuri/yakc/model/io/k8s/api/core/v1/Container.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public class Container implements Model {
9393
private String name;
9494

9595
/**
96-
* List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default "0.0.0.0" address inside a container will be accessible from the network. Cannot be updated.
96+
* List of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default "0.0.0.0" address inside a container will be accessible from the network. Modifying this array with strategic merge patch may corrupt the data. For more information See https://github.com/kubernetes/kubernetes/issues/108255. Cannot be updated.
9797
*/
9898
@JsonProperty("ports")
9999
@Singular(value = "addToPorts", ignoreNullCollections = true)

kubernetes-model/src/model/java/com/marcnuri/yakc/model/io/k8s/api/core/v1/ContainerImage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class ContainerImage implements Model {
3939

4040

4141
/**
42-
* Names by which this image is known. e.g. ["k8s.gcr.io/hyperkube:v1.0.7", "dockerhub.io/google_containers/hyperkube:v1.0.7"]
42+
* Names by which this image is known. e.g. ["kubernetes.example/hyperkube:v1.0.7", "cloud-vendor.registry.example/cloud-vendor/hyperkube:v1.0.7"]
4343
*/
4444
@JsonProperty("names")
4545
@Singular(value = "addToNames", ignoreNullCollections = true)

kubernetes-model/src/model/java/com/marcnuri/yakc/model/io/k8s/api/core/v1/EndpointSubset.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import lombok.ToString;
2828

2929
/**
30-
* EndpointSubset is a group of addresses with a common set of ports. The expanded set of endpoints is the Cartesian product of Addresses x Ports. For example, given:<br><p> {<br><p> Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}],<br><p> Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}]<br><p> }<br><p> The resulting set of endpoints can be viewed as:<br><p> a: [ 10.10.1.1:8675, 10.10.2.2:8675 ],<br><p> b: [ 10.10.1.1:309, 10.10.2.2:309 ]
30+
* EndpointSubset is a group of addresses with a common set of ports. The expanded set of endpoints is the Cartesian product of Addresses x Ports. For example, given:<br><p> <br><p> {<br><p> Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}],<br><p> Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}]<br><p> }<br><p> <br><p> The resulting set of endpoints can be viewed as:<br><p> <br><p> a: [ 10.10.1.1:8675, 10.10.2.2:8675 ],<br><p> b: [ 10.10.1.1:309, 10.10.2.2:309 ]
3131
*/
3232
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
3333
@Builder(toBuilder = true, builderClassName = "Builder")

0 commit comments

Comments
 (0)