Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanKanojia committed Aug 11, 2020
1 parent e8c47dc commit ee364b3
Show file tree
Hide file tree
Showing 38 changed files with 2,208 additions and 1,039 deletions.
@@ -0,0 +1,39 @@
/**
* 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.client.dsl.AuthorizationAPIGroupDSL;
import okhttp3.OkHttpClient;

public class AuthorizationAPIGroupClient extends BaseClient implements AuthorizationAPIGroupDSL {
public AuthorizationAPIGroupClient() {
super();
}

public AuthorizationAPIGroupClient(OkHttpClient httpClient, final Config config) {
super(httpClient, config);
}

@Override
public V1AuthorizationAPIGroupDSL v1() {
return adapt(V1AuthorizationAPIGroupClient.class);
}

@Override
public V1beta1AuthorizationAPIGroupDSL v1beta1() {
return adapt(V1beta1AuthorizationAPIGroupClient.class);
}
}
@@ -0,0 +1,37 @@
/**
* 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 AuthorizationAPIGroupExtensionAdapter extends APIGroupExtensionAdapter<AuthorizationAPIGroupClient> {

@Override
protected String getAPIGroupName() {
return "authorization";
}

@Override
public Class<AuthorizationAPIGroupClient> getExtensionType() {
return AuthorizationAPIGroupClient.class;
}

@Override
protected AuthorizationAPIGroupClient newInstance(Client client) {
return new AuthorizationAPIGroupClient(client.adapt(OkHttpClient.class), client.getConfiguration());
}

}
Expand Up @@ -136,6 +136,11 @@ public AutoscalingAPIGroupDSL autoscaling() {
return delegate.autoscaling();
}

@Override
public AuthorizationAPIGroupDSL authorization() {
return delegate.authorization();
}

@Override
public NetworkAPIGroupDSL network() { return delegate.network(); }

Expand Down Expand Up @@ -251,11 +256,6 @@ public MixedOperation<ConfigMap, ConfigMapList, DoneableConfigMap, Resource<Conf
return delegate.configMaps();
}

@Override
public SubjectAccessReviewDSL subjectAccessReviewAuth() {
return delegate.subjectAccessReviewAuth();
}

@Override
public MixedOperation<LimitRange, LimitRangeList, DoneableLimitRange, Resource<LimitRange, DoneableLimitRange>> limitRanges() {
return delegate.limitRanges();
Expand Down
Expand Up @@ -94,7 +94,6 @@
import io.fabric8.kubernetes.client.dsl.internal.RawCustomResourceOperationsImpl;
import io.fabric8.kubernetes.client.dsl.internal.core.v1.ReplicationControllerOperationsImpl;
import io.fabric8.kubernetes.client.dsl.internal.core.v1.ServiceOperationsImpl;
import io.fabric8.kubernetes.client.dsl.internal.SubjectAccessReviewDSLImpl;
import io.fabric8.kubernetes.client.dsl.internal.coordination.v1.LeaseOperationsImpl;
import io.fabric8.kubernetes.client.dsl.internal.core.v1.BindingOperationsImpl;
import io.fabric8.kubernetes.client.dsl.internal.core.v1.ConfigMapOperationsImpl;
Expand Down Expand Up @@ -293,6 +292,11 @@ public ApiextensionsAPIGroupDSL apiextensions() {
return adapt(ApiextensionsAPIGroupClient.class);
}

@Override
public AuthorizationAPIGroupDSL authorization() {
return adapt(AuthorizationAPIGroupClient.class);
}

@Override
public <T extends HasMetadata, L extends KubernetesResourceList<T>, D extends Doneable<T>> MixedOperation<T, L, D, Resource<T, D>> customResources(CustomResourceDefinitionContext crdContext, Class<T> resourceType, Class<L> listClass, Class<D> doneClass) {
return new CustomResourceOperationsImpl<>(new CustomResourceOperationContext().withOkhttpClient(httpClient).withConfig(getConfiguration())
Expand Down Expand Up @@ -392,11 +396,6 @@ public AutoscalingAPIGroupDSL autoscaling() {
@Override
public SettingsAPIGroupDSL settings() { return adapt(SettingsAPIGroupClient.class); }

@Override
public SubjectAccessReviewDSL subjectAccessReviewAuth() {
return new SubjectAccessReviewDSLImpl(httpClient, getConfiguration());
}

@Override
public SharedInformerFactory informers() {
return new SharedInformerFactory(ForkJoinPool.commonPool(), httpClient, getConfiguration());
Expand Down
Expand Up @@ -447,11 +447,11 @@ public interface KubernetesClient extends Client {
MixedOperation<LimitRange, LimitRangeList, DoneableLimitRange, Resource<LimitRange, DoneableLimitRange>> limitRanges();

/**
* SubjectAccessReview operations. (authorization/v1)
* Authorization operations. (authorization/v1)
*
* @return SubjectAccessReviewDSL object for dealing with SubjectAccessReviewOperations
* @return AuthorizationAPIGroupDSL object for dealing with Authorization objects
*/
SubjectAccessReviewDSL subjectAccessReviewAuth();
AuthorizationAPIGroupDSL authorization();

