public DeploymentConfigListFluentImpl(DeploymentConfigList instance){ this.withApiVersion(instance.getApiVersion()); this.withItems(instance.getItems()); this.withKind(instance.getKind()); this.withMetadata(instance.getMetadata()); }
public DeploymentConfigListBuilder( DeploymentConfigListFluent<?> fluent ){ this(fluent, new DeploymentConfigList()); } public DeploymentConfigListBuilder( DeploymentConfigListFluent<?> fluent , DeploymentConfigList instance ){
public static void main(String[] args) { try { OpenShiftClient client = new DefaultOpenShiftClient(); if (!client.supportsOpenShiftAPIGroup(OpenShiftAPIGroups.APPS)) { System.out.println("WARNING this cluster does not support the API Group " + OpenShiftAPIGroups.APPS); return; } DeploymentConfigList list = client.deploymentConfigs().list(); if (list == null) { System.out.println("ERROR no list returned!"); return; } List<DeploymentConfig> items = list.getItems(); for (DeploymentConfig item : items) { System.out.println("DeploymentConfig " + item.getMetadata().getName() + " has version: " + item.getApiVersion()); } if (items.size() > 0) { // lets check .get() too DeploymentConfig deploymentConfig = items.get(0); String name = deploymentConfig.getMetadata().getName(); deploymentConfig = client.deploymentConfigs().withName(name).get(); assertNotNull("No DeploymentConfig found for name " + name, deploymentConfig); System.out.println("get() DeploymentConfig " + name + " has version: " + deploymentConfig.getApiVersion()); } } catch (KubernetesClientException e) { System.out.println("Failed: " + e); e.printStackTrace(); } }
List<DeploymentConfig> items = list.getItems(); assertNotNull("No DeploymentConfigList.getItems() returned", items);
public DeploymentConfigListBuilder( DeploymentConfigListFluent<?> fluent , DeploymentConfigList instance ){ this.fluent = fluent; fluent.withApiVersion(instance.getApiVersion()); fluent.withItems(instance.getItems()); fluent.withKind(instance.getKind()); fluent.withMetadata(instance.getMetadata()); } public DeploymentConfigListBuilder( DeploymentConfigList instance ){
@Override public List<DeploymentConfig> getDeploymentsByLabel(Map<String, String> labels) { return openShiftClient.deploymentConfigs().withLabels(labels).list().getItems(); }
public DeploymentConfigListBuilder(){ this(new DeploymentConfigList()); } public DeploymentConfigListBuilder( DeploymentConfigListFluent<?> fluent ){
public DeploymentConfigListBuilder( DeploymentConfigList instance ){ this.fluent = this; this.withApiVersion(instance.getApiVersion()); this.withItems(instance.getItems()); this.withKind(instance.getKind()); this.withMetadata(instance.getMetadata()); }
@Override public List<DeploymentConfig> getDeploymentsByLabel(Map<String, String> labels) { return openShiftClient.deploymentConfigs().withLabels(labels).list().getItems(); }
public DeploymentConfigListBuilder(){ this(new DeploymentConfigList()); } public DeploymentConfigListBuilder( DeploymentConfigListFluent<?> fluent ){
public DeploymentConfigListBuilder(DeploymentConfigListFluent<?> fluent,DeploymentConfigList instance,Boolean validationEnabled){ this.fluent = fluent; fluent.withApiVersion(instance.getApiVersion()); fluent.withItems(instance.getItems()); fluent.withKind(instance.getKind()); fluent.withMetadata(instance.getMetadata()); this.validationEnabled = validationEnabled; } public DeploymentConfigListBuilder(DeploymentConfigList instance){
@SuppressWarnings({"PMD.AvoidCatchingGenericException", "PMD.ExceptionAsFlowControl"}) protected void addResourceDescriptors(ZipOutputStream os) { Stream<BuildConfig> bcStream = client.buildConfigs().list().getItems().stream(); Stream<DeploymentConfig> dcStream = client.deploymentConfigs().list().getItems().stream(); Stream<ConfigMap> cmStream = client.configMaps().list().getItems().stream(); Stream<ImageStreamTag> istStream = client.imageStreamTags().list().getItems().stream(); Stream<? extends HasMetadata > stream = Stream.concat(bcStream, dcStream); stream = Stream.concat(stream, cmStream); stream = Stream.concat(stream, istStream); stream.forEach( res -> { HasMetadata resWithMetadata = (HasMetadata) res; try { ZipEntry ze = new ZipEntry("descriptors/"+ resWithMetadata.getKind() + '/' + resWithMetadata.getMetadata().getName() + ".YAML"); os.putNextEntry(ze); dumpAsYaml(resWithMetadata, os); os.closeEntry(); } catch (Exception e){ LOG.error("Error adding resource {} {}", resWithMetadata.getKind(), resWithMetadata.getMetadata().getName(), e); } }); }
public DeploymentConfigListBuilder(Boolean validationEnabled){ this(new DeploymentConfigList(), validationEnabled); } public DeploymentConfigListBuilder(DeploymentConfigListFluent<?> fluent){
public DeploymentConfigListBuilder(DeploymentConfigList instance,Boolean validationEnabled){ this.fluent = this; this.withApiVersion(instance.getApiVersion()); this.withItems(instance.getItems()); this.withKind(instance.getKind()); this.withMetadata(instance.getMetadata()); this.validationEnabled = validationEnabled; }
@Override protected boolean isNamespaceEmpty(String namespace) { return client.deploymentConfigs().inNamespace(namespace).list().getItems().isEmpty() && client.services().inNamespace(namespace).list().getItems().isEmpty() && client.secrets().inNamespace(namespace).list().getItems().isEmpty(); }
public DeploymentConfigListBuilder( DeploymentConfigListFluent<?> fluent ){ this(fluent, new DeploymentConfigList()); } public DeploymentConfigListBuilder( DeploymentConfigListFluent<?> fluent , DeploymentConfigList instance ){
public DeploymentConfigListBuilder( DeploymentConfigListFluent<?> fluent , DeploymentConfigList instance ){ this.fluent = fluent; fluent.withApiVersion(instance.getApiVersion()); fluent.withItems(instance.getItems()); fluent.withKind(instance.getKind()); fluent.withMetadata(instance.getMetadata()); } public DeploymentConfigListBuilder( DeploymentConfigList instance ){
List<DeploymentConfig> deploymentConfigs = oClient.deploymentConfigs().inNamespace(session.getNamespace()).list().getItems(); if (deploymentConfigs == null) { throw new MultiException("No deployment configs found in namespace" + session.getNamespace());
public DeploymentConfigListBuilder(DeploymentConfigListFluent<?> fluent,Boolean validationEnabled){ this(fluent, new DeploymentConfigList(), validationEnabled); } public DeploymentConfigListBuilder(DeploymentConfigListFluent<?> fluent,DeploymentConfigList instance){
public DeploymentConfigListBuilder( DeploymentConfigList instance ){ this.fluent = this; this.withApiVersion(instance.getApiVersion()); this.withItems(instance.getItems()); this.withKind(instance.getKind()); this.withMetadata(instance.getMetadata()); }