use of io.fabric8.kubernetes.api.model.extensions.DeploymentList in project strimzi by strimzi.
the class MockKube method build.
public KubernetesClient build() {
KubernetesClient mockClient = mock(KubernetesClient.class);
MixedOperation<ConfigMap, ConfigMapList, DoneableConfigMap, Resource<ConfigMap, DoneableConfigMap>> mockCms = buildConfigMaps();
MixedOperation<PersistentVolumeClaim, PersistentVolumeClaimList, DoneablePersistentVolumeClaim, Resource<PersistentVolumeClaim, DoneablePersistentVolumeClaim>> mockPvcs = buildPvcs();
MixedOperation<Endpoints, EndpointsList, DoneableEndpoints, Resource<Endpoints, DoneableEndpoints>> mockEndpoints = buildEndpoints();
MixedOperation<Service, ServiceList, DoneableService, Resource<Service, DoneableService>> mockSvc = buildServices();
MixedOperation<Pod, PodList, DoneablePod, PodResource<Pod, DoneablePod>> mockPods = buildPods();
MixedOperation<StatefulSet, StatefulSetList, DoneableStatefulSet, RollableScalableResource<StatefulSet, DoneableStatefulSet>> mockSs = buildStatefulSets(mockPods);
MixedOperation<Deployment, DeploymentList, DoneableDeployment, ScalableResource<Deployment, DoneableDeployment>> mockDep = buildDeployments();
when(mockClient.configMaps()).thenReturn(mockCms);
when(mockClient.services()).thenReturn(mockSvc);
AppsAPIGroupDSL api = mock(AppsAPIGroupDSL.class);
when(api.statefulSets()).thenReturn(mockSs);
when(mockClient.apps()).thenReturn(api);
ExtensionsAPIGroupDSL ext = mock(ExtensionsAPIGroupDSL.class);
when(mockClient.extensions()).thenReturn(ext);
when(ext.deployments()).thenReturn(mockDep);
when(mockClient.pods()).thenReturn(mockPods);
when(mockClient.endpoints()).thenReturn(mockEndpoints);
when(mockClient.persistentVolumeClaims()).thenReturn(mockPvcs);
return mockClient;
}
use of io.fabric8.kubernetes.api.model.extensions.DeploymentList in project jointware by isdream.
the class OpenshiftAPIExample method main.
/**
* @param args
*/
public static void main(String[] args) {
DefaultOpenShiftClient client = createClient();
client.pods();
client.extensions().deployments();
client.replicationControllers();
client.secrets();
MixedOperation<Deployment, DeploymentList, DoneableDeployment, ScalableResource<Deployment, DoneableDeployment>> deployment = client.extensions().deployments();
System.out.println(deployment.list().getItems());
}
use of io.fabric8.kubernetes.api.model.extensions.DeploymentList in project jointware by isdream.
the class KubernetesAPIExample method main.
/**
* @param args
*/
public static void main(String[] args) {
DefaultKubernetesClient client = createClient();
client.pods();
client.extensions().deployments();
client.replicationControllers();
client.secrets();
MixedOperation<Deployment, DeploymentList, DoneableDeployment, ScalableResource<Deployment, DoneableDeployment>> deployment = client.extensions().deployments();
System.out.println(deployment.list().getItems());
}
Aggregations