diff --git a/CHANGELOG.md b/CHANGELOG.md index eae632823c8..2d89fb0db31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ #### Dependency Upgrade #### New Features +* Added DSL support for `admissionregistration.k8s.io/v1beta1` resources * Add support for Namespaced SharedInformers, fixed probelms with OperationContext argument ### 4.10.1 (2020-05-06) diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AdmissionRegistrationAPIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AdmissionRegistrationAPIGroupClient.java new file mode 100644 index 00000000000..8f5e1c3705b --- /dev/null +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AdmissionRegistrationAPIGroupClient.java @@ -0,0 +1,38 @@ +/** + * Copyright (C) 2015 Red Hat, Inc. + * + * 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 io.fabric8.kubernetes.client; + +import okhttp3.OkHttpClient; + +public class AdmissionRegistrationAPIGroupClient extends BaseClient implements AdmissionRegistrationAPIGroupDSL { + public AdmissionRegistrationAPIGroupClient() { + super(); + } + + public AdmissionRegistrationAPIGroupClient(OkHttpClient httpClient, final Config config) { + super(httpClient, config); + } + + @Override + public V1AdmissionRegistrationAPIGroupDSL v1() { + return adapt(V1AdmissionRegistrationAPIGroupClient.class); + } + + @Override + public V1beta1AdmissionRegistrationAPIGroupDSL v1beta1() { + return adapt(V1beta1AdmissionRegistrationAPIGroupClient.class); + } +} diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AdmissionRegistrationAPIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AdmissionRegistrationAPIGroupDSL.java new file mode 100644 index 00000000000..b32586e316f --- /dev/null +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AdmissionRegistrationAPIGroupDSL.java @@ -0,0 +1,21 @@ +/** + * Copyright (C) 2015 Red Hat, Inc. + * + * 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 io.fabric8.kubernetes.client; + +public interface AdmissionRegistrationAPIGroupDSL extends Client { + V1AdmissionRegistrationAPIGroupDSL v1(); + V1beta1AdmissionRegistrationAPIGroupDSL v1beta1(); +} diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AdmissionRegistrationAPIGroupExtensionAdapter.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AdmissionRegistrationAPIGroupExtensionAdapter.java new file mode 100644 index 00000000000..048ae32208c --- /dev/null +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AdmissionRegistrationAPIGroupExtensionAdapter.java @@ -0,0 +1,35 @@ +/** + * Copyright (C) 2015 Red Hat, Inc. + * + * 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 io.fabric8.kubernetes.client; + +import okhttp3.OkHttpClient; + +public class AdmissionRegistrationAPIGroupExtensionAdapter extends APIGroupExtensionAdapter { + @Override + protected String getAPIGroupName() { + return "admissionregistration.k8s.io"; + } + + @Override + public Class getExtensionType() { + return AdmissionRegistrationAPIGroupClient.class; + } + + @Override + protected AdmissionRegistrationAPIGroupClient newInstance(Client client) { + return new AdmissionRegistrationAPIGroupClient(client.adapt(OkHttpClient.class), client.getConfiguration()); + } +} diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AutoAdaptableKubernetesClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AutoAdaptableKubernetesClient.java index 13bc958eae3..a492ffe3381 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AutoAdaptableKubernetesClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AutoAdaptableKubernetesClient.java @@ -121,6 +121,11 @@ public VersionInfo getVersion() { return delegate.getVersion(); } + @Override + public AdmissionRegistrationAPIGroupDSL admissionRegistration() { + return delegate.admissionRegistration(); + } + @Override public AppsAPIGroupDSL apps() { return delegate.apps(); diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/DefaultKubernetesClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/DefaultKubernetesClient.java index f35480d82b6..48a41a88254 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/DefaultKubernetesClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/DefaultKubernetesClient.java @@ -341,6 +341,11 @@ public V1APIGroupDSL v1() { return adapt(V1APIGroupClient.class); } + @Override + public AdmissionRegistrationAPIGroupDSL admissionRegistration() { + return adapt(AdmissionRegistrationAPIGroupClient.class); + } + @Override public AppsAPIGroupDSL apps() { return adapt(AppsAPIGroupClient.class); diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/KubernetesClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/KubernetesClient.java index d1c96df30a8..a1b513f5902 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/KubernetesClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/KubernetesClient.java @@ -172,6 +172,13 @@ public interface KubernetesClient extends Client { */ RawCustomResourceOperationsImpl customResource(CustomResourceDefinitionContext customResourceDefinition); + /** + * API entrypoint for kubernetes resources with APIGroup admissionregistration.k8s.io/v1beta1 + * + * @return AdmissionRegistrationAPIGroupDSL which offers entrypoints to specific resources in this API group + */ + AdmissionRegistrationAPIGroupDSL admissionRegistration(); + /** * API entrypoint for kubernetes resources with APIGroup apps/v1 * diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AdmissionRegistrationAPIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AdmissionRegistrationAPIGroupClient.java new file mode 100644 index 00000000000..dbe4b2db1c9 --- /dev/null +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AdmissionRegistrationAPIGroupClient.java @@ -0,0 +1,48 @@ +/** + * Copyright (C) 2015 Red Hat, Inc. + * + * 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 io.fabric8.kubernetes.client; + +import io.fabric8.kubernetes.api.model.admissionregistration.v1.DoneableMutatingWebhookConfiguration; +import io.fabric8.kubernetes.api.model.admissionregistration.v1.DoneableValidatingWebhookConfiguration; +import io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfiguration; +import io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfigurationList; +import io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfiguration; +import io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfigurationList; +import io.fabric8.kubernetes.client.dsl.MixedOperation; +import io.fabric8.kubernetes.client.dsl.Resource; +import io.fabric8.kubernetes.client.dsl.internal.admissionregistration.v1.ValidatingWebhookConfigurationOperationsImpl; +import io.fabric8.kubernetes.client.dsl.internal.admissionregistration.v1.MutatingWebhookConfigurationOperationsImpl; +import okhttp3.OkHttpClient; + +public class V1AdmissionRegistrationAPIGroupClient extends BaseClient implements V1AdmissionRegistrationAPIGroupDSL { + public V1AdmissionRegistrationAPIGroupClient() { + super(); + } + + public V1AdmissionRegistrationAPIGroupClient(OkHttpClient httpClient, final Config config) { + super(httpClient, config); + } + + @Override + public MixedOperation> validatingWebhookConfigurations() { + return new ValidatingWebhookConfigurationOperationsImpl(httpClient, getConfiguration()); + } + + @Override + public MixedOperation> mutatingWebhookConfigurations() { + return new MutatingWebhookConfigurationOperationsImpl(httpClient, getConfiguration()); + } +} diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AdmissionRegistrationAPIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AdmissionRegistrationAPIGroupDSL.java new file mode 100644 index 00000000000..54ebdf1424c --- /dev/null +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AdmissionRegistrationAPIGroupDSL.java @@ -0,0 +1,30 @@ +/** + * Copyright (C) 2015 Red Hat, Inc. + * + * 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 io.fabric8.kubernetes.client; + +import io.fabric8.kubernetes.api.model.admissionregistration.v1.DoneableMutatingWebhookConfiguration; +import io.fabric8.kubernetes.api.model.admissionregistration.v1.DoneableValidatingWebhookConfiguration; +import io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfiguration; +import io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfigurationList; +import io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfiguration; +import io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfigurationList; +import io.fabric8.kubernetes.client.dsl.MixedOperation; +import io.fabric8.kubernetes.client.dsl.Resource; + +public interface V1AdmissionRegistrationAPIGroupDSL extends Client { + MixedOperation> validatingWebhookConfigurations(); + MixedOperation> mutatingWebhookConfigurations(); +} diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AdmissionRegistrationAPIGroupExtensionAdapter.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AdmissionRegistrationAPIGroupExtensionAdapter.java new file mode 100644 index 00000000000..25b1c4c21c5 --- /dev/null +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1AdmissionRegistrationAPIGroupExtensionAdapter.java @@ -0,0 +1,35 @@ +/** + * Copyright (C) 2015 Red Hat, Inc. + * + * 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 io.fabric8.kubernetes.client; + +import okhttp3.OkHttpClient; + +public class V1AdmissionRegistrationAPIGroupExtensionAdapter extends APIGroupExtensionAdapter { + @Override + protected String getAPIGroupName() { + return "admissionregistration/v1"; + } + + @Override + public Class getExtensionType() { + return V1AdmissionRegistrationAPIGroupClient.class; + } + + @Override + protected V1AdmissionRegistrationAPIGroupClient newInstance(Client client) { + return new V1AdmissionRegistrationAPIGroupClient(client.adapt(OkHttpClient.class), client.getConfiguration()); + } +} diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AdmissionRegistrationAPIGroupClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AdmissionRegistrationAPIGroupClient.java new file mode 100644 index 00000000000..b669710eecc --- /dev/null +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AdmissionRegistrationAPIGroupClient.java @@ -0,0 +1,48 @@ +/** + * Copyright (C) 2015 Red Hat, Inc. + * + * 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 io.fabric8.kubernetes.client; + +import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.DoneableMutatingWebhookConfiguration; +import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.DoneableValidatingWebhookConfiguration; +import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfiguration; +import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfigurationList; +import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhookConfiguration; +import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhookConfigurationList; +import io.fabric8.kubernetes.client.dsl.MixedOperation; +import io.fabric8.kubernetes.client.dsl.Resource; +import io.fabric8.kubernetes.client.dsl.internal.admissionregistration.v1beta1.MutatingWebhookConfigurationOperationsImpl; +import io.fabric8.kubernetes.client.dsl.internal.admissionregistration.v1beta1.ValidatingWebhookConfigurationOperationsImpl; +import okhttp3.OkHttpClient; + +public class V1beta1AdmissionRegistrationAPIGroupClient extends BaseClient implements V1beta1AdmissionRegistrationAPIGroupDSL { + public V1beta1AdmissionRegistrationAPIGroupClient() { + super(); + } + + public V1beta1AdmissionRegistrationAPIGroupClient(OkHttpClient httpClient, final Config config) { + super(httpClient, config); + } + + @Override + public MixedOperation> validatingWebhookConfigurations() { + return new ValidatingWebhookConfigurationOperationsImpl(httpClient, getConfiguration()); + } + + @Override + public MixedOperation> mutatingWebhookConfigurations() { + return new MutatingWebhookConfigurationOperationsImpl(httpClient, getConfiguration()); + } +} diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AdmissionRegistrationAPIGroupDSL.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AdmissionRegistrationAPIGroupDSL.java new file mode 100644 index 00000000000..9d6d94d1c75 --- /dev/null +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AdmissionRegistrationAPIGroupDSL.java @@ -0,0 +1,30 @@ +/** + * Copyright (C) 2015 Red Hat, Inc. + * + * 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 io.fabric8.kubernetes.client; + +import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.DoneableMutatingWebhookConfiguration; +import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.DoneableValidatingWebhookConfiguration; +import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfiguration; +import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfigurationList; +import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhookConfiguration; +import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhookConfigurationList; +import io.fabric8.kubernetes.client.dsl.MixedOperation; +import io.fabric8.kubernetes.client.dsl.Resource; + +public interface V1beta1AdmissionRegistrationAPIGroupDSL extends Client { + MixedOperation> validatingWebhookConfigurations(); + MixedOperation> mutatingWebhookConfigurations(); +} diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AdmissionRegistrationAPIGroupExtensionAdapter.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AdmissionRegistrationAPIGroupExtensionAdapter.java new file mode 100644 index 00000000000..d8ece040cb2 --- /dev/null +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/V1beta1AdmissionRegistrationAPIGroupExtensionAdapter.java @@ -0,0 +1,35 @@ +/** + * Copyright (C) 2015 Red Hat, Inc. + * + * 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 io.fabric8.kubernetes.client; + +import okhttp3.OkHttpClient; + +public class V1beta1AdmissionRegistrationAPIGroupExtensionAdapter extends APIGroupExtensionAdapter { + @Override + protected String getAPIGroupName() { + return "admissionregistration/v1beta1"; + } + + @Override + public Class getExtensionType() { + return V1beta1AdmissionRegistrationAPIGroupClient.class; + } + + @Override + protected V1beta1AdmissionRegistrationAPIGroupClient newInstance(Client client) { + return new V1beta1AdmissionRegistrationAPIGroupClient(client.adapt(OkHttpClient.class), client.getConfiguration()); + } +} diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/osgi/ManagedKubernetesClient.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/osgi/ManagedKubernetesClient.java index b946a5a8378..8213247bcfd 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/osgi/ManagedKubernetesClient.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/osgi/ManagedKubernetesClient.java @@ -73,6 +73,7 @@ import io.fabric8.kubernetes.api.model.coordination.v1.Lease; import io.fabric8.kubernetes.api.model.coordination.v1.LeaseList; import io.fabric8.kubernetes.client.Adapters; +import io.fabric8.kubernetes.client.AdmissionRegistrationAPIGroupDSL; import io.fabric8.kubernetes.client.Config; import io.fabric8.kubernetes.client.ConfigBuilder; import io.fabric8.kubernetes.client.KubernetesClient; @@ -371,6 +372,11 @@ public V1APIGroupDSL v1() { return delegate.v1(); } + @Override + public AdmissionRegistrationAPIGroupDSL admissionRegistration() { + return delegate.admissionRegistration(); + } + @Override public AppsAPIGroupDSL apps() { return delegate.apps(); diff --git a/kubernetes-client/src/main/resources/META-INF/services/io.fabric8.kubernetes.client.ExtensionAdapter b/kubernetes-client/src/main/resources/META-INF/services/io.fabric8.kubernetes.client.ExtensionAdapter index 65c12c931df..87b9eeb3ca7 100644 --- a/kubernetes-client/src/main/resources/META-INF/services/io.fabric8.kubernetes.client.ExtensionAdapter +++ b/kubernetes-client/src/main/resources/META-INF/services/io.fabric8.kubernetes.client.ExtensionAdapter @@ -15,6 +15,9 @@ # io.fabric8.kubernetes.client.AppsAPIGroupExtensionAdapter +io.fabric8.kubernetes.client.AdmissionRegistrationAPIGroupExtensionAdapter +io.fabric8.kubernetes.client.V1AdmissionRegistrationAPIGroupExtensionAdapter +io.fabric8.kubernetes.client.V1beta1AdmissionRegistrationAPIGroupExtensionAdapter io.fabric8.kubernetes.client.AutoscalingAPIGroupExtensionAdapter io.fabric8.kubernetes.client.V1AutoscalingAPIGroupExtensionAdapter io.fabric8.kubernetes.client.V2beta1AutoscalingAPIGroupExtensionAdapter diff --git a/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/internal/UtilsTest.java b/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/internal/UtilsTest.java index cdcb64d0358..6cc12c1eaa3 100644 --- a/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/internal/UtilsTest.java +++ b/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/internal/UtilsTest.java @@ -33,8 +33,8 @@ import io.fabric8.kubernetes.api.model.Secret; import io.fabric8.kubernetes.api.model.Service; import io.fabric8.kubernetes.api.model.ServiceAccount; -import io.fabric8.kubernetes.api.model.admissionregistration.MutatingWebhookConfiguration; -import io.fabric8.kubernetes.api.model.admissionregistration.ValidatingWebhookConfiguration; +import io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfiguration; +import io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfiguration; import io.fabric8.kubernetes.api.model.apiextensions.CustomResourceDefinition; import io.fabric8.kubernetes.api.model.apps.ControllerRevision; import io.fabric8.kubernetes.api.model.apps.DaemonSet; diff --git a/kubernetes-model/kubernetes-model-admissionregistration/cmd/generate/generate.go b/kubernetes-model/kubernetes-model-admissionregistration/cmd/generate/generate.go index 70c1436601c..e60b71ad977 100644 --- a/kubernetes-model/kubernetes-model-admissionregistration/cmd/generate/generate.go +++ b/kubernetes-model/kubernetes-model-admissionregistration/cmd/generate/generate.go @@ -26,6 +26,7 @@ import ( authenticationapi "k8s.io/api/authentication/v1" admission "k8s.io/api/admission/v1beta1" + admissionregistrationv1 "k8s.io/api/admissionregistration/v1" admissionregistration "k8s.io/api/admissionregistration/v1beta1" k8sauthapi "k8s.io/api/authorization/v1" @@ -72,6 +73,13 @@ type Schema struct { MutatingWebhookConfigurationList admissionregistration.MutatingWebhookConfigurationList RuleWithOperations admissionregistration.RuleWithOperations ServiceReference admissionregistration.ServiceReference + V1Rule admissionregistrationv1.Rule + V1ValidatingWebhookConfiguration admissionregistrationv1.ValidatingWebhookConfiguration + V1ValidatingWebhookConfigurationList admissionregistrationv1.ValidatingWebhookConfigurationList + V1MutatingWebhookConfiguration admissionregistrationv1.MutatingWebhookConfiguration + V1MutatingWebhookConfigurationList admissionregistrationv1.MutatingWebhookConfigurationList + V1RuleWithOperations admissionregistrationv1.RuleWithOperations + V1ServiceReference admissionregistrationv1.ServiceReference K8sSubjectAccessReview k8sauthapi.SubjectAccessReview K8sLocalSubjectAccessReview k8sauthapi.LocalSubjectAccessReview SelfSubjectRulesReview k8sauthapi.SelfSubjectRulesReview @@ -86,7 +94,8 @@ func main() { } packages := []schemagen.PackageDescriptor{ {"k8s.io/api/admission/v1beta1", "admission.k8s.io", "io.fabric8.kubernetes.api.model.admission", "kubernetes_admission_"}, - {"k8s.io/api/admissionregistration/v1beta1", "admissionregistration.k8s.io", "io.fabric8.kubernetes.api.model.admissionregistration", "kubernetes_admissionregistration_"}, + {"k8s.io/api/admissionregistration/v1beta1", "admissionregistration.k8s.io", "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1", "kubernetes_admissionregistration_v1beta1_"}, + {"k8s.io/api/admissionregistration/v1", "admissionregistration.k8s.io", "io.fabric8.kubernetes.api.model.admissionregistration.v1", "kubernetes_admissionregistration_v1_"}, {"k8s.io/api/authentication/v1", "authentication.k8s.io", "io.fabric8.kubernetes.api.model.authentication", "kubernetes_authentication_"}, {"k8s.io/apimachinery/pkg/util/intstr", "", "io.fabric8.kubernetes.api.model", "kubernetes_apimachinery_pkg_util_intstr_"}, {"k8s.io/apimachinery/pkg/runtime", "", "io.fabric8.kubernetes.api.model.runtime", "kubernetes_apimachinery_pkg_runtime_"}, diff --git a/kubernetes-model/kubernetes-model-admissionregistration/src/main/resources/schema/kube-schema.json b/kubernetes-model/kubernetes-model-admissionregistration/src/main/resources/schema/kube-schema.json index 070856bf3bc..4fd0e075c25 100644 --- a/kubernetes-model/kubernetes-model-admissionregistration/src/main/resources/schema/kube-schema.json +++ b/kubernetes-model/kubernetes-model-admissionregistration/src/main/resources/schema/kube-schema.json @@ -160,7 +160,418 @@ "io.fabric8.kubernetes.api.model.KubernetesResource" ] }, - "kubernetes_admissionregistration_MutatingWebhook": { + "kubernetes_admissionregistration_v1_MutatingWebhook": { + "type": "object", + "description": "", + "properties": { + "admissionReviewVersions": { + "type": "array", + "description": "", + "items": { + "type": "string", + "description": "" + } + }, + "clientConfig": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_WebhookClientConfig", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.WebhookClientConfig" + }, + "failurePolicy": { + "type": "string", + "description": "" + }, + "matchPolicy": { + "type": "string", + "description": "" + }, + "name": { + "type": "string", + "description": "" + }, + "namespaceSelector": { + "$ref": "#/definitions/kubernetes_apimachinery_LabelSelector", + "javaType": "io.fabric8.kubernetes.api.model.LabelSelector" + }, + "objectSelector": { + "$ref": "#/definitions/kubernetes_apimachinery_LabelSelector", + "javaType": "io.fabric8.kubernetes.api.model.LabelSelector" + }, + "reinvocationPolicy": { + "type": "string", + "description": "" + }, + "rules": { + "type": "array", + "description": "", + "javaOmitEmpty": true, + "items": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_RuleWithOperations", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.RuleWithOperations" + } + }, + "sideEffects": { + "type": "string", + "description": "" + }, + "timeoutSeconds": { + "type": "integer", + "description": "" + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhook", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.KubernetesResource" + ] + }, + "kubernetes_admissionregistration_v1_MutatingWebhookConfiguration": { + "type": "object", + "description": "", + "properties": { + "apiVersion": { + "type": "string", + "description": "", + "default": "admissionregistration.k8s.io/v1", + "required": true + }, + "kind": { + "type": "string", + "description": "", + "default": "MutatingWebhookConfiguration", + "required": true + }, + "metadata": { + "$ref": "#/definitions/kubernetes_apimachinery_ObjectMeta", + "javaType": "io.fabric8.kubernetes.api.model.ObjectMeta" + }, + "webhooks": { + "type": "array", + "description": "", + "javaOmitEmpty": true, + "items": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_MutatingWebhook", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhook" + } + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfiguration", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.HasMetadata" + ] + }, + "kubernetes_admissionregistration_v1_MutatingWebhookConfigurationList": { + "type": "object", + "description": "", + "properties": { + "apiVersion": { + "type": "string", + "description": "", + "default": "admissionregistration.k8s.io/v1", + "required": true + }, + "items": { + "type": "array", + "description": "", + "items": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_MutatingWebhookConfiguration", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfiguration" + } + }, + "kind": { + "type": "string", + "description": "", + "default": "MutatingWebhookConfigurationList", + "required": true + }, + "metadata": { + "$ref": "#/definitions/kubernetes_apimachinery_ListMeta", + "javaType": "io.fabric8.kubernetes.api.model.ListMeta" + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfigurationList", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.KubernetesResource", + "io.fabric8.kubernetes.api.model.KubernetesResourceList\u003cio.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfiguration\u003e" + ] + }, + "kubernetes_admissionregistration_v1_Rule": { + "type": "object", + "description": "", + "properties": { + "apiGroups": { + "type": "array", + "description": "", + "javaOmitEmpty": true, + "items": { + "type": "string", + "description": "" + } + }, + "apiVersions": { + "type": "array", + "description": "", + "javaOmitEmpty": true, + "items": { + "type": "string", + "description": "" + } + }, + "resources": { + "type": "array", + "description": "", + "javaOmitEmpty": true, + "items": { + "type": "string", + "description": "" + } + }, + "scope": { + "type": "string", + "description": "" + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.Rule", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.KubernetesResource" + ] + }, + "kubernetes_admissionregistration_v1_RuleWithOperations": { + "type": "object", + "description": "", + "properties": { + "apiGroups": { + "type": "array", + "description": "", + "javaOmitEmpty": true, + "items": { + "type": "string", + "description": "" + } + }, + "apiVersions": { + "type": "array", + "description": "", + "javaOmitEmpty": true, + "items": { + "type": "string", + "description": "" + } + }, + "operations": { + "type": "array", + "description": "", + "javaOmitEmpty": true, + "items": { + "type": "string", + "description": "" + } + }, + "resources": { + "type": "array", + "description": "", + "javaOmitEmpty": true, + "items": { + "type": "string", + "description": "" + } + }, + "scope": { + "type": "string", + "description": "" + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.RuleWithOperations", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.KubernetesResource" + ] + }, + "kubernetes_admissionregistration_v1_ServiceReference": { + "type": "object", + "description": "", + "properties": { + "name": { + "type": "string", + "description": "" + }, + "namespace": { + "type": "string", + "description": "" + }, + "path": { + "type": "string", + "description": "" + }, + "port": { + "type": "integer", + "description": "" + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.ServiceReference", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.KubernetesResource" + ] + }, + "kubernetes_admissionregistration_v1_ValidatingWebhook": { + "type": "object", + "description": "", + "properties": { + "admissionReviewVersions": { + "type": "array", + "description": "", + "items": { + "type": "string", + "description": "" + } + }, + "clientConfig": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_WebhookClientConfig", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.WebhookClientConfig" + }, + "failurePolicy": { + "type": "string", + "description": "" + }, + "matchPolicy": { + "type": "string", + "description": "" + }, + "name": { + "type": "string", + "description": "" + }, + "namespaceSelector": { + "$ref": "#/definitions/kubernetes_apimachinery_LabelSelector", + "javaType": "io.fabric8.kubernetes.api.model.LabelSelector" + }, + "objectSelector": { + "$ref": "#/definitions/kubernetes_apimachinery_LabelSelector", + "javaType": "io.fabric8.kubernetes.api.model.LabelSelector" + }, + "rules": { + "type": "array", + "description": "", + "javaOmitEmpty": true, + "items": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_RuleWithOperations", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.RuleWithOperations" + } + }, + "sideEffects": { + "type": "string", + "description": "" + }, + "timeoutSeconds": { + "type": "integer", + "description": "" + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhook", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.KubernetesResource" + ] + }, + "kubernetes_admissionregistration_v1_ValidatingWebhookConfiguration": { + "type": "object", + "description": "", + "properties": { + "apiVersion": { + "type": "string", + "description": "", + "default": "admissionregistration.k8s.io/v1", + "required": true + }, + "kind": { + "type": "string", + "description": "", + "default": "ValidatingWebhookConfiguration", + "required": true + }, + "metadata": { + "$ref": "#/definitions/kubernetes_apimachinery_ObjectMeta", + "javaType": "io.fabric8.kubernetes.api.model.ObjectMeta" + }, + "webhooks": { + "type": "array", + "description": "", + "javaOmitEmpty": true, + "items": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_ValidatingWebhook", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhook" + } + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfiguration", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.HasMetadata" + ] + }, + "kubernetes_admissionregistration_v1_ValidatingWebhookConfigurationList": { + "type": "object", + "description": "", + "properties": { + "apiVersion": { + "type": "string", + "description": "", + "default": "admissionregistration.k8s.io/v1", + "required": true + }, + "items": { + "type": "array", + "description": "", + "items": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_ValidatingWebhookConfiguration", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfiguration" + } + }, + "kind": { + "type": "string", + "description": "", + "default": "ValidatingWebhookConfigurationList", + "required": true + }, + "metadata": { + "$ref": "#/definitions/kubernetes_apimachinery_ListMeta", + "javaType": "io.fabric8.kubernetes.api.model.ListMeta" + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfigurationList", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.KubernetesResource", + "io.fabric8.kubernetes.api.model.KubernetesResourceList\u003cio.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfiguration\u003e" + ] + }, + "kubernetes_admissionregistration_v1_WebhookClientConfig": { + "type": "object", + "description": "", + "properties": { + "caBundle": { + "type": "string", + "description": "" + }, + "service": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_ServiceReference", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.ServiceReference" + }, + "url": { + "type": "string", + "description": "" + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.WebhookClientConfig", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.KubernetesResource" + ] + }, + "kubernetes_admissionregistration_v1beta1_MutatingWebhook": { "type": "object", "description": "", "properties": { @@ -174,8 +585,8 @@ } }, "clientConfig": { - "$ref": "#/definitions/kubernetes_admissionregistration_WebhookClientConfig", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.WebhookClientConfig" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_WebhookClientConfig", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.WebhookClientConfig" }, "failurePolicy": { "type": "string", @@ -206,8 +617,8 @@ "description": "", "javaOmitEmpty": true, "items": { - "$ref": "#/definitions/kubernetes_admissionregistration_RuleWithOperations", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.RuleWithOperations" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_RuleWithOperations", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.RuleWithOperations" } }, "sideEffects": { @@ -220,12 +631,12 @@ } }, "additionalProperties": true, - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.MutatingWebhook", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhook", "javaInterfaces": [ "io.fabric8.kubernetes.api.model.KubernetesResource" ] }, - "kubernetes_admissionregistration_MutatingWebhookConfiguration": { + "kubernetes_admissionregistration_v1beta1_MutatingWebhookConfiguration": { "type": "object", "description": "", "properties": { @@ -250,18 +661,18 @@ "description": "", "javaOmitEmpty": true, "items": { - "$ref": "#/definitions/kubernetes_admissionregistration_MutatingWebhook", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.MutatingWebhook" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_MutatingWebhook", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhook" } } }, "additionalProperties": true, - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.MutatingWebhookConfiguration", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfiguration", "javaInterfaces": [ "io.fabric8.kubernetes.api.model.HasMetadata" ] }, - "kubernetes_admissionregistration_MutatingWebhookConfigurationList": { + "kubernetes_admissionregistration_v1beta1_MutatingWebhookConfigurationList": { "type": "object", "description": "", "properties": { @@ -275,8 +686,8 @@ "type": "array", "description": "", "items": { - "$ref": "#/definitions/kubernetes_admissionregistration_MutatingWebhookConfiguration", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.MutatingWebhookConfiguration" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_MutatingWebhookConfiguration", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfiguration" } }, "kind": { @@ -291,13 +702,13 @@ } }, "additionalProperties": true, - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.MutatingWebhookConfigurationList", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfigurationList", "javaInterfaces": [ "io.fabric8.kubernetes.api.model.KubernetesResource", - "io.fabric8.kubernetes.api.model.KubernetesResourceList\u003cio.fabric8.kubernetes.api.model.admissionregistration.MutatingWebhookConfiguration\u003e" + "io.fabric8.kubernetes.api.model.KubernetesResourceList\u003cio.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfiguration\u003e" ] }, - "kubernetes_admissionregistration_Rule": { + "kubernetes_admissionregistration_v1beta1_Rule": { "type": "object", "description": "", "properties": { @@ -334,12 +745,12 @@ } }, "additionalProperties": true, - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.Rule", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.Rule", "javaInterfaces": [ "io.fabric8.kubernetes.api.model.KubernetesResource" ] }, - "kubernetes_admissionregistration_RuleWithOperations": { + "kubernetes_admissionregistration_v1beta1_RuleWithOperations": { "type": "object", "description": "", "properties": { @@ -385,12 +796,12 @@ } }, "additionalProperties": true, - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.RuleWithOperations", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.RuleWithOperations", "javaInterfaces": [ "io.fabric8.kubernetes.api.model.KubernetesResource" ] }, - "kubernetes_admissionregistration_ServiceReference": { + "kubernetes_admissionregistration_v1beta1_ServiceReference": { "type": "object", "description": "", "properties": { @@ -412,12 +823,12 @@ } }, "additionalProperties": true, - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.ServiceReference", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ServiceReference", "javaInterfaces": [ "io.fabric8.kubernetes.api.model.KubernetesResource" ] }, - "kubernetes_admissionregistration_ValidatingWebhook": { + "kubernetes_admissionregistration_v1beta1_ValidatingWebhook": { "type": "object", "description": "", "properties": { @@ -431,8 +842,8 @@ } }, "clientConfig": { - "$ref": "#/definitions/kubernetes_admissionregistration_WebhookClientConfig", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.WebhookClientConfig" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_WebhookClientConfig", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.WebhookClientConfig" }, "failurePolicy": { "type": "string", @@ -459,8 +870,8 @@ "description": "", "javaOmitEmpty": true, "items": { - "$ref": "#/definitions/kubernetes_admissionregistration_RuleWithOperations", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.RuleWithOperations" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_RuleWithOperations", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.RuleWithOperations" } }, "sideEffects": { @@ -473,12 +884,12 @@ } }, "additionalProperties": true, - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.ValidatingWebhook", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhook", "javaInterfaces": [ "io.fabric8.kubernetes.api.model.KubernetesResource" ] }, - "kubernetes_admissionregistration_ValidatingWebhookConfiguration": { + "kubernetes_admissionregistration_v1beta1_ValidatingWebhookConfiguration": { "type": "object", "description": "", "properties": { @@ -503,18 +914,18 @@ "description": "", "javaOmitEmpty": true, "items": { - "$ref": "#/definitions/kubernetes_admissionregistration_ValidatingWebhook", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.ValidatingWebhook" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_ValidatingWebhook", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhook" } } }, "additionalProperties": true, - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.ValidatingWebhookConfiguration", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhookConfiguration", "javaInterfaces": [ "io.fabric8.kubernetes.api.model.HasMetadata" ] }, - "kubernetes_admissionregistration_ValidatingWebhookConfigurationList": { + "kubernetes_admissionregistration_v1beta1_ValidatingWebhookConfigurationList": { "type": "object", "description": "", "properties": { @@ -528,8 +939,8 @@ "type": "array", "description": "", "items": { - "$ref": "#/definitions/kubernetes_admissionregistration_ValidatingWebhookConfiguration", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.ValidatingWebhookConfiguration" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_ValidatingWebhookConfiguration", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhookConfiguration" } }, "kind": { @@ -544,13 +955,13 @@ } }, "additionalProperties": true, - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.ValidatingWebhookConfigurationList", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhookConfigurationList", "javaInterfaces": [ "io.fabric8.kubernetes.api.model.KubernetesResource", - "io.fabric8.kubernetes.api.model.KubernetesResourceList\u003cio.fabric8.kubernetes.api.model.admissionregistration.ValidatingWebhookConfiguration\u003e" + "io.fabric8.kubernetes.api.model.KubernetesResourceList\u003cio.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhookConfiguration\u003e" ] }, - "kubernetes_admissionregistration_WebhookClientConfig": { + "kubernetes_admissionregistration_v1beta1_WebhookClientConfig": { "type": "object", "description": "", "properties": { @@ -559,8 +970,8 @@ "description": "" }, "service": { - "$ref": "#/definitions/kubernetes_admissionregistration_ServiceReference", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.ServiceReference" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_ServiceReference", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ServiceReference" }, "url": { "type": "string", @@ -568,7 +979,7 @@ } }, "additionalProperties": true, - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.WebhookClientConfig", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.WebhookClientConfig", "javaInterfaces": [ "io.fabric8.kubernetes.api.model.KubernetesResource" ] @@ -2146,12 +2557,12 @@ "javaType": "io.fabric8.kubernetes.api.model.ListOptions" }, "MutatingWebhookConfiguration": { - "$ref": "#/definitions/kubernetes_admissionregistration_MutatingWebhookConfiguration", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.MutatingWebhookConfiguration" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_MutatingWebhookConfiguration", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfiguration" }, "MutatingWebhookConfigurationList": { - "$ref": "#/definitions/kubernetes_admissionregistration_MutatingWebhookConfigurationList", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.MutatingWebhookConfigurationList" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_MutatingWebhookConfigurationList", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfigurationList" }, "ObjectMeta": { "$ref": "#/definitions/kubernetes_apimachinery_ObjectMeta", @@ -2182,12 +2593,12 @@ "javaType": "io.fabric8.kubernetes.api.model.RootPaths" }, "Rule": { - "$ref": "#/definitions/kubernetes_admissionregistration_Rule", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.Rule" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_Rule", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.Rule" }, "RuleWithOperations": { - "$ref": "#/definitions/kubernetes_admissionregistration_RuleWithOperations", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.RuleWithOperations" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_RuleWithOperations", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.RuleWithOperations" }, "SelfSubjectAccessReview": { "$ref": "#/definitions/kubernetes_authorization_SelfSubjectAccessReview", @@ -2198,8 +2609,8 @@ "javaType": "io.fabric8.kubernetes.api.model.authorization.SelfSubjectRulesReview" }, "ServiceReference": { - "$ref": "#/definitions/kubernetes_admissionregistration_ServiceReference", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.ServiceReference" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_ServiceReference", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ServiceReference" }, "Status": { "$ref": "#/definitions/kubernetes_apimachinery_Status", @@ -2221,13 +2632,41 @@ "$ref": "#/definitions/kubernetes_apimachinery_UpdateOptions", "javaType": "io.fabric8.kubernetes.api.model.UpdateOptions" }, + "V1MutatingWebhookConfiguration": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_MutatingWebhookConfiguration", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfiguration" + }, + "V1MutatingWebhookConfigurationList": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_MutatingWebhookConfigurationList", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfigurationList" + }, + "V1Rule": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_Rule", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.Rule" + }, + "V1RuleWithOperations": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_RuleWithOperations", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.RuleWithOperations" + }, + "V1ServiceReference": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_ServiceReference", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.ServiceReference" + }, + "V1ValidatingWebhookConfiguration": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_ValidatingWebhookConfiguration", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfiguration" + }, + "V1ValidatingWebhookConfigurationList": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_ValidatingWebhookConfigurationList", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfigurationList" + }, "ValidatingWebhookConfiguration": { - "$ref": "#/definitions/kubernetes_admissionregistration_ValidatingWebhookConfiguration", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.ValidatingWebhookConfiguration" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_ValidatingWebhookConfiguration", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhookConfiguration" }, "ValidatingWebhookConfigurationList": { - "$ref": "#/definitions/kubernetes_admissionregistration_ValidatingWebhookConfigurationList", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.ValidatingWebhookConfigurationList" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_ValidatingWebhookConfigurationList", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhookConfigurationList" } }, "additionalProperties": true diff --git a/kubernetes-model/kubernetes-model-admissionregistration/src/main/resources/schema/validation-schema.json b/kubernetes-model/kubernetes-model-admissionregistration/src/main/resources/schema/validation-schema.json index 9e16449ee70..6ff79397125 100644 --- a/kubernetes-model/kubernetes-model-admissionregistration/src/main/resources/schema/validation-schema.json +++ b/kubernetes-model/kubernetes-model-admissionregistration/src/main/resources/schema/validation-schema.json @@ -160,7 +160,418 @@ "io.fabric8.kubernetes.api.model.KubernetesResource" ] }, - "kubernetes_admissionregistration_MutatingWebhook": { + "kubernetes_admissionregistration_v1_MutatingWebhook": { + "type": "object", + "description": "", + "properties": { + "admissionReviewVersions": { + "type": "array", + "description": "", + "items": { + "type": "string", + "description": "" + } + }, + "clientConfig": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_WebhookClientConfig", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.WebhookClientConfig" + }, + "failurePolicy": { + "type": "string", + "description": "" + }, + "matchPolicy": { + "type": "string", + "description": "" + }, + "name": { + "type": "string", + "description": "" + }, + "namespaceSelector": { + "$ref": "#/definitions/kubernetes_apimachinery_LabelSelector", + "javaType": "io.fabric8.kubernetes.api.model.LabelSelector" + }, + "objectSelector": { + "$ref": "#/definitions/kubernetes_apimachinery_LabelSelector", + "javaType": "io.fabric8.kubernetes.api.model.LabelSelector" + }, + "reinvocationPolicy": { + "type": "string", + "description": "" + }, + "rules": { + "type": "array", + "description": "", + "javaOmitEmpty": true, + "items": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_RuleWithOperations", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.RuleWithOperations" + } + }, + "sideEffects": { + "type": "string", + "description": "" + }, + "timeoutSeconds": { + "type": "integer", + "description": "" + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhook", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.KubernetesResource" + ] + }, + "kubernetes_admissionregistration_v1_MutatingWebhookConfiguration": { + "type": "object", + "description": "", + "properties": { + "apiVersion": { + "type": "string", + "description": "", + "default": "admissionregistration.k8s.io/v1", + "required": true + }, + "kind": { + "type": "string", + "description": "", + "default": "MutatingWebhookConfiguration", + "required": true + }, + "metadata": { + "$ref": "#/definitions/kubernetes_apimachinery_ObjectMeta", + "javaType": "io.fabric8.kubernetes.api.model.ObjectMeta" + }, + "webhooks": { + "type": "array", + "description": "", + "javaOmitEmpty": true, + "items": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_MutatingWebhook", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhook" + } + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfiguration", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.HasMetadata" + ] + }, + "kubernetes_admissionregistration_v1_MutatingWebhookConfigurationList": { + "type": "object", + "description": "", + "properties": { + "apiVersion": { + "type": "string", + "description": "", + "default": "admissionregistration.k8s.io/v1", + "required": true + }, + "items": { + "type": "array", + "description": "", + "items": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_MutatingWebhookConfiguration", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfiguration" + } + }, + "kind": { + "type": "string", + "description": "", + "default": "MutatingWebhookConfigurationList", + "required": true + }, + "metadata": { + "$ref": "#/definitions/kubernetes_apimachinery_ListMeta", + "javaType": "io.fabric8.kubernetes.api.model.ListMeta" + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfigurationList", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.KubernetesResource", + "io.fabric8.kubernetes.api.model.KubernetesResourceList\u003cio.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfiguration\u003e" + ] + }, + "kubernetes_admissionregistration_v1_Rule": { + "type": "object", + "description": "", + "properties": { + "apiGroups": { + "type": "array", + "description": "", + "javaOmitEmpty": true, + "items": { + "type": "string", + "description": "" + } + }, + "apiVersions": { + "type": "array", + "description": "", + "javaOmitEmpty": true, + "items": { + "type": "string", + "description": "" + } + }, + "resources": { + "type": "array", + "description": "", + "javaOmitEmpty": true, + "items": { + "type": "string", + "description": "" + } + }, + "scope": { + "type": "string", + "description": "" + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.Rule", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.KubernetesResource" + ] + }, + "kubernetes_admissionregistration_v1_RuleWithOperations": { + "type": "object", + "description": "", + "properties": { + "apiGroups": { + "type": "array", + "description": "", + "javaOmitEmpty": true, + "items": { + "type": "string", + "description": "" + } + }, + "apiVersions": { + "type": "array", + "description": "", + "javaOmitEmpty": true, + "items": { + "type": "string", + "description": "" + } + }, + "operations": { + "type": "array", + "description": "", + "javaOmitEmpty": true, + "items": { + "type": "string", + "description": "" + } + }, + "resources": { + "type": "array", + "description": "", + "javaOmitEmpty": true, + "items": { + "type": "string", + "description": "" + } + }, + "scope": { + "type": "string", + "description": "" + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.RuleWithOperations", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.KubernetesResource" + ] + }, + "kubernetes_admissionregistration_v1_ServiceReference": { + "type": "object", + "description": "", + "properties": { + "name": { + "type": "string", + "description": "" + }, + "namespace": { + "type": "string", + "description": "" + }, + "path": { + "type": "string", + "description": "" + }, + "port": { + "type": "integer", + "description": "" + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.ServiceReference", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.KubernetesResource" + ] + }, + "kubernetes_admissionregistration_v1_ValidatingWebhook": { + "type": "object", + "description": "", + "properties": { + "admissionReviewVersions": { + "type": "array", + "description": "", + "items": { + "type": "string", + "description": "" + } + }, + "clientConfig": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_WebhookClientConfig", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.WebhookClientConfig" + }, + "failurePolicy": { + "type": "string", + "description": "" + }, + "matchPolicy": { + "type": "string", + "description": "" + }, + "name": { + "type": "string", + "description": "" + }, + "namespaceSelector": { + "$ref": "#/definitions/kubernetes_apimachinery_LabelSelector", + "javaType": "io.fabric8.kubernetes.api.model.LabelSelector" + }, + "objectSelector": { + "$ref": "#/definitions/kubernetes_apimachinery_LabelSelector", + "javaType": "io.fabric8.kubernetes.api.model.LabelSelector" + }, + "rules": { + "type": "array", + "description": "", + "javaOmitEmpty": true, + "items": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_RuleWithOperations", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.RuleWithOperations" + } + }, + "sideEffects": { + "type": "string", + "description": "" + }, + "timeoutSeconds": { + "type": "integer", + "description": "" + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhook", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.KubernetesResource" + ] + }, + "kubernetes_admissionregistration_v1_ValidatingWebhookConfiguration": { + "type": "object", + "description": "", + "properties": { + "apiVersion": { + "type": "string", + "description": "", + "default": "admissionregistration.k8s.io/v1", + "required": true + }, + "kind": { + "type": "string", + "description": "", + "default": "ValidatingWebhookConfiguration", + "required": true + }, + "metadata": { + "$ref": "#/definitions/kubernetes_apimachinery_ObjectMeta", + "javaType": "io.fabric8.kubernetes.api.model.ObjectMeta" + }, + "webhooks": { + "type": "array", + "description": "", + "javaOmitEmpty": true, + "items": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_ValidatingWebhook", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhook" + } + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfiguration", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.HasMetadata" + ] + }, + "kubernetes_admissionregistration_v1_ValidatingWebhookConfigurationList": { + "type": "object", + "description": "", + "properties": { + "apiVersion": { + "type": "string", + "description": "", + "default": "admissionregistration.k8s.io/v1", + "required": true + }, + "items": { + "type": "array", + "description": "", + "items": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_ValidatingWebhookConfiguration", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfiguration" + } + }, + "kind": { + "type": "string", + "description": "", + "default": "ValidatingWebhookConfigurationList", + "required": true + }, + "metadata": { + "$ref": "#/definitions/kubernetes_apimachinery_ListMeta", + "javaType": "io.fabric8.kubernetes.api.model.ListMeta" + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfigurationList", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.KubernetesResource", + "io.fabric8.kubernetes.api.model.KubernetesResourceList\u003cio.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfiguration\u003e" + ] + }, + "kubernetes_admissionregistration_v1_WebhookClientConfig": { + "type": "object", + "description": "", + "properties": { + "caBundle": { + "type": "string", + "description": "" + }, + "service": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_ServiceReference", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.ServiceReference" + }, + "url": { + "type": "string", + "description": "" + } + }, + "additionalProperties": true, + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.WebhookClientConfig", + "javaInterfaces": [ + "io.fabric8.kubernetes.api.model.KubernetesResource" + ] + }, + "kubernetes_admissionregistration_v1beta1_MutatingWebhook": { "type": "object", "description": "", "properties": { @@ -174,8 +585,8 @@ } }, "clientConfig": { - "$ref": "#/definitions/kubernetes_admissionregistration_WebhookClientConfig", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.WebhookClientConfig" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_WebhookClientConfig", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.WebhookClientConfig" }, "failurePolicy": { "type": "string", @@ -206,8 +617,8 @@ "description": "", "javaOmitEmpty": true, "items": { - "$ref": "#/definitions/kubernetes_admissionregistration_RuleWithOperations", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.RuleWithOperations" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_RuleWithOperations", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.RuleWithOperations" } }, "sideEffects": { @@ -220,12 +631,12 @@ } }, "additionalProperties": true, - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.MutatingWebhook", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhook", "javaInterfaces": [ "io.fabric8.kubernetes.api.model.KubernetesResource" ] }, - "kubernetes_admissionregistration_MutatingWebhookConfiguration": { + "kubernetes_admissionregistration_v1beta1_MutatingWebhookConfiguration": { "type": "object", "description": "", "properties": { @@ -250,18 +661,18 @@ "description": "", "javaOmitEmpty": true, "items": { - "$ref": "#/definitions/kubernetes_admissionregistration_MutatingWebhook", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.MutatingWebhook" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_MutatingWebhook", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhook" } } }, "additionalProperties": true, - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.MutatingWebhookConfiguration", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfiguration", "javaInterfaces": [ "io.fabric8.kubernetes.api.model.HasMetadata" ] }, - "kubernetes_admissionregistration_MutatingWebhookConfigurationList": { + "kubernetes_admissionregistration_v1beta1_MutatingWebhookConfigurationList": { "type": "object", "description": "", "properties": { @@ -275,8 +686,8 @@ "type": "array", "description": "", "items": { - "$ref": "#/definitions/kubernetes_admissionregistration_MutatingWebhookConfiguration", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.MutatingWebhookConfiguration" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_MutatingWebhookConfiguration", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfiguration" } }, "kind": { @@ -291,13 +702,13 @@ } }, "additionalProperties": true, - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.MutatingWebhookConfigurationList", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfigurationList", "javaInterfaces": [ "io.fabric8.kubernetes.api.model.KubernetesResource", - "io.fabric8.kubernetes.api.model.KubernetesResourceList\u003cio.fabric8.kubernetes.api.model.admissionregistration.MutatingWebhookConfiguration\u003e" + "io.fabric8.kubernetes.api.model.KubernetesResourceList\u003cio.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfiguration\u003e" ] }, - "kubernetes_admissionregistration_Rule": { + "kubernetes_admissionregistration_v1beta1_Rule": { "type": "object", "description": "", "properties": { @@ -334,12 +745,12 @@ } }, "additionalProperties": true, - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.Rule", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.Rule", "javaInterfaces": [ "io.fabric8.kubernetes.api.model.KubernetesResource" ] }, - "kubernetes_admissionregistration_RuleWithOperations": { + "kubernetes_admissionregistration_v1beta1_RuleWithOperations": { "type": "object", "description": "", "properties": { @@ -385,12 +796,12 @@ } }, "additionalProperties": true, - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.RuleWithOperations", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.RuleWithOperations", "javaInterfaces": [ "io.fabric8.kubernetes.api.model.KubernetesResource" ] }, - "kubernetes_admissionregistration_ServiceReference": { + "kubernetes_admissionregistration_v1beta1_ServiceReference": { "type": "object", "description": "", "properties": { @@ -412,12 +823,12 @@ } }, "additionalProperties": true, - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.ServiceReference", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ServiceReference", "javaInterfaces": [ "io.fabric8.kubernetes.api.model.KubernetesResource" ] }, - "kubernetes_admissionregistration_ValidatingWebhook": { + "kubernetes_admissionregistration_v1beta1_ValidatingWebhook": { "type": "object", "description": "", "properties": { @@ -431,8 +842,8 @@ } }, "clientConfig": { - "$ref": "#/definitions/kubernetes_admissionregistration_WebhookClientConfig", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.WebhookClientConfig" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_WebhookClientConfig", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.WebhookClientConfig" }, "failurePolicy": { "type": "string", @@ -459,8 +870,8 @@ "description": "", "javaOmitEmpty": true, "items": { - "$ref": "#/definitions/kubernetes_admissionregistration_RuleWithOperations", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.RuleWithOperations" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_RuleWithOperations", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.RuleWithOperations" } }, "sideEffects": { @@ -473,12 +884,12 @@ } }, "additionalProperties": true, - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.ValidatingWebhook", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhook", "javaInterfaces": [ "io.fabric8.kubernetes.api.model.KubernetesResource" ] }, - "kubernetes_admissionregistration_ValidatingWebhookConfiguration": { + "kubernetes_admissionregistration_v1beta1_ValidatingWebhookConfiguration": { "type": "object", "description": "", "properties": { @@ -503,18 +914,18 @@ "description": "", "javaOmitEmpty": true, "items": { - "$ref": "#/definitions/kubernetes_admissionregistration_ValidatingWebhook", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.ValidatingWebhook" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_ValidatingWebhook", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhook" } } }, "additionalProperties": true, - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.ValidatingWebhookConfiguration", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhookConfiguration", "javaInterfaces": [ "io.fabric8.kubernetes.api.model.HasMetadata" ] }, - "kubernetes_admissionregistration_ValidatingWebhookConfigurationList": { + "kubernetes_admissionregistration_v1beta1_ValidatingWebhookConfigurationList": { "type": "object", "description": "", "properties": { @@ -528,8 +939,8 @@ "type": "array", "description": "", "items": { - "$ref": "#/definitions/kubernetes_admissionregistration_ValidatingWebhookConfiguration", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.ValidatingWebhookConfiguration" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_ValidatingWebhookConfiguration", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhookConfiguration" } }, "kind": { @@ -544,13 +955,13 @@ } }, "additionalProperties": true, - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.ValidatingWebhookConfigurationList", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhookConfigurationList", "javaInterfaces": [ "io.fabric8.kubernetes.api.model.KubernetesResource", - "io.fabric8.kubernetes.api.model.KubernetesResourceList\u003cio.fabric8.kubernetes.api.model.admissionregistration.ValidatingWebhookConfiguration\u003e" + "io.fabric8.kubernetes.api.model.KubernetesResourceList\u003cio.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhookConfiguration\u003e" ] }, - "kubernetes_admissionregistration_WebhookClientConfig": { + "kubernetes_admissionregistration_v1beta1_WebhookClientConfig": { "type": "object", "description": "", "properties": { @@ -559,8 +970,8 @@ "description": "" }, "service": { - "$ref": "#/definitions/kubernetes_admissionregistration_ServiceReference", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.ServiceReference" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_ServiceReference", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ServiceReference" }, "url": { "type": "string", @@ -568,7 +979,7 @@ } }, "additionalProperties": true, - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.WebhookClientConfig", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.WebhookClientConfig", "javaInterfaces": [ "io.fabric8.kubernetes.api.model.KubernetesResource" ] @@ -2146,12 +2557,12 @@ "javaType": "io.fabric8.kubernetes.api.model.ListOptions" }, "MutatingWebhookConfiguration": { - "$ref": "#/definitions/kubernetes_admissionregistration_MutatingWebhookConfiguration", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.MutatingWebhookConfiguration" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_MutatingWebhookConfiguration", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfiguration" }, "MutatingWebhookConfigurationList": { - "$ref": "#/definitions/kubernetes_admissionregistration_MutatingWebhookConfigurationList", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.MutatingWebhookConfigurationList" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_MutatingWebhookConfigurationList", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfigurationList" }, "ObjectMeta": { "$ref": "#/definitions/kubernetes_apimachinery_ObjectMeta", @@ -2182,12 +2593,12 @@ "javaType": "io.fabric8.kubernetes.api.model.RootPaths" }, "Rule": { - "$ref": "#/definitions/kubernetes_admissionregistration_Rule", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.Rule" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_Rule", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.Rule" }, "RuleWithOperations": { - "$ref": "#/definitions/kubernetes_admissionregistration_RuleWithOperations", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.RuleWithOperations" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_RuleWithOperations", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.RuleWithOperations" }, "SelfSubjectAccessReview": { "$ref": "#/definitions/kubernetes_authorization_SelfSubjectAccessReview", @@ -2198,8 +2609,8 @@ "javaType": "io.fabric8.kubernetes.api.model.authorization.SelfSubjectRulesReview" }, "ServiceReference": { - "$ref": "#/definitions/kubernetes_admissionregistration_ServiceReference", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.ServiceReference" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_ServiceReference", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ServiceReference" }, "Status": { "$ref": "#/definitions/kubernetes_apimachinery_Status", @@ -2221,13 +2632,41 @@ "$ref": "#/definitions/kubernetes_apimachinery_UpdateOptions", "javaType": "io.fabric8.kubernetes.api.model.UpdateOptions" }, + "V1MutatingWebhookConfiguration": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_MutatingWebhookConfiguration", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfiguration" + }, + "V1MutatingWebhookConfigurationList": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_MutatingWebhookConfigurationList", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfigurationList" + }, + "V1Rule": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_Rule", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.Rule" + }, + "V1RuleWithOperations": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_RuleWithOperations", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.RuleWithOperations" + }, + "V1ServiceReference": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_ServiceReference", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.ServiceReference" + }, + "V1ValidatingWebhookConfiguration": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_ValidatingWebhookConfiguration", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfiguration" + }, + "V1ValidatingWebhookConfigurationList": { + "$ref": "#/definitions/kubernetes_admissionregistration_v1_ValidatingWebhookConfigurationList", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfigurationList" + }, "ValidatingWebhookConfiguration": { - "$ref": "#/definitions/kubernetes_admissionregistration_ValidatingWebhookConfiguration", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.ValidatingWebhookConfiguration" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_ValidatingWebhookConfiguration", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhookConfiguration" }, "ValidatingWebhookConfigurationList": { - "$ref": "#/definitions/kubernetes_admissionregistration_ValidatingWebhookConfigurationList", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.ValidatingWebhookConfigurationList" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_ValidatingWebhookConfigurationList", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhookConfigurationList" } }, "additionalProperties": true, @@ -2821,15 +3260,14 @@ "admissionReviewVersions": { "type": "array", "description": "", - "javaOmitEmpty": true, "items": { "type": "string", "description": "" } }, "clientConfig": { - "$ref": "#/definitions/kubernetes_admissionregistration_WebhookClientConfig", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.WebhookClientConfig" + "$ref": "#/definitions/kubernetes_admissionregistration_v1_WebhookClientConfig", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.WebhookClientConfig" }, "failurePolicy": { "type": "string", @@ -2860,8 +3298,8 @@ "description": "", "javaOmitEmpty": true, "items": { - "$ref": "#/definitions/kubernetes_admissionregistration_RuleWithOperations", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.RuleWithOperations" + "$ref": "#/definitions/kubernetes_admissionregistration_v1_RuleWithOperations", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.RuleWithOperations" } }, "sideEffects": { @@ -2880,7 +3318,7 @@ "apiVersion": { "type": "string", "description": "", - "default": "admissionregistration.k8s.io/v1beta1", + "default": "admissionregistration.k8s.io/v1", "required": true }, "kind": { @@ -2898,8 +3336,8 @@ "description": "", "javaOmitEmpty": true, "items": { - "$ref": "#/definitions/kubernetes_admissionregistration_MutatingWebhook", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.MutatingWebhook" + "$ref": "#/definitions/kubernetes_admissionregistration_v1_MutatingWebhook", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhook" } } }, @@ -2917,8 +3355,8 @@ "type": "array", "description": "", "items": { - "$ref": "#/definitions/kubernetes_admissionregistration_MutatingWebhookConfiguration", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.MutatingWebhookConfiguration" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_MutatingWebhookConfiguration", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfiguration" } }, "kind": { @@ -3825,8 +4263,8 @@ } }, "clientConfig": { - "$ref": "#/definitions/kubernetes_admissionregistration_WebhookClientConfig", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.WebhookClientConfig" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_WebhookClientConfig", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.WebhookClientConfig" }, "failurePolicy": { "type": "string", @@ -3853,8 +4291,8 @@ "description": "", "javaOmitEmpty": true, "items": { - "$ref": "#/definitions/kubernetes_admissionregistration_RuleWithOperations", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.RuleWithOperations" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_RuleWithOperations", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.RuleWithOperations" } }, "sideEffects": { @@ -3873,7 +4311,7 @@ "apiVersion": { "type": "string", "description": "", - "default": "admissionregistration.k8s.io/v1beta1", + "default": "admissionregistration.k8s.io/v1", "required": true }, "kind": { @@ -3891,8 +4329,8 @@ "description": "", "javaOmitEmpty": true, "items": { - "$ref": "#/definitions/kubernetes_admissionregistration_ValidatingWebhook", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.ValidatingWebhook" + "$ref": "#/definitions/kubernetes_admissionregistration_v1_ValidatingWebhook", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhook" } } }, @@ -3910,8 +4348,8 @@ "type": "array", "description": "", "items": { - "$ref": "#/definitions/kubernetes_admissionregistration_ValidatingWebhookConfiguration", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.ValidatingWebhookConfiguration" + "$ref": "#/definitions/kubernetes_admissionregistration_v1beta1_ValidatingWebhookConfiguration", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhookConfiguration" } }, "kind": { @@ -3934,8 +4372,8 @@ "description": "" }, "service": { - "$ref": "#/definitions/kubernetes_admissionregistration_ServiceReference", - "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.ServiceReference" + "$ref": "#/definitions/kubernetes_admissionregistration_v1_ServiceReference", + "javaType": "io.fabric8.kubernetes.api.model.admissionregistration.v1.ServiceReference" }, "url": { "type": "string", diff --git a/kubernetes-model/kubernetes-model-admissionregistration/src/test/java/io/fabric8/kubernetes/api/model/admissionregistration/ValidatingWebhookConfigurationTest.java b/kubernetes-model/kubernetes-model-admissionregistration/src/test/java/io/fabric8/kubernetes/api/model/admissionregistration/ValidatingWebhookConfigurationTest.java index 12b181ff6e3..d8eb5c34d56 100644 --- a/kubernetes-model/kubernetes-model-admissionregistration/src/test/java/io/fabric8/kubernetes/api/model/admissionregistration/ValidatingWebhookConfigurationTest.java +++ b/kubernetes-model/kubernetes-model-admissionregistration/src/test/java/io/fabric8/kubernetes/api/model/admissionregistration/ValidatingWebhookConfigurationTest.java @@ -15,6 +15,8 @@ */ package io.fabric8.kubernetes.api.model.admissionregistration; +import io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfiguration; + import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -22,7 +24,7 @@ public class ValidatingWebhookConfigurationTest { @Test public void testBuilder() { - ValidatingWebhookConfiguration vwc = new io.fabric8.kubernetes.api.model.admissionregistration.ValidatingWebhookConfigurationBuilder() + ValidatingWebhookConfiguration vwc = new io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfigurationBuilder() .withNewMetadata().withName("pod-policy.example.com").endMetadata() .addNewWebhook() .withName("pod-policy.example.com") diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/MutatingWebhookConfigurationTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/MutatingWebhookConfigurationTest.java deleted file mode 100644 index b5ee20d8fb5..00000000000 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/MutatingWebhookConfigurationTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright (C) 2015 Red Hat, Inc. - * - * 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 io.fabric8.kubernetes.client.mock; - -import io.fabric8.kubernetes.api.model.HasMetadata; -import io.fabric8.kubernetes.api.model.admissionregistration.MutatingWebhookBuilder; -import io.fabric8.kubernetes.api.model.admissionregistration.MutatingWebhookConfiguration; -import io.fabric8.kubernetes.api.model.admissionregistration.MutatingWebhookConfigurationBuilder; -import io.fabric8.kubernetes.client.KubernetesClient; -import io.fabric8.kubernetes.client.server.mock.KubernetesServer; -import org.junit.Rule; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.migrationsupport.rules.EnableRuleMigrationSupport; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -@EnableRuleMigrationSupport -public class MutatingWebhookConfigurationTest { - @Rule - public KubernetesServer server = new KubernetesServer(); - - @Test - public void create() { - MutatingWebhookConfiguration mutatingWebhookConfiguration = new MutatingWebhookConfigurationBuilder() - .withNewMetadata().withName("mutatingWebhookConfiguration1").endMetadata() - .addToWebhooks(new MutatingWebhookBuilder() - .withName("webhook1") - .withNewClientConfig() - .withNewService() - .withName("svc1") - .withNamespace("test") - .withPath("/mutate") - .endService() - .endClientConfig() - .build()) - .build(); - - server.expect().post().withPath("/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations").andReturn(201, mutatingWebhookConfiguration).once(); - - KubernetesClient client = server.getClient(); - HasMetadata response = client.resource(mutatingWebhookConfiguration).inNamespace("test").createOrReplace(); - assertEquals(mutatingWebhookConfiguration, response); - } -} diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V1MutatingWebhookConfigurationTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V1MutatingWebhookConfigurationTest.java new file mode 100644 index 00000000000..d0796dfc567 --- /dev/null +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V1MutatingWebhookConfigurationTest.java @@ -0,0 +1,122 @@ +/** + * Copyright (C) 2015 Red Hat, Inc. + * + * 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 io.fabric8.kubernetes.client.mock; + +import io.fabric8.kubernetes.api.model.HasMetadata; +import io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookBuilder; +import io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfiguration; +import io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfigurationBuilder; +import io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfigurationList; +import io.fabric8.kubernetes.api.model.admissionregistration.v1.MutatingWebhookConfigurationListBuilder; +import io.fabric8.kubernetes.client.KubernetesClient; +import io.fabric8.kubernetes.client.server.mock.KubernetesServer; +import org.junit.Rule; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.migrationsupport.rules.EnableRuleMigrationSupport; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +@EnableRuleMigrationSupport +public class V1MutatingWebhookConfigurationTest { + @Rule + public KubernetesServer server = new KubernetesServer(); + + @Test + public void create() { + MutatingWebhookConfiguration mutatingWebhookConfiguration = getMutatingWebhookConfigurationSample(); + + server.expect().post().withPath("/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations").andReturn(201, mutatingWebhookConfiguration).once(); + + KubernetesClient client = server.getClient(); + HasMetadata response = client.resource(mutatingWebhookConfiguration).inNamespace("test").createOrReplace(); + assertEquals(mutatingWebhookConfiguration, response); + } + + + @Test + public void get() { + // Given + server.expect().get().withPath("/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/mutatingWebhookConfiguration1").andReturn(200, getMutatingWebhookConfigurationSample()).once(); + KubernetesClient client = server.getClient(); + + // When + MutatingWebhookConfiguration mutatingWebhookConfiguration = client.admissionRegistration().v1().mutatingWebhookConfigurations().withName("mutatingWebhookConfiguration1").get(); + + // Then + assertNotNull(mutatingWebhookConfiguration); + assertEquals("mutatingWebhookConfiguration1", mutatingWebhookConfiguration.getMetadata().getName()); + } + + @Test + public void list() { + // Given + server.expect().get().withPath("/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations") + .andReturn(200, new MutatingWebhookConfigurationListBuilder().withItems(getMutatingWebhookConfigurationSample()).build()).once(); + KubernetesClient client = server.getClient(); + + // When + MutatingWebhookConfigurationList mutatingWebhookConfigurationList = client.admissionRegistration().v1().mutatingWebhookConfigurations().list(); + + // Then + assertNotNull(mutatingWebhookConfigurationList); + assertEquals(1, mutatingWebhookConfigurationList.getItems().size()); + assertEquals("mutatingWebhookConfiguration1", mutatingWebhookConfigurationList.getItems().get(0).getMetadata().getName()); + } + + @Test + public void createOrReplace() { + MutatingWebhookConfiguration mutatingWebhookConfiguration = getMutatingWebhookConfigurationSample(); + + server.expect().post().withPath("/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations").andReturn(200, mutatingWebhookConfiguration).once(); + + KubernetesClient client = server.getClient(); + MutatingWebhookConfiguration mutatingWebhookConfiguration1 = client.admissionRegistration().v1().mutatingWebhookConfigurations().createOrReplace(mutatingWebhookConfiguration); + assertNotNull(mutatingWebhookConfiguration1); + assertEquals("mutatingWebhookConfiguration1", mutatingWebhookConfiguration1.getMetadata().getName()); + } + + @Test + public void delete() { + // Given + server.expect().delete().withPath("/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/mutatingWebhookConfiguration1") + .andReturn(200, getMutatingWebhookConfigurationSample()).once(); + KubernetesClient client = server.getClient(); + + // When + Boolean isDeleted = client.admissionRegistration().v1().mutatingWebhookConfigurations().withName("mutatingWebhookConfiguration1").delete(); + + // Then + assertTrue(isDeleted); + } + + public MutatingWebhookConfiguration getMutatingWebhookConfigurationSample() { + return new MutatingWebhookConfigurationBuilder() + .withNewMetadata().withName("mutatingWebhookConfiguration1").endMetadata() + .addToWebhooks(new MutatingWebhookBuilder() + .withName("webhook1") + .withNewClientConfig() + .withNewService() + .withName("svc1") + .withNamespace("test") + .withPath("/mutate") + .endService() + .endClientConfig() + .build()) + .build(); + } +} diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V1ValidatingWebhookConfigurationTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V1ValidatingWebhookConfigurationTest.java new file mode 100644 index 00000000000..3f9b9efe20b --- /dev/null +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V1ValidatingWebhookConfigurationTest.java @@ -0,0 +1,130 @@ +/** + * Copyright (C) 2015 Red Hat, Inc. + * + * 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 io.fabric8.kubernetes.client.mock; +import io.fabric8.kubernetes.api.model.HasMetadata; +import io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookBuilder; +import io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfiguration; +import io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfigurationBuilder; +import io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfigurationList; +import io.fabric8.kubernetes.api.model.admissionregistration.v1.ValidatingWebhookConfigurationListBuilder; +import io.fabric8.kubernetes.client.KubernetesClient; +import io.fabric8.kubernetes.client.server.mock.KubernetesServer; +import org.junit.Rule; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.migrationsupport.rules.EnableRuleMigrationSupport; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +@EnableRuleMigrationSupport +public class V1ValidatingWebhookConfigurationTest { + @Rule + public KubernetesServer server = new KubernetesServer(); + + @Test + public void createUsingResource() { + ValidatingWebhookConfiguration validatingWebhookConfiguration = getValidatingWebhookConfigurationSample(); + + server.expect().post().withPath("/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations").andReturn(201, validatingWebhookConfiguration).once(); + + KubernetesClient client = server.getClient(); + HasMetadata response = client.resource(validatingWebhookConfiguration).inNamespace("test").createOrReplace(); + assertEquals(validatingWebhookConfiguration, response); + } + + @Test + public void load() { + KubernetesClient client = server.getClient(); + ValidatingWebhookConfiguration vwc = client.admissionRegistration().v1().validatingWebhookConfigurations().load(getClass().getResourceAsStream("/v1-vwc.yml")).get(); + assertNotNull(vwc); + assertEquals("pod-policy.example.com", vwc.getMetadata().getName()); + assertEquals(1, vwc.getWebhooks().size()); + } + + + @Test + public void get() { + // Given + server.expect().get().withPath("/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/validatingWebhookConfiguration1").andReturn(200, getValidatingWebhookConfigurationSample()).once(); + KubernetesClient client = server.getClient(); + + // When + ValidatingWebhookConfiguration validatingWebhookConfiguration = client.admissionRegistration().v1().validatingWebhookConfigurations().withName("validatingWebhookConfiguration1").get(); + + // Then + assertNotNull(validatingWebhookConfiguration); + assertEquals("validatingWebhookConfiguration1", validatingWebhookConfiguration.getMetadata().getName()); + } + + @Test + public void list() { + // Given + server.expect().get().withPath("/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations") + .andReturn(200, new ValidatingWebhookConfigurationListBuilder().withItems(getValidatingWebhookConfigurationSample()).build()).once(); + KubernetesClient client = server.getClient(); + + // When + ValidatingWebhookConfigurationList validatingWebhookConfigurationList = client.admissionRegistration().v1().validatingWebhookConfigurations().list(); + + // Then + assertNotNull(validatingWebhookConfigurationList); + assertEquals(1, validatingWebhookConfigurationList.getItems().size()); + assertEquals("validatingWebhookConfiguration1", validatingWebhookConfigurationList.getItems().get(0).getMetadata().getName()); + } + + @Test + public void createOrReplace() { + ValidatingWebhookConfiguration validatingWebhookConfiguration = getValidatingWebhookConfigurationSample(); + + server.expect().post().withPath("/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations").andReturn(200, validatingWebhookConfiguration).once(); + + KubernetesClient client = server.getClient(); + ValidatingWebhookConfiguration validatingWebhookConfiguration1 = client.admissionRegistration().v1().validatingWebhookConfigurations().createOrReplace(validatingWebhookConfiguration); + assertNotNull(validatingWebhookConfiguration1); + assertEquals("validatingWebhookConfiguration1", validatingWebhookConfiguration1.getMetadata().getName()); + } + + @Test + public void delete() { + // Given + server.expect().delete().withPath("/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/validatingWebhookConfiguration1") + .andReturn(200, getValidatingWebhookConfigurationSample()).once(); + KubernetesClient client = server.getClient(); + + // When + Boolean isDeleted = client.admissionRegistration().v1().validatingWebhookConfigurations().withName("validatingWebhookConfiguration1").delete(); + + // Then + assertTrue(isDeleted); + } + + public ValidatingWebhookConfiguration getValidatingWebhookConfigurationSample() { + return new ValidatingWebhookConfigurationBuilder() + .withNewMetadata().withName("validatingWebhookConfiguration1").endMetadata() + .addToWebhooks(new ValidatingWebhookBuilder() + .withName("webhook1") + .withNewClientConfig() + .withNewService() + .withName("svc1") + .withNamespace("test") + .withPath("/validate") + .endService() + .endClientConfig() + .build()) + .build(); + } +} diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V1beta1MutatingWebhookConfigurationTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V1beta1MutatingWebhookConfigurationTest.java new file mode 100644 index 00000000000..45b8f2f1091 --- /dev/null +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V1beta1MutatingWebhookConfigurationTest.java @@ -0,0 +1,122 @@ +/** + * Copyright (C) 2015 Red Hat, Inc. + * + * 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 io.fabric8.kubernetes.client.mock; + +import io.fabric8.kubernetes.api.model.HasMetadata; +import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookBuilder; +import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfiguration; +import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfigurationBuilder; +import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfigurationList; +import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingWebhookConfigurationListBuilder; +import io.fabric8.kubernetes.client.KubernetesClient; +import io.fabric8.kubernetes.client.server.mock.KubernetesServer; +import org.junit.Rule; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.migrationsupport.rules.EnableRuleMigrationSupport; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +@EnableRuleMigrationSupport +public class V1beta1MutatingWebhookConfigurationTest { + @Rule + public KubernetesServer server = new KubernetesServer(); + + @Test + public void create() { + MutatingWebhookConfiguration mutatingWebhookConfiguration = getMutatingWebhookConfigurationSample(); + + server.expect().post().withPath("/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations").andReturn(201, mutatingWebhookConfiguration).once(); + + KubernetesClient client = server.getClient(); + HasMetadata response = client.resource(mutatingWebhookConfiguration).inNamespace("test").createOrReplace(); + assertEquals(mutatingWebhookConfiguration, response); + } + + + @Test + public void get() { + // Given + server.expect().get().withPath("/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/mutatingWebhookConfiguration1").andReturn(200, getMutatingWebhookConfigurationSample()).once(); + KubernetesClient client = server.getClient(); + + // When + MutatingWebhookConfiguration mutatingWebhookConfiguration = client.admissionRegistration().v1beta1().mutatingWebhookConfigurations().withName("mutatingWebhookConfiguration1").get(); + + // Then + assertNotNull(mutatingWebhookConfiguration); + assertEquals("mutatingWebhookConfiguration1", mutatingWebhookConfiguration.getMetadata().getName()); + } + + @Test + public void list() { + // Given + server.expect().get().withPath("/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations") + .andReturn(200, new MutatingWebhookConfigurationListBuilder().withItems(getMutatingWebhookConfigurationSample()).build()).once(); + KubernetesClient client = server.getClient(); + + // When + MutatingWebhookConfigurationList mutatingWebhookConfigurationList = client.admissionRegistration().v1beta1().mutatingWebhookConfigurations().list(); + + // Then + assertNotNull(mutatingWebhookConfigurationList); + assertEquals(1, mutatingWebhookConfigurationList.getItems().size()); + assertEquals("mutatingWebhookConfiguration1", mutatingWebhookConfigurationList.getItems().get(0).getMetadata().getName()); + } + + @Test + public void createOrReplace() { + MutatingWebhookConfiguration mutatingWebhookConfiguration = getMutatingWebhookConfigurationSample(); + + server.expect().post().withPath("/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations").andReturn(200, mutatingWebhookConfiguration).once(); + + KubernetesClient client = server.getClient(); + MutatingWebhookConfiguration mutatingWebhookConfiguration1 = client.admissionRegistration().v1beta1().mutatingWebhookConfigurations().createOrReplace(mutatingWebhookConfiguration); + assertNotNull(mutatingWebhookConfiguration1); + assertEquals("mutatingWebhookConfiguration1", mutatingWebhookConfiguration1.getMetadata().getName()); + } + + @Test + public void delete() { + // Given + server.expect().delete().withPath("/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/mutatingWebhookConfiguration1") + .andReturn(200, getMutatingWebhookConfigurationSample()).once(); + KubernetesClient client = server.getClient(); + + // When + Boolean isDeleted = client.admissionRegistration().v1beta1().mutatingWebhookConfigurations().withName("mutatingWebhookConfiguration1").delete(); + + // Then + assertTrue(isDeleted); + } + + public MutatingWebhookConfiguration getMutatingWebhookConfigurationSample() { + return new MutatingWebhookConfigurationBuilder() + .withNewMetadata().withName("mutatingWebhookConfiguration1").endMetadata() + .addToWebhooks(new MutatingWebhookBuilder() + .withName("webhook1") + .withNewClientConfig() + .withNewService() + .withName("svc1") + .withNamespace("test") + .withPath("/mutate") + .endService() + .endClientConfig() + .build()) + .build(); + } +} diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V1beta1ValidatingWebhookConfigurationTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V1beta1ValidatingWebhookConfigurationTest.java new file mode 100644 index 00000000000..71496cf120d --- /dev/null +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/V1beta1ValidatingWebhookConfigurationTest.java @@ -0,0 +1,130 @@ +/** + * Copyright (C) 2015 Red Hat, Inc. + * + * 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 io.fabric8.kubernetes.client.mock; + +import io.fabric8.kubernetes.api.model.HasMetadata; +import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhookBuilder; +import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhookConfiguration; +import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhookConfigurationBuilder; +import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhookConfigurationList; +import io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.ValidatingWebhookConfigurationListBuilder; +import io.fabric8.kubernetes.client.KubernetesClient; +import io.fabric8.kubernetes.client.server.mock.KubernetesServer; +import org.junit.Rule; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.migrationsupport.rules.EnableRuleMigrationSupport; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +@EnableRuleMigrationSupport +public class V1beta1ValidatingWebhookConfigurationTest { + @Rule + public KubernetesServer server = new KubernetesServer(); + + @Test + public void createUsingResource() { + ValidatingWebhookConfiguration validatingWebhookConfiguration = getValidatingWebhookConfigurationSample(); + + server.expect().post().withPath("/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations").andReturn(201, validatingWebhookConfiguration).once(); + + KubernetesClient client = server.getClient(); + HasMetadata response = client.resource(validatingWebhookConfiguration).inNamespace("test").createOrReplace(); + assertEquals(validatingWebhookConfiguration, response); + } + + @Test + public void load() { + KubernetesClient client = server.getClient(); + ValidatingWebhookConfiguration vwc = client.admissionRegistration().v1beta1().validatingWebhookConfigurations().load(getClass().getResourceAsStream("/v1beta1-vwc.yml")).get(); + assertNotNull(vwc); + assertEquals("pod-policy.example.com", vwc.getMetadata().getName()); + assertEquals(1, vwc.getWebhooks().size()); + } + + @Test + public void get() { + // Given + server.expect().get().withPath("/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/validatingWebhookConfiguration1").andReturn(200, getValidatingWebhookConfigurationSample()).once(); + KubernetesClient client = server.getClient(); + + // When + ValidatingWebhookConfiguration validatingWebhookConfiguration = client.admissionRegistration().v1beta1().validatingWebhookConfigurations().withName("validatingWebhookConfiguration1").get(); + + // Then + assertNotNull(validatingWebhookConfiguration); + assertEquals("validatingWebhookConfiguration1", validatingWebhookConfiguration.getMetadata().getName()); + } + + @Test + public void list() { + // Given + server.expect().get().withPath("/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations") + .andReturn(200, new ValidatingWebhookConfigurationListBuilder().withItems(getValidatingWebhookConfigurationSample()).build()).once(); + KubernetesClient client = server.getClient(); + + // When + ValidatingWebhookConfigurationList validatingWebhookConfigurationList = client.admissionRegistration().v1beta1().validatingWebhookConfigurations().list(); + + // Then + assertNotNull(validatingWebhookConfigurationList); + assertEquals(1, validatingWebhookConfigurationList.getItems().size()); + assertEquals("validatingWebhookConfiguration1", validatingWebhookConfigurationList.getItems().get(0).getMetadata().getName()); + } + + @Test + public void createOrReplace() { + ValidatingWebhookConfiguration validatingWebhookConfiguration = getValidatingWebhookConfigurationSample(); + + server.expect().post().withPath("/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations").andReturn(200, validatingWebhookConfiguration).once(); + + KubernetesClient client = server.getClient(); + ValidatingWebhookConfiguration validatingWebhookConfiguration1 = client.admissionRegistration().v1beta1().validatingWebhookConfigurations().createOrReplace(validatingWebhookConfiguration); + assertNotNull(validatingWebhookConfiguration1); + assertEquals("validatingWebhookConfiguration1", validatingWebhookConfiguration1.getMetadata().getName()); + } + + @Test + public void delete() { + // Given + server.expect().delete().withPath("/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/validatingWebhookConfiguration1") + .andReturn(200, getValidatingWebhookConfigurationSample()).once(); + KubernetesClient client = server.getClient(); + + // When + Boolean isDeleted = client.admissionRegistration().v1beta1().validatingWebhookConfigurations().withName("validatingWebhookConfiguration1").delete(); + + // Then + assertTrue(isDeleted); + } + + public ValidatingWebhookConfiguration getValidatingWebhookConfigurationSample() { + return new ValidatingWebhookConfigurationBuilder() + .withNewMetadata().withName("validatingWebhookConfiguration1").endMetadata() + .addToWebhooks(new ValidatingWebhookBuilder() + .withName("webhook1") + .withNewClientConfig() + .withNewService() + .withName("svc1") + .withNamespace("test") + .withPath("/validate") + .endService() + .endClientConfig() + .build()) + .build(); + } +} diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ValidatingWebhookConfigurationTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ValidatingWebhookConfigurationTest.java deleted file mode 100644 index a426d4a6a6e..00000000000 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ValidatingWebhookConfigurationTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright (C) 2015 Red Hat, Inc. - * - * 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 io.fabric8.kubernetes.client.mock; - -import io.fabric8.kubernetes.api.model.HasMetadata; -import io.fabric8.kubernetes.api.model.admissionregistration.ValidatingWebhookBuilder; -import io.fabric8.kubernetes.api.model.admissionregistration.ValidatingWebhookConfiguration; -import io.fabric8.kubernetes.api.model.admissionregistration.ValidatingWebhookConfigurationBuilder; -import io.fabric8.kubernetes.client.KubernetesClient; -import io.fabric8.kubernetes.client.server.mock.KubernetesServer; -import org.junit.Rule; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.migrationsupport.rules.EnableRuleMigrationSupport; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -@EnableRuleMigrationSupport -public class ValidatingWebhookConfigurationTest { - @Rule - public KubernetesServer server = new KubernetesServer(); - - @Test - public void create() { - ValidatingWebhookConfiguration validatingWebhookConfiguration = new ValidatingWebhookConfigurationBuilder() - .withNewMetadata().withName("validatingWebhookConfiguration1").endMetadata() - .addToWebhooks(new ValidatingWebhookBuilder() - .withName("webhook1") - .withNewClientConfig() - .withNewService() - .withName("svc1") - .withNamespace("test") - .withPath("/validate") - .endService() - .endClientConfig() - .build()) - .build(); - - server.expect().post().withPath("/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations").andReturn(201, validatingWebhookConfiguration).once(); - - KubernetesClient client = server.getClient(); - HasMetadata response = client.resource(validatingWebhookConfiguration).inNamespace("test").createOrReplace(); - assertEquals(validatingWebhookConfiguration, response); - } -} diff --git a/kubernetes-tests/src/test/resources/v1-vwc.yml b/kubernetes-tests/src/test/resources/v1-vwc.yml new file mode 100644 index 00000000000..8d207b244e1 --- /dev/null +++ b/kubernetes-tests/src/test/resources/v1-vwc.yml @@ -0,0 +1,36 @@ +# +# Copyright (C) 2015 Red Hat, Inc. +# +# 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. +# + +apiVersion: admissionregistration.k8s.io/v1 +kind: ValidatingWebhookConfiguration +metadata: + name: "pod-policy.example.com" +webhooks: + - name: "pod-policy.example.com" + rules: + - apiGroups: [""] + apiVersions: ["v1"] + operations: ["CREATE"] + resources: ["pods"] + scope: "Namespaced" + clientConfig: + service: + namespace: "example-namespace" + name: "example-service" + caBundle: "Ci0tLS0tQk...<`caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate.>...tLS0K" + admissionReviewVersions: ["v1", "v1beta1"] + sideEffects: None + timeoutSeconds: 5 diff --git a/kubernetes-tests/src/test/resources/v1beta1-vwc.yml b/kubernetes-tests/src/test/resources/v1beta1-vwc.yml new file mode 100644 index 00000000000..30d52959564 --- /dev/null +++ b/kubernetes-tests/src/test/resources/v1beta1-vwc.yml @@ -0,0 +1,35 @@ +# +# Copyright (C) 2015 Red Hat, Inc. +# +# 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. +# + +apiVersion: admissionregistration.k8s.io/v1beta1 +kind: ValidatingWebhookConfiguration +metadata: + name: "pod-policy.example.com" +webhooks: + - name: "pod-policy.example.com" + rules: + - apiGroups: [""] + apiVersions: ["v1"] + operations: ["CREATE"] + resources: ["pods"] + scope: "Namespaced" + clientConfig: + service: + namespace: "example-namespace" + name: "example-service" + caBundle: "Ci0tLS0tQk...<`caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate>...tLS0K" + admissionReviewVersions: ["v1beta1"] + timeoutSeconds: 5 diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/DefaultOpenShiftClient.java b/openshift-client/src/main/java/io/fabric8/openshift/client/DefaultOpenShiftClient.java index 42788b1533d..074548afee8 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/DefaultOpenShiftClient.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/DefaultOpenShiftClient.java @@ -501,6 +501,11 @@ public V1APIGroupDSL v1() { return adapt(V1APIGroupDSL.class); } + @Override + public AdmissionRegistrationAPIGroupDSL admissionRegistration() { + return adapt(AdmissionRegistrationAPIGroupClient.class); + } + @Override public AppsAPIGroupDSL apps() { return adapt(AppsAPIGroupClient.class); diff --git a/openshift-client/src/main/java/io/fabric8/openshift/client/osgi/ManagedOpenShiftClient.java b/openshift-client/src/main/java/io/fabric8/openshift/client/osgi/ManagedOpenShiftClient.java index 0a1f16acc9b..f71396eda14 100644 --- a/openshift-client/src/main/java/io/fabric8/openshift/client/osgi/ManagedOpenShiftClient.java +++ b/openshift-client/src/main/java/io/fabric8/openshift/client/osgi/ManagedOpenShiftClient.java @@ -28,6 +28,7 @@ import io.fabric8.kubernetes.api.model.coordination.v1.DoneableLease; import io.fabric8.kubernetes.api.model.coordination.v1.Lease; import io.fabric8.kubernetes.api.model.coordination.v1.LeaseList; +import io.fabric8.kubernetes.client.AdmissionRegistrationAPIGroupDSL; import io.fabric8.kubernetes.client.BaseClient; import io.fabric8.kubernetes.client.Config; import io.fabric8.kubernetes.client.RequestConfig; @@ -475,6 +476,11 @@ public V1APIGroupDSL v1() { return delegate.v1(); } + @Override + public AdmissionRegistrationAPIGroupDSL admissionRegistration() { + return delegate.admissionRegistration(); + } + @Override public AppsAPIGroupDSL apps() { return delegate.apps();