Skip to content

Commit

Permalink
Merge pull request #2663 from rohanKanojia/pr/issue2642
Browse files Browse the repository at this point in the history
  • Loading branch information
fusesource-ci authored Dec 15, 2020
2 parents 1d1b39e + a5392dd commit cbc5d52
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#### Improvements
* Fix: CustomResourceDefinitionContext.fromCrd support for v1 CustomResourceDefinition
* Fix #2642: Update kubernetes-examples to use apps/v1 Deployment rather than extensions/v1beta1

#### Dependency Upgrade

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,27 @@
import io.fabric8.kubernetes.client.DefaultKubernetesClient;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.utils.Utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;
import java.util.Map;

public class LoadMultipleDocumentsFromFileExample {
private static final Logger logger = LoggerFactory.getLogger(LoadMultipleDocumentsFromFileExample.class);

public static void main(String[] args) throws InterruptedException {
public static void main(String[] args) {
String master = "https://localhost:8443/";
if (args.length == 1) {
master = args[0];
}

Config config = new ConfigBuilder().withMasterUrl(master).build();
try (KubernetesClient client = new DefaultKubernetesClient(config)) {
try (final KubernetesClient client = new DefaultKubernetesClient(config)) {
List<HasMetadata> list = client.load(LoadMultipleDocumentsFromFileExample.class.getResourceAsStream("/multiple-document-template.yml")).get();
System.out.println("Found in file:" + list.size() + " items.");
logger.info("Found in file: {} items.", list.size());
for (HasMetadata meta : list) {
System.out.println(display(meta));
logger.info(display(meta));
}

list = client.load(LoadMultipleDocumentsFromFileExample.class.getResourceAsStream("/multiple-document-template.yml"))
Expand All @@ -51,9 +54,9 @@ public void visit(ObjectMetaBuilder item) {
}
}).get();

System.out.println("Visited:" + list.size() + " items.");
logger.info("Visited: {} items.", list.size());
for (HasMetadata meta : list) {
System.out.println(display(meta));
logger.info(display(meta));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
tier: backend
role: master
---
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis---master---
Expand Down Expand Up @@ -70,7 +70,7 @@ spec:
tier: backend
role: slave
---
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis-slave
Expand Down Expand Up @@ -118,7 +118,7 @@ spec:
app: guestbook
tier: frontend
---
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
Expand Down

0 comments on commit cbc5d52

Please sign in to comment.