Skip to content

Commit

Permalink
schema: Added OpenAPI schema for 1.25.0
Browse files Browse the repository at this point in the history
  • Loading branch information
manusa committed Sep 9, 2022
1 parent c148274 commit 981ad40
Show file tree
Hide file tree
Showing 39 changed files with 83,000 additions and 37 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
kubernetes: [v1.24.0,v1.12.0]
kubernetes: [v1.25.0,1.24.4,1.23.10,v1.12.0]
env:
K8S_VERSION: ${{ matrix.kubernetes }}
steps:
Expand All @@ -34,7 +34,7 @@ jobs:
if: success()
run: ./gradlew build -PskipPublishing
- name: Sonar Analysis
if: success() && startsWith(matrix.kubernetes, 'v1.24')
if: success() && startsWith(matrix.kubernetes, 'v1.25')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew jacocoRootReport sonarqube -PskipPublishing
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
uses: manusa/actions-setup-minikube@v2.7.0
with:
minikube version: v1.25.2
kubernetes version: v1.24.0
kubernetes version: v1.25.0
github token: ${{ secrets.GITHUB_TOKEN }}
start args: '--addons=metrics-server --force'
# --extra-config=apiserver.runtime-config=api/beta=true'
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Provides the basic interfaces and Exception types to be used across the differen

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

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

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

API methods for Kubernetes REST endpoints in versions ranging from 1.15 to 1.24.
API methods for Kubernetes REST endpoints in versions ranging from 1.15 to 1.25.

#### kubernetes-client
[![Maven Central](https://img.shields.io/maven-central/v/com.marcnuri.yakc/kubernetes-client)
Expand Down
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def availableSchemaNames = Arrays.asList(
"kubernetes-1.21.0.json",
"kubernetes-1.22.13.json",
"kubernetes-1.23.10.json",
"kubernetes-1.24.4.json"
"kubernetes-1.24.4.json",
"kubernetes-1.25.0.json"
)
def availableSchemas = availableSchemaNames.stream()
.map { s -> new File(schemaDir, s) }
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import lombok.ToString;

/**
* 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.
* 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.
*/
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
@Builder(toBuilder = true, builderClassName = "Builder")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class StatefulSetSpec implements Model {


/**
* 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.
* 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)
*/
@JsonProperty("minReadySeconds")
private Number minReadySeconds;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class StatefulSetStatus implements Model {


/**
* 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.
* Total number of available pods (ready for at least minReadySeconds) targeted by this statefulset.
*/
@JsonProperty("availableReplicas")
private Number availableReplicas;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class TokenRequestSpec implements Model {


/**
* 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.
* 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.
*/
@NonNull
@JsonProperty("audiences")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class CronJobSpec implements Model {
private Boolean suspend;

/**
* 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.
* 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.
*/
@JsonProperty("timeZone")
private String timeZone;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ public class JobSpec implements Model {
@JsonProperty("parallelism")
private Number parallelism;

@JsonProperty("podFailurePolicy")
private PodFailurePolicy podFailurePolicy;

@JsonProperty("selector")
private LabelSelector selector;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright 2020 Marc Nuri
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.marcnuri.yakc.model.io.k8s.api.batch.v1;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.marcnuri.yakc.model.Model;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.Singular;
import lombok.ToString;

/**
* PodFailurePolicy describes how failed pods influence the backoffLimit.
*/
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
@Builder(toBuilder = true, builderClassName = "Builder")
@AllArgsConstructor
@NoArgsConstructor
@Data
@ToString
public class PodFailurePolicy implements Model {


/**
* 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.
*/
@NonNull
@JsonProperty("rules")
@Singular(value = "addToRules", ignoreNullCollections = true)
private List<PodFailurePolicyRule> rules;

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright 2020 Marc Nuri
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.marcnuri.yakc.model.io.k8s.api.batch.v1;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.marcnuri.yakc.model.Model;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.Singular;
import lombok.ToString;

/**
* 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.
*/
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
@Builder(toBuilder = true, builderClassName = "Builder")
@AllArgsConstructor
@NoArgsConstructor
@Data
@ToString
public class PodFailurePolicyOnExitCodesRequirement implements Model {


/**
* 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.
*/
@JsonProperty("containerName")
private String containerName;

/**
* 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>
*/
@NonNull
@JsonProperty("operator")
private String operator;

/**
* 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.
*/
@NonNull
@JsonProperty("values")
@Singular(value = "addToValues", ignoreNullCollections = true)
private List<Number> values;

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright 2020 Marc Nuri
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.marcnuri.yakc.model.io.k8s.api.batch.v1;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.marcnuri.yakc.model.Model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.ToString;

/**
* PodFailurePolicyOnPodConditionsPattern describes a pattern for matching an actual pod condition type.
*/
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
@Builder(toBuilder = true, builderClassName = "Builder")
@AllArgsConstructor
@NoArgsConstructor
@Data
@ToString
public class PodFailurePolicyOnPodConditionsPattern implements Model {


/**
* 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.
*/
@NonNull
@JsonProperty("status")
private String status;

/**
* Specifies the required Pod condition type. To match a pod condition it is required that specified type equals the pod condition type.
*/
@NonNull
@JsonProperty("type")
private String type;

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Copyright 2020 Marc Nuri
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.marcnuri.yakc.model.io.k8s.api.batch.v1;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.marcnuri.yakc.model.Model;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.Singular;
import lombok.ToString;

/**
* 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.
*/
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
@Builder(toBuilder = true, builderClassName = "Builder")
@AllArgsConstructor
@NoArgsConstructor
@Data
@ToString
public class PodFailurePolicyRule implements Model {


/**
* 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>
*/
@NonNull
@JsonProperty("action")
private String action;

@JsonProperty("onExitCodes")
private PodFailurePolicyOnExitCodesRequirement onExitCodes;

/**
* 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.
*/
@NonNull
@JsonProperty("onPodConditions")
@Singular(value = "addToOnPodConditions", ignoreNullCollections = true)
private List<PodFailurePolicyOnPodConditionsPattern> onPodConditions;

}

Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ public class CSIPersistentVolumeSource implements Model {
@JsonProperty("fsType")
private String fsType;

@JsonProperty("nodeExpandSecretRef")
private SecretReference nodeExpandSecretRef;

@JsonProperty("nodePublishSecretRef")
private SecretReference nodePublishSecretRef;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public class Container implements Model {
private String name;

/**
* 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.
* 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.
*/
@JsonProperty("ports")
@Singular(value = "addToPorts", ignoreNullCollections = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class ContainerImage implements Model {


/**
* Names by which this image is known. e.g. ["k8s.gcr.io/hyperkube:v1.0.7", "dockerhub.io/google_containers/hyperkube:v1.0.7"]
* 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"]
*/
@JsonProperty("names")
@Singular(value = "addToNames", ignoreNullCollections = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import lombok.ToString;

/**
* 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 ]
* 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 ]
*/
@SuppressWarnings({"squid:S1192", "WeakerAccess", "unused"})
@Builder(toBuilder = true, builderClassName = "Builder")
Expand Down
Loading

0 comments on commit 981ad40

Please sign in to comment.