/**
* Get an instance of Kubernetes Client informer factory. It allows you to construct and
Expand Down
Expand Up @@ -13,18 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.fabric8.kubernetes.client;

package io.fabric8.openshift.client.dsl;

import io.fabric8.kubernetes.api.model.Doneable;
import io.fabric8.kubernetes.client.dsl.Createable;
import io.fabric8.openshift.api.model.LocalSubjectAccessReview;
import io.fabric8.openshift.api.model.LocalSubjectAccessReviewFluentImpl;
import io.fabric8.openshift.api.model.SubjectAccessReviewResponse;

public abstract class CreateableLocalSubjectAccessReview extends
LocalSubjectAccessReviewFluentImpl<CreateableLocalSubjectAccessReview>
implements
Doneable<SubjectAccessReviewResponse>,
Createable<LocalSubjectAccessReview, SubjectAccessReviewResponse, CreateableLocalSubjectAccessReview> {
public interface SubjectAccessOperations<T, D> extends Createable<T, T, D> {
}
@@ -0,0 +1,62 @@
/**
* 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.authorization.v1.DoneableLocalSubjectAccessReview;
import io.fabric8.kubernetes.api.model.authorization.v1.DoneableSelfSubjectAccessReview;
import io.fabric8.kubernetes.api.model.authorization.v1.DoneableSelfSubjectRulesReview;
import io.fabric8.kubernetes.api.model.authorization.v1.DoneableSubjectAccessReview;
import io.fabric8.kubernetes.api.model.authorization.v1.LocalSubjectAccessReview;
import io.fabric8.kubernetes.api.model.authorization.v1.SelfSubjectAccessReview;
import io.fabric8.kubernetes.api.model.authorization.v1.SelfSubjectRulesReview;
import io.fabric8.kubernetes.api.model.authorization.v1.SubjectAccessReview;
import io.fabric8.kubernetes.client.dsl.internal.LocalSubjectAccessReviewOperationsImpl;
import io.fabric8.kubernetes.client.dsl.internal.SubjectAccessOperationsImpl;
import io.fabric8.kubernetes.client.utils.Utils;
import okhttp3.OkHttpClient;

public class V1AuthorizationAPIGroupClient extends BaseClient implements V1AuthorizationAPIGroupDSL {
public static final String AUTHORIZATION_APIGROUP = "authorization.k8s.io";
public static final String AUTHORIZATION_APIVERSION = "v1";

public V1AuthorizationAPIGroupClient() {
super();
}

public V1AuthorizationAPIGroupClient(OkHttpClient httpClient, final Config config) {
super(httpClient, config);
}

@Override
public SubjectAccessOperations<SelfSubjectAccessReview, DoneableSelfSubjectAccessReview> selfSubjectAccessReview() {
return new SubjectAccessOperationsImpl<>(getHttpClient(), getConfiguration(), AUTHORIZATION_APIGROUP, AUTHORIZATION_APIVERSION, Utils.getPluralFromKind(io.fabric8.kubernetes.api.model.authorization.v1beta1.SelfSubjectAccessReview.class.getSimpleName()), SelfSubjectAccessReview.class);
}

@Override
public SubjectAccessOperations<SubjectAccessReview, DoneableSubjectAccessReview> subjectAccessReview() {
return new SubjectAccessOperationsImpl<>(getHttpClient(), getConfiguration(), AUTHORIZATION_APIGROUP, AUTHORIZATION_APIVERSION, Utils.getPluralFromKind(io.fabric8.kubernetes.api.model.authorization.v1beta1.SubjectAccessReview.class.getSimpleName()), SubjectAccessReview.class);
}

@Override
public LocalSubjectAccessReviewOperationsImpl<LocalSubjectAccessReview, DoneableLocalSubjectAccessReview> localSubjectAccessReview() {
return new LocalSubjectAccessReviewOperationsImpl<>(getHttpClient(), getConfiguration(), AUTHORIZATION_APIGROUP, AUTHORIZATION_APIVERSION, Utils.getPluralFromKind(io.fabric8.kubernetes.api.model.authorization.v1beta1.LocalSubjectAccessReview.class.getSimpleName()), LocalSubjectAccessReview.class);
}

@Override
public SubjectAccessOperations<SelfSubjectRulesReview, DoneableSelfSubjectRulesReview> selfSubjectRulesReview() {
return new SubjectAccessOperationsImpl<>(getHttpClient(), getConfiguration(), AUTHORIZATION_APIGROUP, AUTHORIZATION_APIVERSION, Utils.getPluralFromKind(io.fabric8.kubernetes.api.model.authorization.v1beta1.SelfSubjectRulesReview.class.getSimpleName()), SelfSubjectRulesReview.class);
}
}
@@ -0,0 +1,33 @@
/**
* 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.authorization.v1.DoneableLocalSubjectAccessReview;
import io.fabric8.kubernetes.api.model.authorization.v1.DoneableSelfSubjectAccessReview;
import io.fabric8.kubernetes.api.model.authorization.v1.DoneableSelfSubjectRulesReview;
import io.fabric8.kubernetes.api.model.authorization.v1.DoneableSubjectAccessReview;
import io.fabric8.kubernetes.api.model.authorization.v1.LocalSubjectAccessReview;
import io.fabric8.kubernetes.api.model.authorization.v1.SelfSubjectAccessReview;
import io.fabric8.kubernetes.api.model.authorization.v1.SelfSubjectRulesReview;
import io.fabric8.kubernetes.api.model.authorization.v1.SubjectAccessReview;
import io.fabric8.kubernetes.client.dsl.internal.LocalSubjectAccessReviewOperationsImpl;

public interface V1AuthorizationAPIGroupDSL extends Client{
SubjectAccessOperations<SelfSubjectAccessReview, DoneableSelfSubjectAccessReview> selfSubjectAccessReview();
SubjectAccessOperations<SubjectAccessReview, DoneableSubjectAccessReview> subjectAccessReview();
LocalSubjectAccessReviewOperationsImpl<LocalSubjectAccessReview, DoneableLocalSubjectAccessReview> localSubjectAccessReview();
SubjectAccessOperations<SelfSubjectRulesReview, DoneableSelfSubjectRulesReview> selfSubjectRulesReview();
}
@@ -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 V1AuthorizationAPIGroupExtensionAdapter extends APIGroupExtensionAdapter<V1AuthorizationAPIGroupClient> {
@Override
protected String getAPIGroupName() {
return "authorization/v1";
}

@Override
public Class<V1AuthorizationAPIGroupClient> getExtensionType() {
return V1AuthorizationAPIGroupClient.class;
}

@Override
protected V1AuthorizationAPIGroupClient newInstance(Client client) {
return new V1AuthorizationAPIGroupClient(client.adapt(OkHttpClient.class), client.getConfiguration());
}
}
@@ -0,0 +1,63 @@
/**
* 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.authorization.v1beta1.DoneableLocalSubjectAccessReview;
import io.fabric8.kubernetes.api.model.authorization.v1beta1.DoneableSelfSubjectAccessReview;
import io.fabric8.kubernetes.api.model.authorization.v1beta1.DoneableSelfSubjectRulesReview;
import io.fabric8.kubernetes.api.model.authorization.v1beta1.DoneableSubjectAccessReview;
import io.fabric8.kubernetes.api.model.authorization.v1beta1.LocalSubjectAccessReview;
import io.fabric8.kubernetes.api.model.authorization.v1beta1.SelfSubjectAccessReview;
import io.fabric8.kubernetes.api.model.authorization.v1beta1.SelfSubjectRulesReview;
import io.fabric8.kubernetes.api.model.authorization.v1beta1.SubjectAccessReview;
import io.fabric8.kubernetes.client.dsl.internal.LocalSubjectAccessReviewOperationsImpl;
import io.fabric8.kubernetes.client.dsl.internal.SubjectAccessOperationsImpl;
import io.fabric8.kubernetes.client.utils.Utils;
import okhttp3.OkHttpClient;

public class V1beta1AuthorizationAPIGroupClient extends BaseClient implements V1beta1AuthorizationAPIGroupDSL {

public static final String AUTHORIZATION_APIGROUP = "authorization.k8s.io";
public static final String AUTHORIZATION_APIVERSION = "v1beta1";

public V1beta1AuthorizationAPIGroupClient() {
super();
}

public V1beta1AuthorizationAPIGroupClient(OkHttpClient httpClient, final Config config) {
super(httpClient, config);
}

@Override
public SubjectAccessOperations<SelfSubjectAccessReview, DoneableSelfSubjectAccessReview> selfSubjectAccessReview() {
return new SubjectAccessOperationsImpl<>(getHttpClient(), getConfiguration(), AUTHORIZATION_APIGROUP, AUTHORIZATION_APIVERSION, Utils.getPluralFromKind(SelfSubjectAccessReview.class.getSimpleName()), SelfSubjectAccessReview.class);
}

@Override
public SubjectAccessOperations<SubjectAccessReview, DoneableSubjectAccessReview> subjectAccessReview() {
return new SubjectAccessOperationsImpl<>(getHttpClient(), getConfiguration(), AUTHORIZATION_APIGROUP, AUTHORIZATION_APIVERSION, Utils.getPluralFromKind(SubjectAccessReview.class.getSimpleName()), SubjectAccessReview.class);
}

@Override
public LocalSubjectAccessReviewOperationsImpl<LocalSubjectAccessReview, DoneableLocalSubjectAccessReview> localSubjectAccessReview() {
return new LocalSubjectAccessReviewOperationsImpl<>(getHttpClient(), getConfiguration(), AUTHORIZATION_APIGROUP, AUTHORIZATION_APIVERSION, Utils.getPluralFromKind(LocalSubjectAccessReview.class.getSimpleName()), LocalSubjectAccessReview.class);
}

@Override
public SubjectAccessOperations<SelfSubjectRulesReview, DoneableSelfSubjectRulesReview> selfSubjectRulesReview() {
return new SubjectAccessOperationsImpl<>(getHttpClient(), getConfiguration(), AUTHORIZATION_APIGROUP, AUTHORIZATION_APIVERSION, Utils.getPluralFromKind(SelfSubjectRulesReview.class.getSimpleName()), SelfSubjectRulesReview.class);
}
}

0 comments on commit ee364b3

Please sign in to comment.