Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schema: Added OpenAPI schema for 1.27.3 #76

Merged
merged 7 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Minikube-Kubernetes
uses: manusa/actions-setup-minikube@v2.7.2
with:
Expand All @@ -37,5 +39,5 @@ jobs:
if: success() && startsWith(matrix.kubernetes, 'v1.25')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew jacocoRootReport sonarqube -PskipPublishing
run: ./gradlew -Dorg.gradle.jvmargs=-Xmx512m jacocoRootReport sonar -PskipPublishing
-Dsonar.login=${{ secrets.SONARCLOUD_TOKEN }}
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.marcnuri.yakc.schema.model.ModelGeneratorTask
plugins {
id 'java-library'
id 'jacoco'
id 'org.sonarqube' version '3.4.0.2513'
id 'org.sonarqube' version '4.2.1.3168'
id 'org.kordamp.gradle.jandex' version '0.12.0'
}

Expand All @@ -22,7 +22,8 @@ def availableSchemaNames = Arrays.asList(
"kubernetes-1.23.10.json",
"kubernetes-1.24.4.json",
"kubernetes-1.25.6.json",
"kubernetes-1.26.1.json"
"kubernetes-1.26.6.json",
"kubernetes-1.27.3.json"
)
def availableSchemas = availableSchemaNames.stream()
.map { s -> new File(schemaDir, s) }
Expand Down Expand Up @@ -65,7 +66,7 @@ task jacocoRootReport(type: JacocoReport) {
}
}

sonarqube {
sonar {
properties {
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.projectKey", "manusa_yakc"
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

298 changes: 269 additions & 29 deletions kubernetes-api/src/api/java/com/marcnuri/yakc/api/apps/v1/AppsV1Api.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public interface AuthenticationV1Api extends Api {
method = "GET",
path = "/apis/authentication.k8s.io/v1/"
)
@Headers({
@Headers({
"Accept: */*"
})
KubernetesCall<APIResourceList> getAPIResources();
Expand All @@ -48,7 +48,7 @@ public interface AuthenticationV1Api extends Api {
path = "/apis/authentication.k8s.io/v1/tokenreviews",
hasBody = true
)
@Headers({
@Headers({
"Content-Type: application/json",
"Accept: */*"
})
Expand All @@ -63,16 +63,16 @@ KubernetesCall<TokenReview> createTokenReview(
path = "/apis/authentication.k8s.io/v1/tokenreviews",
hasBody = true
)
@Headers({
@Headers({
"Content-Type: application/json",
"Accept: */*"
})
KubernetesCall<TokenReview> createTokenReview(
@Body TokenReview body,
@Body TokenReview body,
@QueryMap CreateTokenReview queryParameters);

final class CreateTokenReview extends HashMap<String, Object> {

final class CreateTokenReview extends HashMap<String, Object> {
/**
* When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
*/
Expand All @@ -90,7 +90,7 @@ public CreateTokenReview fieldManager(String fieldManager) {
}

/**
* fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields, provided that the `ServerSideFieldValidation` feature gate is also enabled. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23 and is the default behavior when the `ServerSideFieldValidation` feature gate is disabled. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default when the `ServerSideFieldValidation` feature gate is enabled. - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.
* fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.
*/
public CreateTokenReview fieldValidation(String fieldValidation) {
put("fieldValidation", fieldValidation);
Expand All @@ -104,5 +104,5 @@ public CreateTokenReview pretty(String pretty) {
put("pretty", pretty);
return this;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public CreateSelfSubjectReview fieldManager(String fieldManager) {
}

/**
* fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields, provided that the `ServerSideFieldValidation` feature gate is also enabled. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23 and is the default behavior when the `ServerSideFieldValidation` feature gate is disabled. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default when the `ServerSideFieldValidation` feature gate is enabled. - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.
* fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.
*/
public CreateSelfSubjectReview fieldValidation(String fieldValidation) {
put("fieldValidation", fieldValidation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import com.marcnuri.yakc.api.Api;
import com.marcnuri.yakc.api.KubernetesCall;
import com.marcnuri.yakc.model.io.k8s.api.authentication.v1beta1.TokenReview;
import com.marcnuri.yakc.model.io.k8s.api.authentication.v1beta1.SelfSubjectReview;
import com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList;
import java.util.HashMap;
import retrofit2.http.Body;
Expand All @@ -41,58 +41,66 @@ public interface AuthenticationV1beta1Api extends Api {
KubernetesCall<APIResourceList> getAPIResources();

/**
* create a TokenReview
* create a SelfSubjectReview
*/
@HTTP(
method = "POST",
path = "/apis/authentication.k8s.io/v1beta1/tokenreviews",
path = "/apis/authentication.k8s.io/v1beta1/selfsubjectreviews",
hasBody = true
)
@Headers({
"Content-Type: application/json",
"Accept: */*"
})
KubernetesCall<TokenReview> createTokenReview(
@Body TokenReview body);
KubernetesCall<SelfSubjectReview> createSelfSubjectReview(
@Body SelfSubjectReview body);

/**
* create a TokenReview
* create a SelfSubjectReview
*/
@HTTP(
method = "POST",
path = "/apis/authentication.k8s.io/v1beta1/tokenreviews",
path = "/apis/authentication.k8s.io/v1beta1/selfsubjectreviews",
hasBody = true
)
@Headers({
"Content-Type: application/json",
"Accept: */*"
})
KubernetesCall<TokenReview> createTokenReview(
@Body TokenReview body,
@QueryMap CreateTokenReview queryParameters);
KubernetesCall<SelfSubjectReview> createSelfSubjectReview(
@Body SelfSubjectReview body,
@QueryMap CreateSelfSubjectReview queryParameters);


final class CreateTokenReview extends HashMap<String, Object> {
final class CreateSelfSubjectReview extends HashMap<String, Object> {
/**
* When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
*/
public CreateTokenReview dryRun(String dryRun) {
public CreateSelfSubjectReview dryRun(String dryRun) {
put("dryRun", dryRun);
return this;
}

/**
* fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.
*/
public CreateTokenReview fieldManager(String fieldManager) {
public CreateSelfSubjectReview fieldManager(String fieldManager) {
put("fieldManager", fieldManager);
return this;
}

/**
* fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.
*/
public CreateSelfSubjectReview fieldValidation(String fieldValidation) {
put("fieldValidation", fieldValidation);
return this;
}

/**
* If 'true', then the output is pretty printed.
*/
public CreateTokenReview pretty(String pretty) {
public CreateSelfSubjectReview pretty(String pretty) {
put("pretty", pretty);
return this;
}
Expand Down
Loading