From 5c63a08cacf2602505215e6078c72f7167be1750 Mon Sep 17 00:00:00 2001 From: Anurag Singh Rajawat Date: Fri, 4 Mar 2022 11:48:20 +0530 Subject: [PATCH] Fix #3921 removing AutoAdaptableKubernetesClient class --- .../client/AutoAdaptableKubernetesClient.java | 281 ------------------ 1 file changed, 281 deletions(-) delete mode 100644 kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AutoAdaptableKubernetesClient.java 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 deleted file mode 100644 index 64901bb9eec..00000000000 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/AutoAdaptableKubernetesClient.java +++ /dev/null @@ -1,281 +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; - -import io.fabric8.kubernetes.api.model.ComponentStatus; -import io.fabric8.kubernetes.api.model.ComponentStatusList; -import io.fabric8.kubernetes.api.model.ConfigMap; -import io.fabric8.kubernetes.api.model.ConfigMapList; -import io.fabric8.kubernetes.api.model.Endpoints; -import io.fabric8.kubernetes.api.model.EndpointsList; -import io.fabric8.kubernetes.api.model.HasMetadata; -import io.fabric8.kubernetes.api.model.KubernetesResourceList; -import io.fabric8.kubernetes.api.model.LimitRange; -import io.fabric8.kubernetes.api.model.LimitRangeList; -import io.fabric8.kubernetes.api.model.Namespace; -import io.fabric8.kubernetes.api.model.NamespaceList; -import io.fabric8.kubernetes.api.model.Node; -import io.fabric8.kubernetes.api.model.NodeList; -import io.fabric8.kubernetes.api.model.PersistentVolume; -import io.fabric8.kubernetes.api.model.PersistentVolumeList; -import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; -import io.fabric8.kubernetes.api.model.PersistentVolumeClaimList; -import io.fabric8.kubernetes.api.model.Pod; -import io.fabric8.kubernetes.api.model.PodList; -import io.fabric8.kubernetes.api.model.ReplicationController; -import io.fabric8.kubernetes.api.model.ReplicationControllerList; -import io.fabric8.kubernetes.api.model.ResourceQuota; -import io.fabric8.kubernetes.api.model.ResourceQuotaList; -import io.fabric8.kubernetes.api.model.RootPaths; -import io.fabric8.kubernetes.api.model.Secret; -import io.fabric8.kubernetes.api.model.SecretList; -import io.fabric8.kubernetes.client.dsl.*; -import io.fabric8.kubernetes.api.model.Service; -import io.fabric8.kubernetes.api.model.ServiceAccount; -import io.fabric8.kubernetes.api.model.ServiceAccountList; -import io.fabric8.kubernetes.api.model.ServiceList; -import io.fabric8.kubernetes.client.extended.run.RunOperations; - -import java.io.InputStream; -import java.net.URL; - -public class AutoAdaptableKubernetesClient extends DefaultKubernetesClient { - - private KubernetesClient delegate; - - public AutoAdaptableKubernetesClient() { - delegate = adapt(new DefaultKubernetesClient()); - } - - public AutoAdaptableKubernetesClient(ClientContext clientContext) { - delegate = adapt(new DefaultKubernetesClient(clientContext)); - } - - public AutoAdaptableKubernetesClient(Config config) { - delegate = adapt(new DefaultKubernetesClient(config)); - } - - public AutoAdaptableKubernetesClient(String masterUrl) { - delegate = adapt(new DefaultKubernetesClient(masterUrl)); - } - - - public static KubernetesClient adapt(KubernetesClient initial) { - KubernetesClient result = initial; - for (ExtensionAdapter adapter : Adapters.list(KubernetesClient.class)) { - if (adapter.isAdaptable(result)) { - result = adapter.adapt(result); - } - } - return result; - } - - @Override - public NamespacedKubernetesClient inNamespace(String namespace) { - Config updated = new ConfigBuilder(getConfiguration()).withNamespace(namespace).withDefaultNamespace(false).build(); - return new AutoAdaptableKubernetesClient(newState(updated)); - } - - @Override - public ExtensionsAPIGroupDSL extensions() { - return delegate.extensions(); - } - - @Override - public VersionInfo getVersion() { - return delegate.getVersion(); - } - - @Override - public AdmissionRegistrationAPIGroupDSL admissionRegistration() { - return delegate.admissionRegistration(); - } - - @Override - public AppsAPIGroupDSL apps() { - return delegate.apps(); - } - - @Override - public AutoscalingAPIGroupDSL autoscaling() { - return delegate.autoscaling(); - } - - @Override - public AuthorizationAPIGroupDSL authorization() { - return delegate.authorization(); - } - - @Override - public DiscoveryAPIGroupDSL discovery() { - return delegate.discovery(); - } - - @Override - public NetworkAPIGroupDSL network() { return delegate.network(); } - - @Override - public StorageAPIGroupDSL storage() { return delegate.storage(); } - - @Override - public BatchAPIGroupDSL batch() { return delegate.batch(); } - - @Override - public PolicyAPIGroupDSL policy() { return delegate.policy(); } - - @Override - public RbacAPIGroupDSL rbac() { return delegate.rbac(); } - - @Override - public NonNamespaceOperation> componentstatuses() { - return delegate.componentstatuses(); - } - - @Override - public ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable load(InputStream is) { - return delegate.load(is); - } - - @Override - public NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(KubernetesResourceList is) { - return delegate.resourceList(is); - } - - @Override - public ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable resourceList(String s) { - return delegate.resourceList(s); - } - - @Override - public NamespaceableResource resource(HasMetadata is) { - return delegate.resource(is); - } - - @Override - public NamespaceableResource resource(String s) { - return delegate.resource(s); - } - - @Override - public MixedOperation> endpoints() { - return delegate.endpoints(); - } - - @Override - public NonNamespaceOperation> namespaces() { - return delegate.namespaces(); - } - - @Override - public NonNamespaceOperation> nodes() { - return delegate.nodes(); - } - - @Override - public NonNamespaceOperation> persistentVolumes() { - return delegate.persistentVolumes(); - } - - @Override - public MixedOperation> persistentVolumeClaims() { - return delegate.persistentVolumeClaims(); - } - - @Override - public MixedOperation> pods() { - return delegate.pods(); - } - - @Override - public MixedOperation> replicationControllers() { - return delegate.replicationControllers(); - } - - @Override - public MixedOperation> resourceQuotas() { - return delegate.resourceQuotas(); - } - - @Override - public MixedOperation> secrets() { - return delegate.secrets(); - } - - @Override - public MixedOperation> services() { - return delegate.services(); - } - - @Override - public MixedOperation> serviceAccounts() { - return delegate.serviceAccounts(); - } - - @Override - public MixedOperation> configMaps() { - return delegate.configMaps(); - } - - @Override - public MixedOperation> limitRanges() { - return delegate.limitRanges(); - } - - @Override - public RunOperations run() { - return delegate.run(); - } - - @Override - public Boolean isAdaptable(Class type) { - return delegate.isAdaptable(type); - } - - @Override - public C adapt(Class type) { - return delegate.adapt(type); - } - - @Override - public URL getMasterUrl() { - return delegate.getMasterUrl(); - } - - @Override - public String getApiVersion() { - return delegate.getApiVersion(); - } - - @Override - public String getNamespace() { - return delegate.getNamespace(); - } - - @Override - public RootPaths rootPaths() { - return delegate.rootPaths(); - } - - @Override - public void close() { - delegate.close(); - } - - @Override - public Config getConfiguration() { - return delegate.getConfiguration(); - } -}